Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

내 태그 가져오기 API 구현 #60

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
) {

}
Loading