-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from pagh2322/dev
Dev
- Loading branch information
Showing
175 changed files
with
4,122 additions
and
2,389 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
12 changes: 0 additions & 12 deletions
12
src/main/java/org/mockInvestment/advice/exception/InvalidStockCodeException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/org/mockInvestment/advice/exception/PendingStockOrderNotFoundException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/org/mockInvestment/advice/exception/SseEmitterEventSendException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/org/mockInvestment/advice/exception/SseEmitterNotFoundException.java
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/main/java/org/mockInvestment/advice/exception/StockNotFoundException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/org/mockInvestment/advice/exception/StockOrderNotFoundException.java
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...tment/auth/controller/AuthController.java → .../org/mockInvestment/auth/api/AuthApi.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
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
14 changes: 6 additions & 8 deletions
14
...balance/controller/BalanceController.java → ...ockInvestment/balance/api/BalanceApi.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
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
4 changes: 2 additions & 2 deletions
4
...ce/exception/PaymentFailureException.java → ...ce/exception/PaymentFailureException.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
87 changes: 87 additions & 0 deletions
87
src/main/java/org/mockInvestment/comment/api/CommentApi.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,87 @@ | ||
package org.mockInvestment.comment.api; | ||
|
||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.mockInvestment.auth.dto.AuthInfo; | ||
import org.mockInvestment.comment.application.*; | ||
import org.mockInvestment.comment.dto.request.CommentUpdateRequest; | ||
import org.mockInvestment.comment.dto.request.NewCommentReportRequest; | ||
import org.mockInvestment.comment.dto.request.NewCommentRequest; | ||
import org.mockInvestment.comment.dto.response.CommentLikeToggleResponse; | ||
import org.mockInvestment.comment.dto.response.CommentsResponse; | ||
import org.mockInvestment.global.auth.Login; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class CommentApi { | ||
|
||
private final CommentFindService commentFindService; | ||
|
||
private final CommentCreateService commentCreateService; | ||
|
||
private final CommentReportCreateService commentReportCreateService; | ||
|
||
private final CommentUpdateService commentUpdateService; | ||
|
||
private final CommentDeleteService commentDeleteService; | ||
|
||
private final CommentLikeToggleService commentLikeToggleService; | ||
|
||
|
||
@GetMapping("/stocks/{code}/comments") | ||
public ResponseEntity<CommentsResponse> findComments(@PathVariable("code") String stockCode, | ||
@Login AuthInfo authInfo) { | ||
CommentsResponse response = commentFindService.findCommentsByCode(authInfo, stockCode); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@PostMapping("/stocks/{code}/comments") | ||
public ResponseEntity<Void> addComment(@Login AuthInfo authInfo, | ||
@PathVariable("code") String stockCode, | ||
@RequestBody NewCommentRequest request) { | ||
commentCreateService.addComment(authInfo, stockCode, request); | ||
return ResponseEntity.status(HttpStatus.CREATED).build(); | ||
} | ||
|
||
@PostMapping("/comments/{id}/report") | ||
public ResponseEntity<Void> reportComment(@PathVariable("id") Long commentId, | ||
@Valid @RequestBody NewCommentReportRequest request, | ||
@Login AuthInfo authInfo) { | ||
commentReportCreateService.reportComment(commentId, request, authInfo); | ||
return ResponseEntity.status(HttpStatus.CREATED).build(); | ||
} | ||
|
||
@PostMapping("/comments/{id}/reply") | ||
public ResponseEntity<Void> addReply(@PathVariable("id") Long commentId, | ||
@RequestBody NewCommentRequest request, | ||
@Login AuthInfo authInfo) { | ||
commentCreateService.addReply(authInfo, commentId, request); | ||
return ResponseEntity.status(HttpStatus.CREATED).build(); | ||
} | ||
|
||
@PutMapping("/comments/{id}") | ||
public ResponseEntity<Void> updateComment(@PathVariable("id") Long commentId, | ||
@Valid @RequestBody CommentUpdateRequest request, | ||
@Login AuthInfo authInfo) { | ||
commentUpdateService.updateComment(commentId, request, authInfo); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
@DeleteMapping("/comments/{id}") | ||
public ResponseEntity<Void> deleteComment(@PathVariable("id") Long commentId, | ||
@Login AuthInfo authInfo) { | ||
commentDeleteService.deleteComment(authInfo, commentId); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
@PutMapping("/comments/{id}/like") | ||
public ResponseEntity<CommentLikeToggleResponse> toggleCommentLike(@PathVariable("id") Long commentId, | ||
@Login AuthInfo authInfo) { | ||
CommentLikeToggleResponse response = commentLikeToggleService.toggleCommentLike(authInfo, commentId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
} |
Oops, something went wrong.