diff --git a/src/main/java/gwangjang/server/domain/contents/domain/entity/constant/ApiType.java b/src/main/java/gwangjang/server/domain/contents/domain/entity/constant/ApiType.java index 830305a..d4d80dc 100644 --- a/src/main/java/gwangjang/server/domain/contents/domain/entity/constant/ApiType.java +++ b/src/main/java/gwangjang/server/domain/contents/domain/entity/constant/ApiType.java @@ -1,12 +1,15 @@ package gwangjang.server.domain.contents.domain.entity.constant; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.RequiredArgsConstructor; @Getter @RequiredArgsConstructor +@JsonFormat(shape = JsonFormat.Shape.STRING) public enum ApiType { - NAVER,YOUTUBE; + NAVER("NAVER"),YOUTUBE("YOUTUBE"); + private final String type; } diff --git a/src/main/java/gwangjang/server/domain/contents/presentation/ContentsController.java b/src/main/java/gwangjang/server/domain/contents/presentation/ContentsController.java index adb8b98..42625b1 100644 --- a/src/main/java/gwangjang/server/domain/contents/presentation/ContentsController.java +++ b/src/main/java/gwangjang/server/domain/contents/presentation/ContentsController.java @@ -70,7 +70,7 @@ public ResponseEntity>> getContentsByLoginId(@ } @GetMapping("/subscribe/{issue}") - public ResponseEntity>> getMySubscribe(@RequestHeader(value = "user-id") String socialId,@PathVariable("issue")String issue) { + public ResponseEntity>> getMySubscribe(@RequestHeader(value = "user-id") String socialId, @PathVariable("issue")String issue) { return ResponseEntity.ok(SuccessResponse.create(GET_MY_CONTENTS.getMessage(), this.contentsSubscribeUseCase.getContentsByIssue(issue))); } @GetMapping("/bubbleChart/{issue}") @@ -108,22 +108,22 @@ public ResponseEntity>> getBubbleChart(@Pat } @GetMapping("/contents/all/like/{type}") - public ResponseEntity>> getContentsWithLikeCount(@RequestHeader(value = "user-id") String socialId,@PathVariable ApiType type) { + public ResponseEntity>> getContentsWithLikeCount(@RequestHeader(value = "user-id") String socialId,@PathVariable("type") ApiType type) { String userId = "testId"; System.out.println(type); - return ResponseEntity.ok(SuccessResponse.create(GET_MY_CONTENTS.getMessage(), this.contentsService.getContentsWithLikeCount(socialId,type))); + return ResponseEntity.ok(SuccessResponse.create(GET_CONTENTS_SUCCESS.getMessage(), this.contentsService.getContentsWithLikeCount(socialId,type))); }//@RequestHeader(value = "user-id") String socialId @GetMapping("/contents/keyword/{keyword}/{type}") - public ResponseEntity>> getContentsKeyword(@RequestHeader(value = "user-id") String socialId,@PathVariable ApiType type,@PathVariable("keyword") String keyword) { + public ResponseEntity>> getContentsKeyword(@RequestHeader(value = "user-id") String socialId,@PathVariable("keyword") String keyword,@PathVariable("type") ApiType type) { String userId = "testId"; System.out.println(type); - return ResponseEntity.ok(SuccessResponse.create(GET_MY_CONTENTS.getMessage(), this.contentsService.getContentsKeyword( socialId, type, keyword))); + return ResponseEntity.ok(SuccessResponse.create(GET_CONTENTS_SUCCESS.getMessage(), this.contentsService.getContentsKeyword( socialId, type, keyword))); }//@RequestHeader(value = "user-id") String socialId @GetMapping("/contents/issue/{issue}/{type}") - public ResponseEntity>> getContentsIssue(@RequestHeader(value = "user-id") String socialId,@PathVariable("type") ApiType type,@PathVariable("issue") String issue) { + public ResponseEntity>> getContentsIssue(@RequestHeader(value = "user-id") String socialId,@PathVariable("issue") String issue,@PathVariable("type") ApiType type) { String userId = "testId"; System.out.println(type); - return ResponseEntity.ok(SuccessResponse.create(GET_MY_CONTENTS.getMessage(), this.contentsService.getContentsIssue( socialId, type, issue))); + return ResponseEntity.ok(SuccessResponse.create(GET_CONTENTS_SUCCESS.getMessage(), this.contentsService.getContentsIssue( socialId, type, issue))); }//@RequestHeader(value = "user-id") String socialId }