Skip to content
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
@@ -1,6 +1,8 @@
package com.example.neo_backend.domain.like.controller;
import com.example.neo_backend.domain.like.dto.LikeResponseDto;
import com.example.neo_backend.domain.like.service.LikesService;
import com.example.neo_backend.global.common.annotation.ApiErrorCodeExample;
import com.example.neo_backend.global.common.status.ErrorStatus;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
Expand All @@ -21,6 +23,7 @@ public class LikesController {

@PostMapping("")
@Operation(summary = "좋아요 등록", description = "제보글에 좋아요를 등록합니다.")
@ApiErrorCodeExample(ErrorStatus.class)
public ResponseEntity<Long> createLike(@RequestParam Long postId, HttpServletRequest request) {
log.info("좋아요 등록 요청 postId: {}", postId);
Long like = likesService.createLike(postId, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.example.neo_backend.domain.post.dto.PostResponseDto;
import com.example.neo_backend.domain.user.service.UserService;
import com.example.neo_backend.global.common.annotation.ApiErrorCodeExample;
import com.example.neo_backend.global.common.status.ErrorStatus;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
Expand All @@ -21,13 +23,15 @@ public class UserApiController {

@GetMapping("/likes")
@Operation(summary = "좋아요 누른 제보글 조회", description = "내가 좋아요 누른 제보글 목록을 조회합니다.")
@ApiErrorCodeExample(ErrorStatus.class)
public ResponseEntity<List<PostResponseDto>> getLikedPost(HttpServletRequest request){
List<PostResponseDto> likedPost = userService.getLikedPost(request);
return ResponseEntity.ok(likedPost);
}

@GetMapping("/posts")
@Operation(summary = "내가 작성한 제보글 조회", description = "내가 작성한 제보글 목록을 조회합니다.")
@ApiErrorCodeExample(ErrorStatus.class)
public ResponseEntity<List<PostResponseDto>> getMyPosts(HttpServletRequest request) {
List<PostResponseDto> myPosts = userService.getMyPosts(request);
return ResponseEntity.ok(myPosts);
Expand Down