-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tag): 템플릿 태그 조회 API 변경 및 인증 확인 추가
- Loading branch information
Showing
5 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
backend/src/main/java/codezap/tag/controller/SpringDocTagController.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,22 @@ | ||
package codezap.tag.controller; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
|
||
import codezap.member.dto.MemberDto; | ||
import codezap.template.dto.response.FindAllTagsResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
|
||
@Tag(name = "태그 API", description = "템플릿 조회 API") | ||
public interface SpringDocTagController { | ||
@Operation(summary = "태그 목록 조회", description = """ | ||
유저가 가지고 있는 태그 목록을 조회합니다. | ||
""") | ||
@ApiResponse(responseCode = "200", description = "태그 목록 조회 성공", | ||
content = {@Content(schema = @Schema(implementation = FindAllTagsResponse.class))}) | ||
ResponseEntity<FindAllTagsResponse> getTags(MemberDto memberDto, Long memberId); | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
backend/src/main/java/codezap/tag/controller/TagController.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 codezap.tag.controller; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import codezap.member.configuration.BasicAuthentication; | ||
import codezap.member.dto.MemberDto; | ||
import codezap.template.dto.response.FindAllTagsResponse; | ||
import codezap.template.service.TemplateService; | ||
|
||
@RestController | ||
@RequestMapping("/tags") | ||
public class TagController implements SpringDocTagController { | ||
|
||
private final TemplateService templateService; | ||
|
||
public TagController(TemplateService templateService) { | ||
this.templateService = templateService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<FindAllTagsResponse> getTags( | ||
@BasicAuthentication MemberDto memberDto, | ||
@RequestParam Long memberId | ||
) { | ||
FindAllTagsResponse response = templateService.findAllTagsByMemberId(memberId); | ||
return ResponseEntity.ok(response); | ||
} | ||
} |
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
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