Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] Milestone API #77

Merged
merged 4 commits into from
Aug 3, 2023
Merged

[BE] Milestone API #77

merged 4 commits into from
Aug 3, 2023

Conversation

tjdqls1200
Copy link
Collaborator

@tjdqls1200 tjdqls1200 commented Aug 3, 2023

Issues

What is this PR? ๐Ÿ‘“

  • Milestone ๋ชฉ๋ก ์กฐํšŒ API
  • ํŠน์ • ์ด์Šˆ์— Milestone ์ˆ˜์ • API

Key changes ๐Ÿ”‘

  • Milestone, Label Response DTO ํ†ตํ•ฉ
  • Issue ๋ชฉ๋ก ์กฐํšŒ์—์„œ column๋ช… loginId -> username์œผ๋กœ ์ˆ˜์ •
  • Milestone ๋ชฉ๋ก ์กฐํšŒ์‹œ ์„ค๋ช…, ๋งŒ๋ฃŒ์ผ๋„ ๋ฐ˜ํ™˜ (๋ชฉ๋ก ์กฐํšŒ๋ฅผ ๋งˆ์ผ์Šคํ†ค ํƒญ์—์„œ๋„ ํ•  ์ˆ˜ ์žˆ์Œ)
  • ์ด์Šˆ์— ๋“ฑ๋ก๋œ Milestone ์‚ญ์ œ์‹œ null๋กœ ์ˆ˜์ •
  • Sql Parameter๋ฅผ Map.of()๋กœ ํ•  ๊ฒฝ์šฐ value๊ฐ€ null์ด๋ฉด NullPointerException ๋ฐœ์ƒ -> MapSqlParameterSource ์‚ฌ์šฉ

To reviewers ๐Ÿ‘‹

  • ์ˆ˜์ •ํ•  ๋ถ€๋ถ„ ์žˆ์œผ๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”!

@tjdqls1200 tjdqls1200 added enhancement New feature or request back-end labels Aug 3, 2023
@tjdqls1200 tjdqls1200 added this to the [BE] Sprint #02 milestone Aug 3, 2023
@tjdqls1200 tjdqls1200 self-assigned this Aug 3, 2023
Copy link

@23Yong 23Yong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค!๐Ÿ‘

@@ -88,4 +88,12 @@ public void updateIssueLabels(Integer issueId, IssueLabelRequest request) {
issueLabelRepository.deleteAll(toEntityList(request.getRemoveLabelsId(),
id -> new IssueLabel(issueId, id)));
}

public void updateIssueMilestone(Integer issueId, Integer milestoneId) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Transactional ์• ๋…ธํ…Œ์ด์…˜์ด ๋น ์ ธ์žˆ๋„ค์š”!

List<IssueDetailResponse.LabelInfo> labels = findLabelInfoById(issueId);
IssueDetailResponse.MilestoneInfo milestone = milestoneRepository.findMilestoneInfoByIssueId(issueId);
List<LabelResponse> labels = findLabelInfoById(issueId);
MilestoneResponse milestone = milestoneRepository.findMilestoneByIssueId(issueId);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ†ตํ•ฉ ๐Ÿ‘


@PostMapping("/{issueId}/milestone")
public void updateIssueMilestone(@PathVariable Integer issueId,
@RequestBody IssueMilestoneRequest milestoneRequest) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด์ „์—๋Š” ๋ชป๋ดค์—ˆ๋Š”๋ฐ ๋ฐ˜ํ™˜ํƒ€์ž…์ด void์ธ๋ฐ ResponseEntity<Void>๋กœ ํ†ตํ•ฉํ•˜๋Š” ๊ฑด ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”!

@Getter
@NoArgsConstructor
public class IssueMilestoneRequest {
private Integer milestoneId;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ•œ ์ค„ ๋„์›Œ์ฃผ์„ธ์šฉใ…Žใ…Ž

public class IssueMilestoneRequest {

   private Integer milestoneId;


@DisplayName("ํŠน์ • ์ด์Šˆ์˜ ๋งˆ์ผ์Šคํ†ค์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.")
@Test
public void updateIssueMilestone() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JUnit5 ๋ถ€ํ„ฐ๋Š” ์ ‘๊ทผ์ œ์–ด์ž๋ฅผ public์œผ๋กœ ์•ˆํ•ด๋„ ํ…Œ์ŠคํŠธ๊ฐ€ ์ˆ˜ํ–‰๋ฉ๋‹ˆ๋‹น!

void updateIssueMilestone() {
...
}

https://stackoverflow.com/questions/55215949/why-junit-5-default-access-modifier-changed-to-package-private

https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-classes-and-methods


MapSqlParameterSource params = new MapSqlParameterSource()
.addValue("milestoneId", milestoneId)
.addValue("issueId", issueId);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—ฌ๊ธฐ์„œ Map.of()๋ฅผ ์‚ฌ์šฉํ•  ๋•ŒmilestoneIdํ˜น์€ issueId๊ฐ€ null์ด๋ฉด NPE๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋Š” ๊ฑด๊ฐ€์š”?

@@ -59,4 +60,10 @@ public void updateAssignees(@PathVariable Integer issueId, @RequestBody Assignee
public void updateIssueLabels(@PathVariable Integer issueId, @RequestBody IssueLabelRequest issueLabelRequest) {
issueService.updateIssueLabels(issueId, issueLabelRequest);
}

@PostMapping("/{issueId}/milestone")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notion API ๋ฌธ์„œ์—๋Š” PUT์œผ๋กœ ๋˜์–ด ์žˆ๋˜๋ฐ POST๋กœ ๋ฐ”๋€๊ฑด๊ฐ€์š”?

Copy link

@pie2457 pie2457 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ‘๐Ÿผ ์ž˜ ๋ดค์Šต๋‹ˆ๋‹ค !

@pie2457 pie2457 merged commit c980251 into be-w2 Aug 3, 2023
@pie2457 pie2457 deleted the be/feature/#74-milestone branch August 3, 2023 06:06
youzysu pushed a commit that referenced this pull request Aug 25, 2023
[TEAM#08] 4์ฃผ์ฐจ PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants