diff --git a/src/main/java/TiCatch/backend/domain/history/controller/HistoryController.java b/src/main/java/TiCatch/backend/domain/history/controller/HistoryController.java new file mode 100644 index 0000000..f9b3eba --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/controller/HistoryController.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.controller; + +public class HistoryController { +} diff --git a/src/main/java/TiCatch/backend/domain/history/dto/request/RequestDto.java b/src/main/java/TiCatch/backend/domain/history/dto/request/RequestDto.java new file mode 100644 index 0000000..e6f7c10 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/dto/request/RequestDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.dto.request; + +public class RequestDto { +} diff --git a/src/main/java/TiCatch/backend/domain/history/dto/response/ResponseDto.java b/src/main/java/TiCatch/backend/domain/history/dto/response/ResponseDto.java new file mode 100644 index 0000000..6039f95 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/dto/response/ResponseDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.dto.response; + +public class ResponseDto { +} diff --git a/src/main/java/TiCatch/backend/domain/history/repository/HistoryRepository.java b/src/main/java/TiCatch/backend/domain/history/repository/HistoryRepository.java new file mode 100644 index 0000000..0f865ae --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/repository/HistoryRepository.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.repository; + +public interface HistoryRepository { +} diff --git a/src/main/java/TiCatch/backend/domain/history/service/HistoryService.java b/src/main/java/TiCatch/backend/domain/history/service/HistoryService.java new file mode 100644 index 0000000..365e96a --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/service/HistoryService.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.service; + +public interface HistoryService { +} diff --git a/src/main/java/TiCatch/backend/domain/history/service/HistoryServiceImpl.java b/src/main/java/TiCatch/backend/domain/history/service/HistoryServiceImpl.java new file mode 100644 index 0000000..a1cd32a --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/history/service/HistoryServiceImpl.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.history.service; + +public class HistoryServiceImpl { +} diff --git a/src/main/java/TiCatch/backend/domain/member/controller/MemberController.java b/src/main/java/TiCatch/backend/domain/member/controller/MemberController.java new file mode 100644 index 0000000..623da61 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/controller/MemberController.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.controller; + +public class MemberController { +} diff --git a/src/main/java/TiCatch/backend/domain/member/dto/request/RequestDto.java b/src/main/java/TiCatch/backend/domain/member/dto/request/RequestDto.java new file mode 100644 index 0000000..34c7143 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/dto/request/RequestDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.dto.request; + +public class RequestDto { +} diff --git a/src/main/java/TiCatch/backend/domain/member/dto/response/ResponseDto.java b/src/main/java/TiCatch/backend/domain/member/dto/response/ResponseDto.java new file mode 100644 index 0000000..14b351b --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/dto/response/ResponseDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.dto.response; + +public class ResponseDto { +} diff --git a/src/main/java/TiCatch/backend/domain/member/repository/MemberRepository.java b/src/main/java/TiCatch/backend/domain/member/repository/MemberRepository.java new file mode 100644 index 0000000..e57efda --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/repository/MemberRepository.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.repository; + +public interface MemberRepository { +} diff --git a/src/main/java/TiCatch/backend/domain/member/service/MemberService.java b/src/main/java/TiCatch/backend/domain/member/service/MemberService.java new file mode 100644 index 0000000..9f53e4c --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/service/MemberService.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.service; + +public interface MemberService { +} diff --git a/src/main/java/TiCatch/backend/domain/member/service/MemberServiceImpl.java b/src/main/java/TiCatch/backend/domain/member/service/MemberServiceImpl.java new file mode 100644 index 0000000..4c132bc --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/member/service/MemberServiceImpl.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.member.service; + +public class MemberServiceImpl { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/controller/TicketingController.java b/src/main/java/TiCatch/backend/domain/ticketing/controller/TicketingController.java new file mode 100644 index 0000000..615a958 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/controller/TicketingController.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.controller; + +public class TicketingController { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/dto/request/RequestDto.java b/src/main/java/TiCatch/backend/domain/ticketing/dto/request/RequestDto.java new file mode 100644 index 0000000..f52f791 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/dto/request/RequestDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.dto.request; + +public class RequestDto { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/dto/response/ResponseDto.java b/src/main/java/TiCatch/backend/domain/ticketing/dto/response/ResponseDto.java new file mode 100644 index 0000000..fb5fbd4 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/dto/response/ResponseDto.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.dto.response; + +public class ResponseDto { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/repository/TicketingRepository.java b/src/main/java/TiCatch/backend/domain/ticketing/repository/TicketingRepository.java new file mode 100644 index 0000000..3524224 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/repository/TicketingRepository.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.repository; + +public interface TicketingRepository { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingService.java b/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingService.java new file mode 100644 index 0000000..ad1c688 --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingService.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.service; + +public interface TicketingService { +} diff --git a/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingServiceImpl.java b/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingServiceImpl.java new file mode 100644 index 0000000..f2ef11e --- /dev/null +++ b/src/main/java/TiCatch/backend/domain/ticketing/service/TicketingServiceImpl.java @@ -0,0 +1,4 @@ +package TiCatch.backend.domain.ticketing.service; + +public class TicketingServiceImpl { +} diff --git a/src/main/java/TiCatch/backend/global/exception/ExceptionCode.java b/src/main/java/TiCatch/backend/global/exception/ExceptionCode.java new file mode 100644 index 0000000..10ae760 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/exception/ExceptionCode.java @@ -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; +} diff --git a/src/main/java/TiCatch/backend/global/exception/ExceptionController.java b/src/main/java/TiCatch/backend/global/exception/ExceptionController.java new file mode 100644 index 0000000..1180bd4 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/exception/ExceptionController.java @@ -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()); + } +} diff --git a/src/main/java/TiCatch/backend/global/exception/ServerException.java b/src/main/java/TiCatch/backend/global/exception/ServerException.java new file mode 100644 index 0000000..83ed444 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/exception/ServerException.java @@ -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); + } +} diff --git a/src/main/java/TiCatch/backend/global/response/ListResponseResult.java b/src/main/java/TiCatch/backend/global/response/ListResponseResult.java new file mode 100644 index 0000000..7853a70 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/response/ListResponseResult.java @@ -0,0 +1,19 @@ +package TiCatch.backend.global.response; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Getter +@NoArgsConstructor +public class ListResponseResult extends ResponseResult { + + private List data; + + public ListResponseResult(List data) { + super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, + successResponse.timestamp); + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/TiCatch/backend/global/response/PageResponseResult.java b/src/main/java/TiCatch/backend/global/response/PageResponseResult.java new file mode 100644 index 0000000..e8b68a7 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/response/PageResponseResult.java @@ -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 extends ResponseResult { + + private Page data; + + public PageResponseResult(Page data) { + super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, + successResponse.timestamp); + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/TiCatch/backend/global/response/ResponseResult.java b/src/main/java/TiCatch/backend/global/response/ResponseResult.java new file mode 100644 index 0000000..4fe93d2 --- /dev/null +++ b/src/main/java/TiCatch/backend/global/response/ResponseResult.java @@ -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(); + } +} diff --git a/src/main/java/TiCatch/backend/global/response/SingleResponseResult.java b/src/main/java/TiCatch/backend/global/response/SingleResponseResult.java new file mode 100644 index 0000000..1bf6eea --- /dev/null +++ b/src/main/java/TiCatch/backend/global/response/SingleResponseResult.java @@ -0,0 +1,17 @@ +package TiCatch.backend.global.response; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class SingleResponseResult extends ResponseResult { + + private T data; + + public SingleResponseResult(T data) { + super(successResponse.statusCode, successResponse.messages, successResponse.developerMessage, + successResponse.timestamp); + this.data = data; + } +} \ No newline at end of file