-
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.
Browse files
Browse the repository at this point in the history
Swagger 리펙토링(도메인 및 Controller 등)/#118
- Loading branch information
Showing
33 changed files
with
469 additions
and
221 deletions.
There are no files selected for viewing
43 changes: 33 additions & 10 deletions
43
src/main/java/com/programmers/ticketparis/auth/controller/AuthController.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
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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/programmers/ticketparis/auth/dto/LoginSuccessResponse.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.programmers.ticketparis.auth.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Schema(name = "loginSuccess", description = "로그인 성공 시 응답") | ||
public class LoginSuccessResponse { | ||
|
||
@Schema(description = "로그인 여부") | ||
private String login = "로그인 성공"; | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/programmers/ticketparis/auth/dto/LogoutSuccessResponse.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.programmers.ticketparis.auth.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Schema(name = "logoutSuccess", description = "로그아웃 성공 시 응답") | ||
public class LogoutSuccessResponse { | ||
|
||
@Schema(description = "로그아웃 여부") | ||
private String logout = "로그아웃 성공"; | ||
} |
6 changes: 5 additions & 1 deletion
6
src/main/java/com/programmers/ticketparis/auth/dto/SessionValueDto.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
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
26 changes: 0 additions & 26 deletions
26
src/main/java/com/programmers/ticketparis/common/dto/ApiResponse.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
src/main/java/com/programmers/ticketparis/common/dto/ApiResponseType.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,55 @@ | ||
package com.programmers.ticketparis.common.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.programmers.ticketparis.auth.dto.LoginSuccessResponse; | ||
import com.programmers.ticketparis.auth.dto.LogoutSuccessResponse; | ||
import com.programmers.ticketparis.auth.dto.SessionValueDto; | ||
import com.programmers.ticketparis.common.exception.ExceptionRule; | ||
import com.programmers.ticketparis.member.dto.response.CustomerIdResponse; | ||
import com.programmers.ticketparis.member.dto.response.CustomerResponse; | ||
import com.programmers.ticketparis.member.dto.response.SellerIdResponse; | ||
import com.programmers.ticketparis.member.dto.response.SellerResponse; | ||
import com.programmers.ticketparis.performance.dto.response.PerformanceIdResponse; | ||
import com.programmers.ticketparis.performance.dto.response.PerformanceResponse; | ||
import com.programmers.ticketparis.ranking.dto.response.RankingResponse; | ||
import com.programmers.ticketparis.reservation.dto.response.ReservationIdResponse; | ||
import com.programmers.ticketparis.reservation.dto.response.ReservationResponse; | ||
import com.programmers.ticketparis.schedule.dto.response.ScheduleIdResponse; | ||
import com.programmers.ticketparis.schedule.dto.response.ScheduleResponse; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Schema(description = "공통 API 응답 포맷") | ||
public class ApiResponseType<T> { | ||
|
||
@Schema(description = "응답 시간") | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Asia/Seoul") | ||
private final LocalDateTime localDateTime = LocalDateTime.now(); | ||
|
||
@Schema(description = "응답 경로") | ||
private final String path; | ||
|
||
@Schema(description = "응답 data", oneOf = {PerformanceResponse.class, PerformanceIdResponse.class, | ||
ScheduleResponse.class, ScheduleIdResponse.class, | ||
RankingResponse.class, SessionValueDto.class, | ||
ReservationResponse.class, ReservationIdResponse.class, | ||
CustomerResponse.class, CustomerIdResponse.class, | ||
SellerResponse.class, SellerIdResponse.class, | ||
LoginSuccessResponse.class, LogoutSuccessResponse.class | ||
}) | ||
private final T data; | ||
|
||
@Schema(description = "응답 메시지(정상 응답 시 null, 실패 시 Business 예외 매시지 출력)", oneOf = ExceptionRule.class, defaultValue = "null") | ||
private final String message; | ||
|
||
@Builder | ||
private ApiResponseType(String path, T data, String message) { | ||
this.path = path; | ||
this.data = data; | ||
this.message = 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
34 changes: 24 additions & 10 deletions
34
src/main/java/com/programmers/ticketparis/member/controller/CustomerController.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
Oops, something went wrong.