-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#6] 경매품 조회 페이지네이션 구현
- Loading branch information
Showing
41 changed files
with
1,293 additions
and
314 deletions.
There are no files selected for viewing
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
59 changes: 59 additions & 0 deletions
59
...abrain/gyeongnamgyeongmae/domain/auctionItem/controller/AuctionItemCommentController.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,59 @@ | ||
package megabrain.gyeongnamgyeongmae.domain.auctionItem.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.domain.repostiory.AuctionItemCommentRepository; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentDeleteRequest; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.Comment.AuctionItemCommentParentDto; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentRequest; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentUpdateRequest; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Comment.AuctionItemCommentServiceImpl; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@Tag(name = "경매품에 답글 작성", description = "경매품 댓글 관련 API") | ||
@RequestMapping({"api/auctions/comments"}) | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class AuctionItemCommentController { | ||
|
||
private final AuctionItemCommentRepository auctionItemCommentRepository; | ||
private final AuctionItemCommentServiceImpl auctionItemCommentServiceImpl; | ||
|
||
@Operation(summary = "댓글 쓰기 ", description = "경매품 댓글 쓰기") | ||
@ResponseStatus(HttpStatus.CREATED) | ||
@PostMapping({"{id}"}) | ||
public ResponseEntity<HttpStatus> createAuctionItemComment(@PathVariable Long id, @RequestBody AuctionItemCommentRequest auctionItemCommentRequest) { | ||
Long memberId = auctionItemCommentRequest.getUserId(); | ||
this.auctionItemCommentServiceImpl.createAuctionItemComment(auctionItemCommentRequest, id, memberId); | ||
return ResponseEntity.status(HttpStatus.CREATED).build(); | ||
} | ||
|
||
@Operation(summary = "경매품에 대한 댓글 보기", description = "경매품에 대한 경매품 댓글 보기") | ||
@GetMapping({"{id}"}) | ||
public ResponseEntity<List<AuctionItemCommentParentDto>> findAuctionItemCommentById(@PathVariable Long id) { | ||
List<AuctionItemCommentParentDto> commentViews = this.auctionItemCommentServiceImpl.findAuctionItemCommentById(id); | ||
return ResponseEntity.ok(commentViews); | ||
} | ||
|
||
|
||
@Operation(summary = "경매품 댓글 수정 ", description = "경매품 댓글 수정") | ||
@PutMapping({""}) | ||
public ResponseEntity<HttpStatus> updateAuctionItemComment(@RequestBody AuctionItemCommentUpdateRequest auctionItemCommentUpdateRequest) { | ||
this.auctionItemCommentServiceImpl.updateAuctionItemComment(auctionItemCommentUpdateRequest); | ||
return ResponseEntity.status(HttpStatus.OK).build(); | ||
} | ||
|
||
@Operation(summary = "경매품 댓글 삭제",description = "경매품 댓글 삭제") | ||
@DeleteMapping({""}) | ||
public ResponseEntity<HttpStatus> deleteAuctionItemComment(AuctionItemCommentDeleteRequest auctionItemCommentDeleteRequest) { | ||
this.auctionItemCommentServiceImpl.deleteAuctionItemComment(auctionItemCommentDeleteRequest); | ||
return ResponseEntity.status(HttpStatus.OK).build(); | ||
} | ||
} | ||
|
||
|
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
35 changes: 35 additions & 0 deletions
35
...gabrain/gyeongnamgyeongmae/domain/auctionItem/controller/AuctionItemSearchController.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,35 @@ | ||
package megabrain.gyeongnamgyeongmae.domain.auctionItem.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.domain.repostiory.AuctionItemRepository; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemFirstView; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.SearchItem.SearchAuctionItemSortedRequest; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Item.AuctionItemServiceImpl; | ||
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Search.AuctionItemSearchServiceImpl; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "경매품 검색", description = "경매품 검색 관련 API") | ||
@RequestMapping({"api/auctions/search"}) | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class AuctionItemSearchController { | ||
|
||
private final AuctionItemServiceImpl auctionItemServiceImpl; | ||
private final AuctionItemRepository AuctionItemRepository; | ||
private final AuctionItemSearchServiceImpl auctionItemSearchServiceImpl; | ||
|
||
@Operation(summary = "Search AuctionItem", description = "경매품 검색하기") | ||
@GetMapping("") | ||
public ResponseEntity<Page<AuctionItemFirstView>> findItemCategory(@ModelAttribute SearchAuctionItemSortedRequest searchAuctionItemSortedRequest, Pageable pageable) { | ||
Page<AuctionItemFirstView> result = this.auctionItemSearchServiceImpl.findAuctionItembyRequest(searchAuctionItemSortedRequest, pageable); | ||
return ResponseEntity.ok(result); | ||
} | ||
} |
Oops, something went wrong.