diff --git a/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberController.java b/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberController.java index 096232c..7195e54 100644 --- a/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberController.java +++ b/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberController.java @@ -6,6 +6,7 @@ import com.leets.team2.xclone.domain.member.dto.requests.MemberFindGetRequest; import com.leets.team2.xclone.domain.member.dto.responses.CheckTagDuplicationGetResponse; import com.leets.team2.xclone.domain.member.dto.responses.MemberFindGetResponse; +import com.leets.team2.xclone.domain.member.dto.responses.MemberTagGetResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -28,4 +29,6 @@ ResponseEntity> getCheckTagDuplication( @Operation(summary = "프로필 사진 수정 API", description = "자신의 프로필 사진을 수정합니다.") ResponseEntity> updateProfilePicture(@RequestPart(value="image",required = false) MultipartFile image); + @Operation(summary = "멤버 Tag 가져오기 API", description = "로그인한 멤버의 Tag를 가져옵니다.") + ResponseEntity> getMemberTag(); } diff --git a/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberControllerImpl.java b/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberControllerImpl.java index 137c4ba..505e890 100644 --- a/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberControllerImpl.java +++ b/src/main/java/com/leets/team2/xclone/domain/member/controller/MemberControllerImpl.java @@ -7,13 +7,19 @@ import com.leets.team2.xclone.domain.member.dto.MemberDTO; import com.leets.team2.xclone.domain.member.dto.requests.CheckTagDuplicationGetRequest; import com.leets.team2.xclone.domain.member.dto.responses.CheckTagDuplicationGetResponse; +import com.leets.team2.xclone.domain.member.dto.responses.MemberTagGetResponse; import com.leets.team2.xclone.domain.member.entities.Member; import com.leets.team2.xclone.domain.member.service.MemberService; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; @Controller @@ -55,4 +61,12 @@ public ResponseEntity> updateProfilePicture(@Request return ApiData.ok(response); } + @Override + @GetMapping("/my-tag") + @UseGuards({MemberGuard.class}) + public ResponseEntity> getMemberTag() { + return ApiData.ok( + new MemberTagGetResponse(MemberContext.getMember().getTag()) + ); + } } diff --git a/src/main/java/com/leets/team2/xclone/domain/member/dto/responses/MemberTagGetResponse.java b/src/main/java/com/leets/team2/xclone/domain/member/dto/responses/MemberTagGetResponse.java new file mode 100644 index 0000000..394f367 --- /dev/null +++ b/src/main/java/com/leets/team2/xclone/domain/member/dto/responses/MemberTagGetResponse.java @@ -0,0 +1,7 @@ +package com.leets.team2.xclone.domain.member.dto.responses; + +public record MemberTagGetResponse( + String tag +) { + +}