Skip to content

Commit

Permalink
Merge pull request #47 from kusitms-28th-Meetup-E/feat/like
Browse files Browse the repository at this point in the history
fix: 좋아요 API
  • Loading branch information
eojinny committed Nov 29, 2023
2 parents 710ef46 + c6b964d commit 4e69826
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}


Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public ResponseEntity<SuccessResponse<List<ContentsRes>>> getContentsByLoginId(@
}

@GetMapping("/subscribe/{issue}")
public ResponseEntity<SuccessResponse<List<ContentsDataRes>>> getMySubscribe(@RequestHeader(value = "user-id") String socialId,@PathVariable("issue")String issue) {
public ResponseEntity<SuccessResponse<List<ContentsDataRes>>> 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}")
Expand Down Expand Up @@ -108,22 +108,22 @@ public ResponseEntity<SuccessResponse<List<BubbleFrontRes>>> getBubbleChart(@Pat

}
@GetMapping("/contents/all/like/{type}")
public ResponseEntity<SuccessResponse<List<ContentsWithLikeCountRes>>> getContentsWithLikeCount(@RequestHeader(value = "user-id") String socialId,@PathVariable ApiType type) {
public ResponseEntity<SuccessResponse<List<ContentsWithLikeCountRes>>> 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<SuccessResponse<List<ContentsWithLikeCountRes>>> getContentsKeyword(@RequestHeader(value = "user-id") String socialId,@PathVariable ApiType type,@PathVariable("keyword") String keyword) {
public ResponseEntity<SuccessResponse<List<ContentsWithLikeCountRes>>> 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<SuccessResponse<List<ContentsWithLikeCountRes>>> getContentsIssue(@RequestHeader(value = "user-id") String socialId,@PathVariable("type") ApiType type,@PathVariable("issue") String issue) {
public ResponseEntity<SuccessResponse<List<ContentsWithLikeCountRes>>> 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
}

0 comments on commit 4e69826

Please sign in to comment.