Skip to content

Commit

Permalink
Fix: YML수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeg00 committed Oct 28, 2023
1 parent 1ec6817 commit 87b39ac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main/java/com/example/just/Config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public Docket api() {
.securitySchemes(Arrays.asList(apiKey())) // swagger에서 jwt 토큰값 넣기위한 설정
.apiInfo(apiInfo());
}

private ApiKey apiKey() {
return new ApiKey("Authorization", "Authorization", "header");
}
Expand All @@ -50,6 +51,7 @@ private List<SecurityReference> defaultAuth() {
authorizationScopes[0] = authorizationScope;
return Arrays.asList(new SecurityReference("Authorization", authorizationScopes));
}

private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("제목")
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/com/example/just/Controller/PostController.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ public ResponseGetPost getPosts(@RequestParam Long request_page,
String token = jwtProvider.getAccessToken(req);
Long member_id = Long.valueOf(jwtProvider.getIdFromToken(token)); //토큰


String cursor = req.getHeader("viewed");
return postService.searchByCursor(cursor, request_page, member_id);
}

/*
*/

/*
@Operation(summary = "자기의 게시글을 조회하는 API", description = "<big> 자신의 게시글을 조회한다</big>")
Expand All @@ -63,7 +65,7 @@ public ResponseEntity<Slice<Post>> getMyPosts(
public ResponsePost write(HttpServletRequest request,
@RequestBody PostDto postDto) {
String token = jwtProvider.getAccessToken(request);
System.out.println(token+"ㅋㅋ");
System.out.println(token + "ㅋㅋ");
Long member_id = Long.valueOf(jwtProvider.getIdFromToken(token)); //토큰

return postService.write(member_id, postDto);
Expand All @@ -87,16 +89,12 @@ public ResponsePost putPost(@RequestParam Long post_id, HttpServletRequest reque

@Operation(summary = "게시글 좋아요 api", description = "\n 자기가 좋아요 한 글이면 true")
@PostMapping("/post/like")
public ResponseEntity<Void> postLikes(@RequestParam Long post_id,HttpServletRequest request) {
public ResponseEntity<Void> postLikes(@RequestParam Long post_id, HttpServletRequest request) {
String token = jwtProvider.getAccessToken(request);
Long member_id = Long.valueOf(jwtProvider.getIdFromToken(token)); //토큰
postService.postLikes(post_id, member_id);
return ResponseEntity.ok().build();
}





}

0 comments on commit 87b39ac

Please sign in to comment.