forked from codesquad-2023-group04/issue-tracker
-
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.
FEAT: issue와 관련된 swagger 작성 (codesquad-2023-group04#27)
- Loading branch information
1 parent
fb411fe
commit c0d7561
Showing
6 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
BE/src/main/java/issuetracker/issuetracker/domain/issue/IssueController.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,65 @@ | ||
package issuetracker.issuetracker.domain.issue; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import issuetracker.issuetracker.domain.issue.comment.dto.CommentInIssueDTO; | ||
import issuetracker.issuetracker.domain.issue.comment.dto.CommentPostDTO; | ||
import issuetracker.issuetracker.domain.issue.dto.PostingIssueDTO; | ||
import issuetracker.issuetracker.domain.issue.dto.IssueDTO; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Tag(name = "posts", description = "issue 메인 API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/issues") | ||
public class IssueController { | ||
|
||
|
||
@PostMapping("/{issueId}") | ||
public void postIssue(@RequestBody PostingIssueDTO issue) { | ||
// 저장하는 로직 추가 | ||
} | ||
|
||
@GetMapping("/{issueId}") | ||
public IssueDTO explainIssue(@RequestParam Long issueId) { | ||
// findByIssue | ||
|
||
return new IssueDTO(); | ||
} | ||
|
||
@PutMapping("/{issueId}") | ||
public void updateIssue(@RequestBody PostingIssueDTO issue) { | ||
// 수정하는 메서드 생성 | ||
} | ||
|
||
@DeleteMapping("/{issueId}") | ||
public void deleteIssue(@RequestParam Long issueId) { | ||
// 삭제 로직 | ||
} | ||
|
||
@GetMapping("/{issueId}/comments") | ||
public List<CommentInIssueDTO> showComment(@RequestParam Long issueId) { | ||
// TODO 댓글 리스트 구현 | ||
return new ArrayList<>(); | ||
} | ||
|
||
@PostMapping("/{issueId}/comments") | ||
public void postComment(@RequestBody CommentPostDTO comment) { | ||
// TODO 댓글 작성하기 구현 | ||
|
||
} | ||
|
||
@PutMapping("/{issueId}/comments/{commentId}") | ||
public void updateComment(@RequestParam Long issueId, @RequestParam Long commentId, @RequestBody CommentPostDTO comment) { | ||
// TODO 댓글 수정하기 구현 | ||
} | ||
|
||
@DeleteMapping("/{issueId}/comments/{commentId}") | ||
public void deleteComment(@RequestParam Long issueId, @RequestParam Long commentId) { | ||
// TODO 댓글 삭제하기 구현 | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
BE/src/main/java/issuetracker/issuetracker/domain/issue/dto/IssueDetailInfoDTO.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,42 @@ | ||
package issuetracker.issuetracker.domain.issue.dto; | ||
|
||
import issuetracker.issuetracker.domain.issue.comment.dto.CommentInIssueDTO; | ||
import issuetracker.issuetracker.domain.label.dto.LabelDTO; | ||
import issuetracker.issuetracker.domain.user.dto.AssigneeDTO; | ||
import issuetracker.issuetracker.domain.user.dto.AuthorDTO; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import nonapi.io.github.classgraph.json.Id; | ||
import org.springframework.data.relational.core.mapping.MappedCollection; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
import java.util.Set; | ||
|
||
@Getter | ||
@Setter | ||
public class IssueDetailInfoDTO { | ||
|
||
@Id | ||
@NotNull | ||
private Long issueId; | ||
@NotNull | ||
private String title; | ||
@NotNull | ||
private LocalDateTime createTime; | ||
@NotNull | ||
private LocalDateTime updateTime; | ||
@NotNull | ||
private Boolean isOPen; | ||
private String milestone; | ||
@NotNull | ||
private AuthorDTO author; | ||
|
||
@MappedCollection(idColumn = "issue_id") | ||
private Set<AssigneeDTO> assignees; | ||
|
||
@MappedCollection(idColumn = "issue_id") | ||
private Set<LabelDTO> label; | ||
|
||
private Set<CommentInIssueDTO> reply; | ||
} |
24 changes: 24 additions & 0 deletions
24
BE/src/main/java/issuetracker/issuetracker/domain/issue/dto/PostingIssueDTO.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,24 @@ | ||
package issuetracker.issuetracker.domain.issue.dto; | ||
|
||
import issuetracker.issuetracker.domain.label.dto.LabelDTO; | ||
import issuetracker.issuetracker.domain.milestone.Milestone; | ||
import issuetracker.issuetracker.domain.milestone.dto.MileStoneDTO; | ||
import issuetracker.issuetracker.domain.user.dto.AssigneeDTO; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public class PostingIssueDTO { | ||
@NotNull | ||
private String title; | ||
private String contents; | ||
private String fileUrl; | ||
private AssigneeDTO assignee; | ||
private LabelDTO label; | ||
private MileStoneDTO milestone; | ||
} |
2 changes: 1 addition & 1 deletion
2
...c/main/java/issuetracker/issuetracker/domain/issue/repositroy/IssueRepositoryJDBCtem.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
2 changes: 1 addition & 1 deletion
2
BE/src/main/java/issuetracker/issuetracker/domain/page/dto/MainPage.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