Skip to content

Commit

Permalink
feat: 내 태그 가져오기 API 구현 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
soyesenna authored Nov 13, 2024
1 parent 9f51aae commit eb5ed8d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,4 +29,6 @@ ResponseEntity<ApiData<CheckTagDuplicationGetResponse>> getCheckTagDuplication(
@Operation(summary = "프로필 사진 수정 API", description = "자신의 프로필 사진을 수정합니다.")
ResponseEntity<ApiData<MemberDTO.Response>> updateProfilePicture(@RequestPart(value="image",required = false) MultipartFile image);

@Operation(summary = "멤버 Tag 가져오기 API", description = "로그인한 멤버의 Tag를 가져옵니다.")
ResponseEntity<ApiData<MemberTagGetResponse>> getMemberTag();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -55,4 +61,12 @@ public ResponseEntity<ApiData<MemberDTO.Response>> updateProfilePicture(@Request
return ApiData.ok(response);
}

@Override
@GetMapping("/my-tag")
@UseGuards({MemberGuard.class})
public ResponseEntity<ApiData<MemberTagGetResponse>> getMemberTag() {
return ApiData.ok(
new MemberTagGetResponse(MemberContext.getMember().getTag())
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.leets.team2.xclone.domain.member.dto.responses;

public record MemberTagGetResponse(
String tag
) {

}

0 comments on commit eb5ed8d

Please sign in to comment.