-
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.
- Loading branch information
Showing
25 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/controller/HistoryController.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,4 @@ | ||
package TiCatch.backend.domain.history.controller; | ||
|
||
public class HistoryController { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/dto/request/RequestDto.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,4 @@ | ||
package TiCatch.backend.domain.history.dto.request; | ||
|
||
public class RequestDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/dto/response/ResponseDto.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,4 @@ | ||
package TiCatch.backend.domain.history.dto.response; | ||
|
||
public class ResponseDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/repository/HistoryRepository.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,4 @@ | ||
package TiCatch.backend.domain.history.repository; | ||
|
||
public interface HistoryRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/service/HistoryService.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,4 @@ | ||
package TiCatch.backend.domain.history.service; | ||
|
||
public interface HistoryService { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/history/service/HistoryServiceImpl.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,4 @@ | ||
package TiCatch.backend.domain.history.service; | ||
|
||
public class HistoryServiceImpl { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/controller/MemberController.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,4 @@ | ||
package TiCatch.backend.domain.member.controller; | ||
|
||
public class MemberController { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/dto/request/RequestDto.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,4 @@ | ||
package TiCatch.backend.domain.member.dto.request; | ||
|
||
public class RequestDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/dto/response/ResponseDto.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,4 @@ | ||
package TiCatch.backend.domain.member.dto.response; | ||
|
||
public class ResponseDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/repository/MemberRepository.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,4 @@ | ||
package TiCatch.backend.domain.member.repository; | ||
|
||
public interface MemberRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/service/MemberService.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,4 @@ | ||
package TiCatch.backend.domain.member.service; | ||
|
||
public interface MemberService { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/member/service/MemberServiceImpl.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,4 @@ | ||
package TiCatch.backend.domain.member.service; | ||
|
||
public class MemberServiceImpl { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/controller/TicketingController.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.controller; | ||
|
||
public class TicketingController { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/dto/request/RequestDto.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.dto.request; | ||
|
||
public class RequestDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/dto/response/ResponseDto.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.dto.response; | ||
|
||
public class ResponseDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/repository/TicketingRepository.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.repository; | ||
|
||
public interface TicketingRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/service/TicketingService.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.service; | ||
|
||
public interface TicketingService { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/TiCatch/backend/domain/ticketing/service/TicketingServiceImpl.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,4 @@ | ||
package TiCatch.backend.domain.ticketing.service; | ||
|
||
public class TicketingServiceImpl { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/TiCatch/backend/global/exception/ExceptionCode.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,13 @@ | ||
package TiCatch.backend.global.exception; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum ExceptionCode { | ||
|
||
SERVER_EXCEPTION(500, "서버에서 예측하지 못한 에러가 발생했습니다."); | ||
private final int errorCode; | ||
private final String errorMessage; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/TiCatch/backend/global/exception/ExceptionController.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,19 @@ | ||
package TiCatch.backend.global.exception; | ||
|
||
import TiCatch.backend.global.response.ResponseResult; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@RestControllerAdvice(basePackages = "TiCatch.backend") | ||
public class ExceptionController { | ||
@ExceptionHandler(ServerException.class) | ||
public ResponseResult ServerException(ServerException err) { | ||
log.info("Error : {}", err.getClass()); | ||
log.info("Error Message : {}", err.getMessage()); | ||
return ResponseResult.exceptionResponse(ExceptionCode.SERVER_EXCEPTION, err.getMessage()); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/TiCatch/backend/global/exception/ServerException.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,10 @@ | ||
package TiCatch.backend.global.exception; | ||
|
||
public class ServerException extends RuntimeException{ | ||
public ServerException() { | ||
super(ExceptionCode.SERVER_EXCEPTION.getErrorMessage()); | ||
} | ||
public ServerException(String message) { | ||
super(message); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/TiCatch/backend/global/response/ListResponseResult.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,19 @@ | ||
package TiCatch.backend.global.response; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ListResponseResult<T> extends ResponseResult { | ||
|
||
private List<T> data; | ||
|
||
public ListResponseResult(List<T> data) { | ||
super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, | ||
successResponse.timestamp); | ||
this.data = data; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/TiCatch/backend/global/response/PageResponseResult.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,19 @@ | ||
package TiCatch.backend.global.response; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.domain.Page; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class PageResponseResult<T> extends ResponseResult { | ||
|
||
private Page<T> data; | ||
|
||
public PageResponseResult(Page<T> data) { | ||
super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, | ||
successResponse.timestamp); | ||
this.data = data; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/TiCatch/backend/global/response/ResponseResult.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,44 @@ | ||
package TiCatch.backend.global.response; | ||
|
||
import TiCatch.backend.global.exception.ExceptionCode; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
import org.springframework.http.HttpStatus; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@SuperBuilder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ResponseResult { | ||
|
||
int statusCode; | ||
String messages; | ||
String developerMessage; | ||
LocalDateTime timestamp; | ||
|
||
public static final ResponseResult successResponse = | ||
ResponseResult.builder() | ||
.statusCode(HttpStatus.OK.value()) | ||
.messages("성공 :)") | ||
.developerMessage("성공하였습니다.") | ||
.timestamp(LocalDateTime.now()).build(); | ||
|
||
public static final ResponseResult failResponse = | ||
ResponseResult.builder() | ||
.statusCode(HttpStatus.BAD_REQUEST.value()) | ||
.messages("실패 :(") | ||
.developerMessage("실패하였습니다.") | ||
.timestamp(LocalDateTime.now()).build(); | ||
|
||
public static final ResponseResult exceptionResponse(ExceptionCode exceptionCode, String message) { | ||
return ResponseResult.builder() | ||
.statusCode(exceptionCode.getErrorCode()) | ||
.messages(message) | ||
.developerMessage(exceptionCode.getErrorMessage()) | ||
.timestamp(LocalDateTime.now()).build(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/TiCatch/backend/global/response/SingleResponseResult.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,17 @@ | ||
package TiCatch.backend.global.response; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class SingleResponseResult<T> extends ResponseResult { | ||
|
||
private T data; | ||
|
||
public SingleResponseResult(T data) { | ||
super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, | ||
successResponse.timestamp); | ||
this.data = data; | ||
} | ||
} |