-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b030379
commit 97cd243
Showing
5 changed files
with
59 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...hs/dgsw/SOPO_server_v2/domain/member/presentation/controller/MemberProfileController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package kr.hs.dgsw.SOPO_server_v2.domain.member.presentation.controller; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import kr.hs.dgsw.SOPO_server_v2.domain.member.presentation.dto.req.MemberModifyReq; | ||
import kr.hs.dgsw.SOPO_server_v2.domain.member.presentation.dto.res.LoadProfileRes; | ||
import kr.hs.dgsw.SOPO_server_v2.domain.member.service.MemberProfileService; | ||
import kr.hs.dgsw.SOPO_server_v2.domain.member.service.MemberService; | ||
import kr.hs.dgsw.SOPO_server_v2.global.response.Response; | ||
import kr.hs.dgsw.SOPO_server_v2.global.response.ResponseData; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Tag(name = "Profile", description = "Profile Api") | ||
@RestController | ||
@RequestMapping(value = "/profile") | ||
@RequiredArgsConstructor | ||
public class MemberProfileController { | ||
|
||
private final MemberProfileService memberProfileService; | ||
|
||
@PatchMapping("") | ||
public Response modifyMember( | ||
@RequestBody MemberModifyReq memberModifyReq) { | ||
return memberProfileService.memberModify(memberModifyReq); | ||
} | ||
|
||
@GetMapping | ||
public ResponseData<LoadProfileRes> loadProfile(){ | ||
return memberProfileService.loadProfile(); | ||
} | ||
} | ||
|
19 changes: 16 additions & 3 deletions
19
...ain/java/kr/hs/dgsw/SOPO_server_v2/domain/member/presentation/dto/res/loadProfileRes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
package kr.hs.dgsw.SOPO_server_v2.domain.member.presentation.dto.res; | ||
|
||
public record loadProfileRes( | ||
String memberName, | ||
String memberEmail | ||
import kr.hs.dgsw.SOPO_server_v2.domain.member.entity.MemberEntity; | ||
|
||
public record LoadProfileRes( | ||
String memberId, | ||
String memberName, | ||
String memberEmail, | ||
String memberSchool | ||
) { | ||
|
||
public static LoadProfileRes of(MemberEntity member){ | ||
return new LoadProfileRes( | ||
member.getMemberId(), | ||
member.getMemberName(), | ||
member.getMemberEmail(), | ||
member.getMemberSchool() | ||
); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters