-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Team#04][BE] 3주차 PR입니다 #45
Merged
kses1010
merged 67 commits into
codesquad-members-2023:team-04
from
codesquad-team4-issue-tracker:be
Aug 13, 2023
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
83db405
feat #37 : issue TextColor, BackgroundColor 추가
JJONSOO 69575b7
fix #37 : 에러 메세지를 ErrorResponse가 가지도록 수정
JJONSOO 627b4e4
fix #37 : FilterMapper에서 Label ID만 가져오고 title, textColor, backgroundC…
JJONSOO fc42634
fix #37 : LabelRepository 에서 Label ID만 가져오고 title, textColor, backgro…
JJONSOO feae50c
fix #37 : null이 아닌 빈 List가 반환되도록 한다.
JJONSOO 4988ab0
fix #37 : 코드 리뷰 반영
JJONSOO f9ceea5
Merge pull request #42 from codesquad-team4-issue-tracker/feat/#37-re…
JJONSOO 93b182b
fix #43 : Label Test 코드 작성
JJONSOO 2186a57
fix #43 : Label CRUD 코드 작성
JJONSOO 4236397
fix #43 : milestone 개수 가져오기
JJONSOO 2dbbd12
fix #43 : 비밀번호 길이 두 번 검증은 취소한다.
JJONSOO d654d33
Merge pull request #44 from codesquad-team4-issue-tracker/feat/#43-label
JJONSOO 7066c9e
chore #46: Dockerfile-dev생성
yhpark95 de57a53
chore #46: cors설정
yhpark95 20ba97b
Merge pull request #48 from codesquad-team4-issue-tracker/chore/#46-cors
yhpark95 4b37305
feat #45 : nginx 경로 설정을 위해 모든 Path앞에 /api 추가
JJONSOO efc9d66
feat #45 : milestone 테스트 작성
JJONSOO 74de407
feat #45 : milestone API
JJONSOO 20d7820
Merge pull request #51 from codesquad-team4-issue-tracker/feat/#45-mi…
JJONSOO 5caf076
test #31: repository 메서드 일부 테스트코드 추가
Ojeegu 1624345
fix #54 : url method path 수정
JJONSOO 5be72c9
feat #54 : 로그아웃 API
JJONSOO 096f3b9
feat #54 : 로그아웃 API
JJONSOO 624ff3b
fix #54 : @Transactional 추가
JJONSOO 7c8f326
refactor #31: 메서드 분리
Ojeegu 76bb90a
Merge pull request #56 from codesquad-team4-issue-tracker/faet/#54-lo…
JJONSOO 493bcbb
Merge branch 'be' of https://github.com/codesquad-team4-issue-tracker…
Ojeegu caa2dd3
refactor #31: service class method 호출하도록 변경
Ojeegu df301d8
refactor #31: 오타 수정
Ojeegu 56751a0
refactor #31: 오타 수정
Ojeegu 3c42fe9
Merge pull request #57 from codesquad-team4-issue-tracker/test/#31-is…
JJONSOO 73525c5
refactor #31: 테스트코드 수정
Ojeegu 2c4becc
feat #55: 히스토리 생성 기능 구현(AOP) + 테스트 구현
yhpark95 c343a44
feat #55: 테스트 추가 & 수정
yhpark95 bfbf521
feat #55: aop의존성 추가
yhpark95 aea02fc
fix #55 : FilterMapperTest 수정
JJONSOO 689aa2c
Merge branch 'be' of https://github.com/codesquad-team4-issue-tracker…
Ojeegu 6cd0b45
test #31: issueService 테스트 코드 작성
Ojeegu 8b0afa0
Merge pull request #58 from codesquad-team4-issue-tracker/feat/#55-hi…
JJONSOO f1cc30c
Merge branch 'be' of https://github.com/codesquad-team4-issue-tracker…
Ojeegu 337c4b8
test #31: issueController 테스트 코드 작성
Ojeegu 383fe62
refactor #31: ControllerTestSupport 수정
Ojeegu 4df1977
Merge pull request #59 from codesquad-team4-issue-tracker/test/#31-is…
Ojeegu 5287c72
feat #61 : 각 도메인별 Validator 추가
JJONSOO ad02c39
feat #61 : issue validator 추가
JJONSOO 571ba30
feat #61 : milestone validator 추가
JJONSOO 1872ede
feat #61 : member validator 추가
JJONSOO bc7cc96
feat #61 : label validator 추가
JJONSOO 64d43c7
feat #61 : Jwt validator 추가
JJONSOO fb0048b
feat #61 : History validator 추가
JJONSOO 59cb563
feat #61 : Assignee validator 추가
JJONSOO 1f6bd77
feat #61 : Filter validator 추가
JJONSOO 81f0f28
feat #61 : Comment validator 추가
JJONSOO b207575
Merge pull request #62 from codesquad-team4-issue-tracker/feat/#61-va…
JJONSOO 54be6bc
feat : cors preflight가 jwt필터를 타지 않도록 수정
yhpark95 52fe03f
feat #69 : mileStoneCount -> milestoneCount로 네이밍 수정
JJONSOO 181ea54
feat #69 : milestone open/closed 을 opposite로 통일
JJONSOO ebd4d37
Merge pull request #71 from codesquad-team4-issue-tracker/feat/#69-ma…
JJONSOO af41b45
feat #69 : issue, milestone name을 title로 수정
JJONSOO 311feff
Merge pull request #73 from codesquad-team4-issue-tracker/feat/#69-ma…
JJONSOO 0e0e2d6
feat #78 : issue 저장시 name을 title로 수정
JJONSOO 13edeb9
feat #78 : 마일스톤 저장시 name을 title로 수정
JJONSOO 699f125
feat #78 : 같은 이름의 Issue 존재시 예외를 발생시킨다.
JJONSOO 56d2d5f
feat #78 : 같은 이름의 Milestone 존재시 예외를 발생시킨다.
JJONSOO 7b7e565
feat #78 : 같은 이름의 Issue 존재시 예외를 발생시키는 테스트.
JJONSOO c802731
feat #78 : 같은 이름의 Milestone 존재시 예외를 발생시키는 테스.
JJONSOO ca2a15a
Merge pull request #79 from codesquad-team4-issue-tracker/feat/#78-la…
JJONSOO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM openjdk:11 | ||
WORKDIR /app | ||
COPY . . | ||
ARG JAR_FILE=./build/libs/*.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-Dspring.profiles.active=dev","-Dserver.port=8080","-jar","app.jar"] |
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
27 changes: 0 additions & 27 deletions
27
be/src/main/java/com/issuetrackermax/common/exception/AssigneeCustomException.java
This file was deleted.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
be/src/main/java/com/issuetrackermax/common/exception/domain/MemberException.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,25 @@ | ||
package com.issuetrackermax.common.exception.domain; | ||
|
||
import org.springframework.http.HttpStatus; | ||
|
||
public enum MemberException implements CustomException { | ||
NOT_FOUND_MEMBER(HttpStatus.NOT_FOUND, "존재하지 않는 회원입니다."); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
MemberException(HttpStatus httpStatus, String message) { | ||
this.httpStatus = httpStatus; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public HttpStatus getHttpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
be/src/main/java/com/issuetrackermax/config/CorsConfig.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,16 @@ | ||
package com.issuetrackermax.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class CorsConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowedOrigins("*") | ||
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH"); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
be/src/main/java/com/issuetrackermax/config/HistoryAspect.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,56 @@ | ||
package com.issuetrackermax.config; | ||
|
||
import static com.issuetrackermax.domain.issue.IssueStatus.*; | ||
|
||
import java.util.List; | ||
|
||
import org.aspectj.lang.ProceedingJoinPoint; | ||
import org.aspectj.lang.annotation.Around; | ||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.issuetrackermax.controller.history.dto.HistoryRequest; | ||
import com.issuetrackermax.controller.issue.dto.request.IssuePostRequest; | ||
import com.issuetrackermax.controller.issue.dto.request.IssuesStatusRequest; | ||
import com.issuetrackermax.controller.issue.dto.response.IssuePostResponse; | ||
import com.issuetrackermax.domain.member.MemberRepository; | ||
import com.issuetrackermax.service.history.HistoryService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Aspect | ||
@Component | ||
@RequiredArgsConstructor | ||
public class HistoryAspect { | ||
private final HistoryService historyService; | ||
private final MemberRepository memberRepository; | ||
|
||
@Around("execution(* com.issuetrackermax.service.issue.IssueService.post(..)) && args(request,writerId)") | ||
public Object save(ProceedingJoinPoint joinPoint, IssuePostRequest request, Long writerId) throws Throwable { | ||
IssuePostResponse issuePostResponse = (IssuePostResponse)joinPoint.proceed(); | ||
Long issueId = issuePostResponse.getId(); | ||
|
||
historyService.save(HistoryRequest.builder() | ||
.issueId(issueId) | ||
.editor(memberRepository.findById(writerId).get().getNickName()) | ||
.issueIsOpen(true) | ||
.build()); | ||
return issuePostResponse; | ||
} | ||
|
||
@Around("execution(* com.issuetrackermax.service.issue.IssueService.updateStatus(..)) && args(request, memberId)") | ||
public void changeStatus(ProceedingJoinPoint joinPoint, IssuesStatusRequest request, Long memberId) throws | ||
Throwable { | ||
joinPoint.proceed(); | ||
List<Long> ids = request.getIssueIds(); | ||
String status = request.getIssueStatus(); | ||
String editor = memberRepository.findById(memberId).get().getNickName(); | ||
ids.forEach(id -> historyService.save( | ||
HistoryRequest.builder() | ||
.issueId(id) | ||
.editor(editor) | ||
.issueIsOpen(status.equals(OPEN_ISSUE.getStatus())) | ||
.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
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: 14 additions & 0 deletions
14
be/src/main/java/com/issuetrackermax/controller/auth/dto/request/LogoutRequest.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,14 @@ | ||
package com.issuetrackermax.controller.auth.dto.request; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class LogoutRequest { | ||
@NotBlank | ||
private String refreshToken; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.issuetrackermax.controller.filter.dto.response; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
@@ -21,7 +22,7 @@ public AssigneeResponse(Long id, String name) { | |
|
||
public static List<AssigneeResponse> convertToAssigneeResponseList(String assigneeIds, String assigneeNames) { | ||
if (assigneeIds == null) { | ||
return null; | ||
return new ArrayList<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. null에서 빈리스트를 돌려주기로 했군요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 null로 반환하는게 어색하다고 생각하여 빈 리스트를 반환하도록 코드를 수정하였습니다. |
||
} | ||
List<String> ids = List.of(assigneeIds.split(",")); | ||
List<String> names = List.of(assigneeNames.split(",")); | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aspect를 직접 사용하셧군요 changeStatus에는 왜 사용하셨나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이슈 상태를 바꾸는 것도 History에 저장하기 위해 사용하였습니다.
ex) A에 의해 5분전에 변경되었습니다.