diff --git a/src/main/java/kahlua/KahluaProject/confg/CorsMvcConfig.java b/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java similarity index 93% rename from src/main/java/kahlua/KahluaProject/confg/CorsMvcConfig.java rename to src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java index 2a07396..ea16fc9 100644 --- a/src/main/java/kahlua/KahluaProject/confg/CorsMvcConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.confg; +package kahlua.KahluaProject.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; diff --git a/src/main/java/kahlua/KahluaProject/confg/RedisConfig.java b/src/main/java/kahlua/KahluaProject/config/RedisConfig.java similarity index 97% rename from src/main/java/kahlua/KahluaProject/confg/RedisConfig.java rename to src/main/java/kahlua/KahluaProject/config/RedisConfig.java index 65984e4..b31f2a6 100644 --- a/src/main/java/kahlua/KahluaProject/confg/RedisConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/RedisConfig.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.confg; +package kahlua.KahluaProject.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/kahlua/KahluaProject/confg/SecurityConfig.java b/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java similarity index 99% rename from src/main/java/kahlua/KahluaProject/confg/SecurityConfig.java rename to src/main/java/kahlua/KahluaProject/config/SecurityConfig.java index 6346e03..0c2a26c 100644 --- a/src/main/java/kahlua/KahluaProject/confg/SecurityConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.confg; +package kahlua.KahluaProject.config; import kahlua.KahluaProject.security.ExceptionFilter; import kahlua.KahluaProject.security.jwt.JwtAccessDeniedHandler; diff --git a/src/main/java/kahlua/KahluaProject/confg/SwaggerConfig.java b/src/main/java/kahlua/KahluaProject/config/SwaggerConfig.java similarity index 98% rename from src/main/java/kahlua/KahluaProject/confg/SwaggerConfig.java rename to src/main/java/kahlua/KahluaProject/config/SwaggerConfig.java index 187134f..3067e71 100644 --- a/src/main/java/kahlua/KahluaProject/confg/SwaggerConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/SwaggerConfig.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.confg; +package kahlua.KahluaProject.config; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.info.Info; diff --git a/src/main/java/kahlua/KahluaProject/controller/AdminController.java b/src/main/java/kahlua/KahluaProject/controller/AdminController.java index 332b2df..b87222b 100644 --- a/src/main/java/kahlua/KahluaProject/controller/AdminController.java +++ b/src/main/java/kahlua/KahluaProject/controller/AdminController.java @@ -1,13 +1,15 @@ package kahlua.KahluaProject.controller; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import kahlua.KahluaProject.apipayload.ApiResponse; import kahlua.KahluaProject.apipayload.code.status.ErrorStatus; import kahlua.KahluaProject.domain.user.UserType; -import kahlua.KahluaProject.dto.response.ApplyGetResponse; -import kahlua.KahluaProject.dto.response.ApplyListResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyGetResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyListResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.security.AuthDetails; -import kahlua.KahluaProject.dto.response.TicketListResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketListResponse; import kahlua.KahluaProject.service.ApplyService; import kahlua.KahluaProject.service.TicketService; import lombok.RequiredArgsConstructor; @@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +@Tag(name = "관리자", description = "관리자 페이지 관련 API") @RestController @RequiredArgsConstructor @RequestMapping("/v1/admin") @@ -26,12 +29,14 @@ public class AdminController { private final TicketService ticketService; @GetMapping("/apply") + @Operation(summary = "지원자 리스트 조회", description = "id 기준으로 정렬된 지원자 리스트를 조회합니다") public ApiResponse getApplyList(@AuthenticationPrincipal AuthDetails authDetails) { ApplyListResponse applyListResponse = applyService.getApplyList(authDetails.user()); return ApiResponse.onSuccess(applyListResponse); } @GetMapping("/apply/{applyId}") + @Operation(summary = "지원자 상세정보 조회", description = "지원자 상세정보를 조회합니다") public ApiResponse getApplyDetail(@PathVariable Long applyId, @AuthenticationPrincipal AuthDetails authDetails) { if(authDetails.getUser().getUserType() != UserType.ADMIN){ throw new GeneralException(ErrorStatus.UNAUTHORIZED); @@ -41,20 +46,23 @@ public ApiResponse getApplyDetail(@PathVariable Long applyId, } @GetMapping("/tickets") - public ApiResponse getTicketList() { - TicketListResponse ticketListResponse = ticketService.getTicketList(); + @Operation(summary = "전체 티켓 리스트 조회", description = "id 기준으로 정렬된 전체 티켓 리스트를 조회합니다") + public ApiResponse getTicketList(@AuthenticationPrincipal AuthDetails authDetails) { + TicketListResponse ticketListResponse = ticketService.getTicketList(authDetails.user()); return ApiResponse.onSuccess(ticketListResponse); } @GetMapping("/tickets/general/") - public ApiResponse getGeneralTicketList() { - TicketListResponse ticketListResponse = ticketService.getGeneralTicketList(); + @Operation(summary = "일반 티켓 리스트 조회", description = "id 기준으로 정렬된 일반 티켓 리스트를 조회합니다") + public ApiResponse getGeneralTicketList(@AuthenticationPrincipal AuthDetails authDetails) { + TicketListResponse ticketListResponse = ticketService.getGeneralTicketList(authDetails.user()); return ApiResponse.onSuccess(ticketListResponse); } @GetMapping("/tickets/freshman/") - public ApiResponse getFreshmanTicketList() { - TicketListResponse ticketListResponse = ticketService.getFreshmanTicketList(); + @Operation(summary = "신입생 티켓 리스트 조회", description = "id 기준으로 정렬된 신입생 티켓 리스트를 조회합니다") + public ApiResponse getFreshmanTicketList(@AuthenticationPrincipal AuthDetails authDetails) { + TicketListResponse ticketListResponse = ticketService.getFreshmanTicketList(authDetails.user()); return ApiResponse.onSuccess(ticketListResponse); } } diff --git a/src/main/java/kahlua/KahluaProject/controller/ApplyController.java b/src/main/java/kahlua/KahluaProject/controller/ApplyController.java index 47dddde..ddc07b7 100644 --- a/src/main/java/kahlua/KahluaProject/controller/ApplyController.java +++ b/src/main/java/kahlua/KahluaProject/controller/ApplyController.java @@ -1,9 +1,9 @@ package kahlua.KahluaProject.controller; import kahlua.KahluaProject.apipayload.ApiResponse; -import kahlua.KahluaProject.dto.request.ApplyCreateRequest; -import kahlua.KahluaProject.dto.response.ApplyCreateResponse; -import kahlua.KahluaProject.dto.response.ApplyGetResponse; +import kahlua.KahluaProject.dto.apply.request.ApplyCreateRequest; +import kahlua.KahluaProject.dto.apply.response.ApplyCreateResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyGetResponse; import kahlua.KahluaProject.service.ApplyService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/kahlua/KahluaProject/controller/AuthController.java b/src/main/java/kahlua/KahluaProject/controller/AuthController.java index 2b5241a..3baf584 100644 --- a/src/main/java/kahlua/KahluaProject/controller/AuthController.java +++ b/src/main/java/kahlua/KahluaProject/controller/AuthController.java @@ -7,9 +7,9 @@ import jakarta.validation.Valid; import kahlua.KahluaProject.apipayload.ApiResponse; import kahlua.KahluaProject.apipayload.code.status.ErrorStatus; -import kahlua.KahluaProject.dto.request.SignInRequest; -import kahlua.KahluaProject.dto.request.SignUpRequest; -import kahlua.KahluaProject.dto.response.TokenResponse; +import kahlua.KahluaProject.dto.user.request.SignInRequest; +import kahlua.KahluaProject.dto.user.request.SignUpRequest; +import kahlua.KahluaProject.dto.user.response.TokenResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.security.AuthDetails; import kahlua.KahluaProject.security.jwt.JwtProvider; diff --git a/src/main/java/kahlua/KahluaProject/controller/TicketController.java b/src/main/java/kahlua/KahluaProject/controller/TicketController.java index 47f541a..a76f4e3 100644 --- a/src/main/java/kahlua/KahluaProject/controller/TicketController.java +++ b/src/main/java/kahlua/KahluaProject/controller/TicketController.java @@ -1,9 +1,9 @@ package kahlua.KahluaProject.controller; import kahlua.KahluaProject.apipayload.ApiResponse; -import kahlua.KahluaProject.dto.request.TicketCreateRequest; -import kahlua.KahluaProject.dto.response.TicketCreateResponse; -import kahlua.KahluaProject.dto.response.TicketGetResponse; +import kahlua.KahluaProject.dto.ticket.request.TicketCreateRequest; +import kahlua.KahluaProject.dto.ticket.response.TicketCreateResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketGetResponse; import kahlua.KahluaProject.service.TicketService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/kahlua/KahluaProject/converter/ApplyConverter.java b/src/main/java/kahlua/KahluaProject/converter/ApplyConverter.java index 0accd67..288bde3 100644 --- a/src/main/java/kahlua/KahluaProject/converter/ApplyConverter.java +++ b/src/main/java/kahlua/KahluaProject/converter/ApplyConverter.java @@ -1,9 +1,9 @@ package kahlua.KahluaProject.converter; import kahlua.KahluaProject.domain.apply.Apply; -import kahlua.KahluaProject.dto.request.ApplyCreateRequest; -import kahlua.KahluaProject.dto.response.ApplyCreateResponse; -import kahlua.KahluaProject.dto.response.ApplyGetResponse; +import kahlua.KahluaProject.dto.apply.request.ApplyCreateRequest; +import kahlua.KahluaProject.dto.apply.response.ApplyCreateResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyGetResponse; public class ApplyConverter { diff --git a/src/main/java/kahlua/KahluaProject/converter/AuthConverter.java b/src/main/java/kahlua/KahluaProject/converter/AuthConverter.java index 8d540a7..0916edd 100644 --- a/src/main/java/kahlua/KahluaProject/converter/AuthConverter.java +++ b/src/main/java/kahlua/KahluaProject/converter/AuthConverter.java @@ -1,8 +1,8 @@ package kahlua.KahluaProject.converter; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.response.SignInResponse; -import kahlua.KahluaProject.dto.response.TokenResponse; +import kahlua.KahluaProject.dto.user.response.SignInResponse; +import kahlua.KahluaProject.dto.user.response.TokenResponse; public class AuthConverter { public static SignInResponse toSignInResDto(User user, TokenResponse tokenResponse) { diff --git a/src/main/java/kahlua/KahluaProject/converter/TicketConverter.java b/src/main/java/kahlua/KahluaProject/converter/TicketConverter.java index 7d527c4..3121d52 100644 --- a/src/main/java/kahlua/KahluaProject/converter/TicketConverter.java +++ b/src/main/java/kahlua/KahluaProject/converter/TicketConverter.java @@ -2,14 +2,10 @@ import kahlua.KahluaProject.domain.ticket.Participants; import kahlua.KahluaProject.domain.ticket.Ticket; -import kahlua.KahluaProject.dto.request.ParticipantsCreateRequest; -import kahlua.KahluaProject.dto.request.TicketCreateRequest; -import kahlua.KahluaProject.dto.response.ParticipantsResponse; -import kahlua.KahluaProject.dto.response.TicketCreateResponse; -import kahlua.KahluaProject.dto.response.TicketGetResponse; -import kahlua.KahluaProject.repository.ParticipantsRepository; -import kahlua.KahluaProject.repository.TicketRepository; -import org.springframework.stereotype.Component; +import kahlua.KahluaProject.dto.ticket.request.TicketCreateRequest; +import kahlua.KahluaProject.dto.ticket.response.ParticipantsResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketCreateResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketGetResponse; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/kahlua/KahluaProject/converter/UserConverter.java b/src/main/java/kahlua/KahluaProject/converter/UserConverter.java index af8709d..6b1ddcb 100644 --- a/src/main/java/kahlua/KahluaProject/converter/UserConverter.java +++ b/src/main/java/kahlua/KahluaProject/converter/UserConverter.java @@ -1,7 +1,7 @@ package kahlua.KahluaProject.converter; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.response.UserResponse; +import kahlua.KahluaProject.dto.user.response.UserResponse; public class UserConverter { diff --git a/src/main/java/kahlua/KahluaProject/dto/request/ApplyCreateRequest.java b/src/main/java/kahlua/KahluaProject/dto/apply/request/ApplyCreateRequest.java similarity index 93% rename from src/main/java/kahlua/KahluaProject/dto/request/ApplyCreateRequest.java rename to src/main/java/kahlua/KahluaProject/dto/apply/request/ApplyCreateRequest.java index b6d1f12..82e9989 100644 --- a/src/main/java/kahlua/KahluaProject/dto/request/ApplyCreateRequest.java +++ b/src/main/java/kahlua/KahluaProject/dto/apply/request/ApplyCreateRequest.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.request; +package kahlua.KahluaProject.dto.apply.request; import kahlua.KahluaProject.domain.apply.Gender; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/ApplyCreateResponse.java b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyCreateResponse.java similarity index 94% rename from src/main/java/kahlua/KahluaProject/dto/response/ApplyCreateResponse.java rename to src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyCreateResponse.java index 3c7f5bd..00a48a1 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/ApplyCreateResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyCreateResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.apply.response; import kahlua.KahluaProject.domain.apply.Gender; import kahlua.KahluaProject.domain.apply.Major; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/ApplyGetResponse.java b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyGetResponse.java similarity index 94% rename from src/main/java/kahlua/KahluaProject/dto/response/ApplyGetResponse.java rename to src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyGetResponse.java index 2ae3213..fdd4f4c 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/ApplyGetResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyGetResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.apply.response; import kahlua.KahluaProject.domain.apply.Gender; import kahlua.KahluaProject.domain.apply.Major; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/ApplyItemResponse.java b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyItemResponse.java similarity index 51% rename from src/main/java/kahlua/KahluaProject/dto/response/ApplyItemResponse.java rename to src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyItemResponse.java index ffc819b..adba109 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/ApplyItemResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyItemResponse.java @@ -1,5 +1,6 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.apply.response; +import io.swagger.v3.oas.annotations.media.Schema; import kahlua.KahluaProject.domain.apply.Gender; import kahlua.KahluaProject.domain.apply.Major; import kahlua.KahluaProject.domain.apply.Preference; @@ -12,17 +13,30 @@ @Builder public class ApplyItemResponse { + @Schema(description = "지원자 id") private Long id; + + @Schema(description = "지원자 이름") private String name; + + @Schema(description = "지원자 전화번호") private String phone_num; + + @Schema(description = "지원자 생년월일") private String birth_date; + @Schema(description = "지원자 성별") private Gender gender; + @Schema(description = "지원자 주소") private String address; + @Schema(description = "지원자 전공") private Major major; + @Schema(description = "지원자 1지망 악기") private Preference first_preference; + + @Schema(description = "지원자 2지망 악기") private Preference second_preference; } diff --git a/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyListResponse.java b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyListResponse.java new file mode 100644 index 0000000..6a572a5 --- /dev/null +++ b/src/main/java/kahlua/KahluaProject/dto/apply/response/ApplyListResponse.java @@ -0,0 +1,16 @@ +package kahlua.KahluaProject.dto.apply.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; + +@Getter +@AllArgsConstructor +@Builder +@Schema(title = "지원자 리스트 응답 DTO") +public class ApplyListResponse { + + @Schema(description = "지원자 리스트") + private T applies; +} diff --git a/src/main/java/kahlua/KahluaProject/dto/response/ApplyListResponse.java b/src/main/java/kahlua/KahluaProject/dto/response/ApplyListResponse.java deleted file mode 100644 index 718095f..0000000 --- a/src/main/java/kahlua/KahluaProject/dto/response/ApplyListResponse.java +++ /dev/null @@ -1,13 +0,0 @@ -package kahlua.KahluaProject.dto.response; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Builder -public class ApplyListResponse { - - private T applies; -} diff --git a/src/main/java/kahlua/KahluaProject/dto/response/TicketItemResponse.java b/src/main/java/kahlua/KahluaProject/dto/response/TicketItemResponse.java deleted file mode 100644 index eb81276..0000000 --- a/src/main/java/kahlua/KahluaProject/dto/response/TicketItemResponse.java +++ /dev/null @@ -1,22 +0,0 @@ -package kahlua.KahluaProject.dto.response; - -import kahlua.KahluaProject.domain.ticket.Meeting; -import kahlua.KahluaProject.domain.ticket.Status; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; - -@Getter -@Builder -@AllArgsConstructor -public class TicketItemResponse { - - private Long id; - private Status status; - private String reservation_id; - private String buyer; - private String phone_num; - private Integer total_ticket; - private String major; - private Meeting meeting; -} diff --git a/src/main/java/kahlua/KahluaProject/dto/request/ParticipantsCreateRequest.java b/src/main/java/kahlua/KahluaProject/dto/ticket/request/ParticipantsCreateRequest.java similarity index 82% rename from src/main/java/kahlua/KahluaProject/dto/request/ParticipantsCreateRequest.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/request/ParticipantsCreateRequest.java index 413f316..2cfd5c2 100644 --- a/src/main/java/kahlua/KahluaProject/dto/request/ParticipantsCreateRequest.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/request/ParticipantsCreateRequest.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.request; +package kahlua.KahluaProject.dto.ticket.request; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kahlua/KahluaProject/dto/request/TicketCreateRequest.java b/src/main/java/kahlua/KahluaProject/dto/ticket/request/TicketCreateRequest.java similarity index 84% rename from src/main/java/kahlua/KahluaProject/dto/request/TicketCreateRequest.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/request/TicketCreateRequest.java index 32642cb..a0e6533 100644 --- a/src/main/java/kahlua/KahluaProject/dto/request/TicketCreateRequest.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/request/TicketCreateRequest.java @@ -1,7 +1,6 @@ -package kahlua.KahluaProject.dto.request; +package kahlua.KahluaProject.dto.ticket.request; import kahlua.KahluaProject.domain.ticket.Meeting; -import kahlua.KahluaProject.domain.ticket.Participants; import kahlua.KahluaProject.domain.ticket.Type; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/ParticipantsResponse.java b/src/main/java/kahlua/KahluaProject/dto/ticket/response/ParticipantsResponse.java similarity index 82% rename from src/main/java/kahlua/KahluaProject/dto/response/ParticipantsResponse.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/response/ParticipantsResponse.java index b8c1069..b1333f4 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/ParticipantsResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/response/ParticipantsResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.ticket.response; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/TicketCreateResponse.java b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketCreateResponse.java similarity index 93% rename from src/main/java/kahlua/KahluaProject/dto/response/TicketCreateResponse.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketCreateResponse.java index e4eebe3..70c64de 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/TicketCreateResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketCreateResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.ticket.response; import kahlua.KahluaProject.domain.ticket.Meeting; import kahlua.KahluaProject.domain.ticket.Participants; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/TicketGetResponse.java b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketGetResponse.java similarity index 80% rename from src/main/java/kahlua/KahluaProject/dto/response/TicketGetResponse.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketGetResponse.java index 3a2cebc..41ac067 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/TicketGetResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketGetResponse.java @@ -1,10 +1,8 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.ticket.response; import kahlua.KahluaProject.domain.ticket.Meeting; -import kahlua.KahluaProject.domain.ticket.Participants; import kahlua.KahluaProject.domain.ticket.Status; import kahlua.KahluaProject.domain.ticket.Type; -import kahlua.KahluaProject.repository.ParticipantsRepository; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketItemResponse.java b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketItemResponse.java new file mode 100644 index 0000000..da62538 --- /dev/null +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketItemResponse.java @@ -0,0 +1,38 @@ +package kahlua.KahluaProject.dto.ticket.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import kahlua.KahluaProject.domain.ticket.Meeting; +import kahlua.KahluaProject.domain.ticket.Status; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +@AllArgsConstructor +public class TicketItemResponse { + + @Schema(description = "티켓 id") + private Long id; + + @Schema(description = "결제상태") + private Status status; + + @Schema(description = "예약번호") + private String reservation_id; + + @Schema(description = "티켓 구매자 이름") + private String buyer; + + @Schema(description = "티켓 구매자 전화번호") + private String phone_num; + + @Schema(description = "티켓 매수") + private Integer total_ticket; + + @Schema(description = "티켓 구매자 전공") + private String major; + + @Schema(description = "뒷풀이 참여여부") + private Meeting meeting; +} diff --git a/src/main/java/kahlua/KahluaProject/dto/response/TicketListResponse.java b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketListResponse.java similarity index 50% rename from src/main/java/kahlua/KahluaProject/dto/response/TicketListResponse.java rename to src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketListResponse.java index a48be1d..636d00e 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/TicketListResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/ticket/response/TicketListResponse.java @@ -1,5 +1,6 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.ticket.response; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -9,8 +10,12 @@ @Getter @Builder @AllArgsConstructor +@Schema(title = "티켓 리스트 응답 DTO") public class TicketListResponse { + @Schema(description = "전체 티켓 매수") private Integer total; + + @Schema(description = "티켓 리스트") private List tickets; } diff --git a/src/main/java/kahlua/KahluaProject/dto/request/SignInRequest.java b/src/main/java/kahlua/KahluaProject/dto/user/request/SignInRequest.java similarity index 90% rename from src/main/java/kahlua/KahluaProject/dto/request/SignInRequest.java rename to src/main/java/kahlua/KahluaProject/dto/user/request/SignInRequest.java index 5dce79e..4154a8b 100644 --- a/src/main/java/kahlua/KahluaProject/dto/request/SignInRequest.java +++ b/src/main/java/kahlua/KahluaProject/dto/user/request/SignInRequest.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.request; +package kahlua.KahluaProject.dto.user.request; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; diff --git a/src/main/java/kahlua/KahluaProject/dto/request/SignUpRequest.java b/src/main/java/kahlua/KahluaProject/dto/user/request/SignUpRequest.java similarity index 95% rename from src/main/java/kahlua/KahluaProject/dto/request/SignUpRequest.java rename to src/main/java/kahlua/KahluaProject/dto/user/request/SignUpRequest.java index 2757c06..ede1809 100644 --- a/src/main/java/kahlua/KahluaProject/dto/request/SignUpRequest.java +++ b/src/main/java/kahlua/KahluaProject/dto/user/request/SignUpRequest.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.request; +package kahlua.KahluaProject.dto.user.request; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/SignInResponse.java b/src/main/java/kahlua/KahluaProject/dto/user/response/SignInResponse.java similarity index 93% rename from src/main/java/kahlua/KahluaProject/dto/response/SignInResponse.java rename to src/main/java/kahlua/KahluaProject/dto/user/response/SignInResponse.java index f8d7cdb..eacd14b 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/SignInResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/user/response/SignInResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.user.response; import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/TokenResponse.java b/src/main/java/kahlua/KahluaProject/dto/user/response/TokenResponse.java similarity index 90% rename from src/main/java/kahlua/KahluaProject/dto/response/TokenResponse.java rename to src/main/java/kahlua/KahluaProject/dto/user/response/TokenResponse.java index 20d95db..8b49af9 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/TokenResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/user/response/TokenResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.user.response; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; diff --git a/src/main/java/kahlua/KahluaProject/dto/response/UserResponse.java b/src/main/java/kahlua/KahluaProject/dto/user/response/UserResponse.java similarity index 89% rename from src/main/java/kahlua/KahluaProject/dto/response/UserResponse.java rename to src/main/java/kahlua/KahluaProject/dto/user/response/UserResponse.java index df90f72..e1951db 100644 --- a/src/main/java/kahlua/KahluaProject/dto/response/UserResponse.java +++ b/src/main/java/kahlua/KahluaProject/dto/user/response/UserResponse.java @@ -1,4 +1,4 @@ -package kahlua.KahluaProject.dto.response; +package kahlua.KahluaProject.dto.user.response; import io.swagger.v3.oas.annotations.media.Schema; import kahlua.KahluaProject.domain.user.UserType; diff --git a/src/main/java/kahlua/KahluaProject/security/jwt/JwtProvider.java b/src/main/java/kahlua/KahluaProject/security/jwt/JwtProvider.java index 930725c..c353e41 100644 --- a/src/main/java/kahlua/KahluaProject/security/jwt/JwtProvider.java +++ b/src/main/java/kahlua/KahluaProject/security/jwt/JwtProvider.java @@ -10,7 +10,7 @@ import jakarta.servlet.http.HttpServletRequest; import kahlua.KahluaProject.apipayload.code.status.ErrorStatus; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.response.TokenResponse; +import kahlua.KahluaProject.dto.user.response.TokenResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.redis.RedisClient; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/kahlua/KahluaProject/service/ApplyService.java b/src/main/java/kahlua/KahluaProject/service/ApplyService.java index dfc139e..3e07cc1 100644 --- a/src/main/java/kahlua/KahluaProject/service/ApplyService.java +++ b/src/main/java/kahlua/KahluaProject/service/ApplyService.java @@ -6,11 +6,11 @@ import kahlua.KahluaProject.domain.apply.Apply; import kahlua.KahluaProject.domain.user.User; import kahlua.KahluaProject.domain.user.UserType; -import kahlua.KahluaProject.dto.request.ApplyCreateRequest; -import kahlua.KahluaProject.dto.response.ApplyCreateResponse; -import kahlua.KahluaProject.dto.response.ApplyGetResponse; -import kahlua.KahluaProject.dto.response.ApplyItemResponse; -import kahlua.KahluaProject.dto.response.ApplyListResponse; +import kahlua.KahluaProject.dto.apply.request.ApplyCreateRequest; +import kahlua.KahluaProject.dto.apply.response.ApplyCreateResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyGetResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyItemResponse; +import kahlua.KahluaProject.dto.apply.response.ApplyListResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.repository.ApplyRepository; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/kahlua/KahluaProject/service/AuthService.java b/src/main/java/kahlua/KahluaProject/service/AuthService.java index 67f237b..59ac67e 100644 --- a/src/main/java/kahlua/KahluaProject/service/AuthService.java +++ b/src/main/java/kahlua/KahluaProject/service/AuthService.java @@ -5,11 +5,11 @@ import kahlua.KahluaProject.converter.UserConverter; import kahlua.KahluaProject.domain.user.Credential; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.request.SignInRequest; -import kahlua.KahluaProject.dto.request.SignUpRequest; -import kahlua.KahluaProject.dto.response.SignInResponse; -import kahlua.KahluaProject.dto.response.TokenResponse; -import kahlua.KahluaProject.dto.response.UserResponse; +import kahlua.KahluaProject.dto.user.request.SignInRequest; +import kahlua.KahluaProject.dto.user.request.SignUpRequest; +import kahlua.KahluaProject.dto.user.response.SignInResponse; +import kahlua.KahluaProject.dto.user.response.TokenResponse; +import kahlua.KahluaProject.dto.user.response.UserResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.redis.RedisClient; import kahlua.KahluaProject.security.jwt.JwtProvider; diff --git a/src/main/java/kahlua/KahluaProject/service/CredentialService.java b/src/main/java/kahlua/KahluaProject/service/CredentialService.java index 9ae532b..386656b 100644 --- a/src/main/java/kahlua/KahluaProject/service/CredentialService.java +++ b/src/main/java/kahlua/KahluaProject/service/CredentialService.java @@ -3,7 +3,7 @@ import kahlua.KahluaProject.apipayload.code.status.ErrorStatus; import kahlua.KahluaProject.domain.user.Credential; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.request.SignUpRequest; +import kahlua.KahluaProject.dto.user.request.SignUpRequest; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.repository.CredentialRepository; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/kahlua/KahluaProject/service/TicketService.java b/src/main/java/kahlua/KahluaProject/service/TicketService.java index a4cbd44..8b5302a 100644 --- a/src/main/java/kahlua/KahluaProject/service/TicketService.java +++ b/src/main/java/kahlua/KahluaProject/service/TicketService.java @@ -6,8 +6,13 @@ import kahlua.KahluaProject.domain.ticket.Participants; import kahlua.KahluaProject.domain.ticket.Ticket; import kahlua.KahluaProject.domain.ticket.Type; -import kahlua.KahluaProject.dto.request.TicketCreateRequest; -import kahlua.KahluaProject.dto.response.*; +import kahlua.KahluaProject.domain.user.User; +import kahlua.KahluaProject.domain.user.UserType; +import kahlua.KahluaProject.dto.ticket.request.TicketCreateRequest; +import kahlua.KahluaProject.dto.ticket.response.TicketCreateResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketGetResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketItemResponse; +import kahlua.KahluaProject.dto.ticket.response.TicketListResponse; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.repository.ParticipantsRepository; import kahlua.KahluaProject.repository.TicketRepository; @@ -62,7 +67,11 @@ public TicketGetResponse viewTicket(Long ticketId) { } // 어드민 페이지 티켓 리스트 조회 - public TicketListResponse getTicketList() { + public TicketListResponse getTicketList(User user) { + + if(user.getUserType() != UserType.ADMIN){ + throw new GeneralException(ErrorStatus.UNAUTHORIZED); + } List tickets = ticketRepository.findAll(); List ticketItemResponses = new ArrayList<>(); @@ -109,7 +118,11 @@ else if (ticket.getType() == Type.FRESHMAN) { } // 일반 티켓 리스트 조회 - public TicketListResponse getGeneralTicketList() { + public TicketListResponse getGeneralTicketList(User user) { + + if(user.getUserType() != UserType.ADMIN){ + throw new GeneralException(ErrorStatus.UNAUTHORIZED); + } List tickets = ticketRepository.findAllByType(Type.GENERAL); List ticketItemResponses = new ArrayList<>(); @@ -136,7 +149,11 @@ public TicketListResponse getGeneralTicketList() { } // 신입생 티켓 리스트 조회 - public TicketListResponse getFreshmanTicketList() { + public TicketListResponse getFreshmanTicketList(User user) { + + if(user.getUserType() != UserType.ADMIN){ + throw new GeneralException(ErrorStatus.UNAUTHORIZED); + } List tickets = ticketRepository.findAllByType(Type.FRESHMAN); List ticketItemResponses = new ArrayList<>(); diff --git a/src/main/java/kahlua/KahluaProject/service/UserService.java b/src/main/java/kahlua/KahluaProject/service/UserService.java index 658be4b..ef274b4 100644 --- a/src/main/java/kahlua/KahluaProject/service/UserService.java +++ b/src/main/java/kahlua/KahluaProject/service/UserService.java @@ -3,7 +3,7 @@ import kahlua.KahluaProject.apipayload.code.status.ErrorStatus; import kahlua.KahluaProject.domain.user.Credential; import kahlua.KahluaProject.domain.user.User; -import kahlua.KahluaProject.dto.request.SignUpRequest; +import kahlua.KahluaProject.dto.user.request.SignUpRequest; import kahlua.KahluaProject.exception.GeneralException; import kahlua.KahluaProject.repository.UserRepository; import lombok.RequiredArgsConstructor;