-
Notifications
You must be signed in to change notification settings - Fork 22
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 #45 from codesquad-team4-issue-tracker/be
[Team#04][BE] 3주차 PR입니다
- Loading branch information
Showing
83 changed files
with
2,907 additions
and
344 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
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
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.