From c9a450cec92389465f4dbb9ed4b641787ae75ba7 Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Thu, 11 Dec 2025 15:54:39 +0900 Subject: [PATCH 1/4] =?UTF-8?q?sysout=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java b/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java index 7496a2d8..df1c8a32 100644 --- a/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java +++ b/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java @@ -13,8 +13,6 @@ public class HtmlEscapeDeserializer extends JsonDeserializer { public Object deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException { String value = jsonParser.getValueAsString(); - System.out.println("๐Ÿ”ฅ HtmlEscapeDeserializer ์‹คํ–‰๋จ: " + value); - System.out.println("convert : " + (value == null ? null : HtmlUtils.htmlEscape(value))); return value == null ? null : HtmlUtils.htmlEscape(value); } } From 7cc8e46056b893f62311eaeae46cf5b2e121217e Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 11 Dec 2025 15:58:38 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EA=B6=8C=ED=95=9C=20enum=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java b/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java index 91956284..f54478ff 100644 --- a/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java +++ b/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java @@ -7,7 +7,6 @@ import org.springframework.http.HttpStatus; @Getter public enum AuthErrorCode implements ErrorCode { - // ๐Ÿ” ๋กœ๊ทธ์ธ ๊ด€๋ จ LOGIN_ID_NOT_FOUND("LOGIN_ID_NOT_FOUND", HttpStatus.UNAUTHORIZED), LOGIN_PASSWORD_MISMATCH("LOGIN_PASSWORD_MISMATCH", HttpStatus.UNAUTHORIZED), From d18e4db0600d83de388a5aca3cb2dfa9d142ebfd Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 11 Dec 2025 17:06:13 +0900 Subject: [PATCH 3/4] =?UTF-8?q?test=20api=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C=EC=84=9C=EB=B2=84=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EB=A7=8C=EB=A3=8C=EC=8B=9C=EA=B0=84=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cd/kamcoback/members/AuthController.java | 135 ++++---- .../InferenceResultRepositoryImpl.java | 287 +++++++++--------- .../cd/kamcoback/test/TestApiController.java | 68 +++++ src/main/resources/application-dev.yml | 6 +- 4 files changed, 284 insertions(+), 212 deletions(-) create mode 100644 src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java diff --git a/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java b/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java index d80dbfdf..a2e21d56 100644 --- a/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java +++ b/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java @@ -54,59 +54,59 @@ public class AuthController { @Operation(summary = "๋กœ๊ทธ์ธ", description = "์‚ฌ๋ฒˆ์œผ๋กœ ๋กœ๊ทธ์ธํ•˜์—ฌ ์•ก์„ธ์Šค/๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์„ ๋ฐœ๊ธ‰.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "๋กœ๊ทธ์ธ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = TokenResponse.class))), + responseCode = "200", + description = "๋กœ๊ทธ์ธ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = TokenResponse.class))), @ApiResponse( - responseCode = "401", - description = "๋กœ๊ทธ์ธ ์‹คํŒจ (์•„์ด๋””/๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜, ๊ณ„์ •์ž ๊ธˆ ๋“ฑ)", - content = - @Content( - schema = @Schema(implementation = ErrorResponse.class), - examples = { - @ExampleObject( - name = "์•„์ด๋”” ์ž…๋ ฅ ์˜ค๋ฅ˜", - description = "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์•„์ด๋””", - value = - """ + responseCode = "401", + description = "๋กœ๊ทธ์ธ ์‹คํŒจ (์•„์ด๋””/๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜, ๊ณ„์ •์ž ๊ธˆ ๋“ฑ)", + content = + @Content( + schema = @Schema(implementation = ErrorResponse.class), + examples = { + @ExampleObject( + name = "์•„์ด๋”” ์ž…๋ ฅ ์˜ค๋ฅ˜", + description = "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์•„์ด๋””", + value = + """ { "code": "LOGIN_ID_NOT_FOUND", "message": "์•„์ด๋””๋ฅผ ์ž˜๋ชป ์ž…๋ ฅํ•˜์…จ์Šต๋‹ˆ๋‹ค." } """), - @ExampleObject( - name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ ์˜ค๋ฅ˜ (4ํšŒ ์ดํ•˜)", - description = "์•„์ด๋””๋Š” ์ •์ƒ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ํ‹€๋ฆฐ ๊ฒฝ์šฐ", - value = - """ + @ExampleObject( + name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ ์˜ค๋ฅ˜ (4ํšŒ ์ดํ•˜)", + description = "์•„์ด๋””๋Š” ์ •์ƒ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ํ‹€๋ฆฐ ๊ฒฝ์šฐ", + value = + """ { "code": "LOGIN_PASSWORD_MISMATCH", "message": "๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž˜๋ชป ์ž…๋ ฅํ•˜์…จ์Šต๋‹ˆ๋‹ค." } """), - @ExampleObject( - name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜ ์ดˆ๊ณผ", - description = "๋น„๋ฐ€๋ฒˆํ˜ธ 5ํšŒ ์ด์ƒ ์˜ค๋ฅ˜๋กœ ๊ณ„์ • ์ž ๊น€", - value = - """ + @ExampleObject( + name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜ ์ดˆ๊ณผ", + description = "๋น„๋ฐ€๋ฒˆํ˜ธ 5ํšŒ ์ด์ƒ ์˜ค๋ฅ˜๋กœ ๊ณ„์ • ์ž ๊น€", + value = + """ { "code": "LOGIN_PASSWORD_EXCEEDED", "message": "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜๋ฅผ ์ดˆ๊ณผํ•˜์—ฌ ์ด์šฉํ•˜์‹ค ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ์ธ ์˜ค๋ฅ˜์— ๋Œ€ํ•ด ๊ด€๋ฆฌ์ž์—๊ฒŒ ๋ฌธ์˜ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค." } """) - })) + })) }) public ApiResponseDto signin( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "๋กœ๊ทธ์ธ ์š”์ฒญ ์ •๋ณด", - required = true) - @RequestBody - SignInRequest request, - HttpServletResponse response) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "๋กœ๊ทธ์ธ ์š”์ฒญ ์ •๋ณด", + required = true) + @RequestBody + SignInRequest request, + HttpServletResponse response) { Authentication authentication = - authenticationManager.authenticate( - new UsernamePasswordAuthenticationToken(request.getUsername(), request.getPassword())); + authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(request.getUsername(), request.getPassword())); String status = authService.getUserStatus(request); @@ -124,17 +124,17 @@ public class AuthController { // Redis์— RefreshToken ์ €์žฅ (TTL = 7์ผ) refreshTokenService.save( - username, refreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); + username, refreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); // HttpOnly + Secure ์ฟ ํ‚ค์— RefreshToken ์ €์žฅ ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, refreshToken) - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, refreshToken) + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); @@ -153,20 +153,19 @@ public class AuthController { @Operation(summary = "ํ† ํฐ ์žฌ๋ฐœ๊ธ‰", description = "๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์œผ๋กœ ์ƒˆ๋กœ์šด ์•ก์„ธ์Šค/๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์„ ์žฌ๋ฐœ๊ธ‰ํ•ฉ๋‹ˆ๋‹ค.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "์žฌ๋ฐœ๊ธ‰ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = TokenResponse.class))), + responseCode = "200", + description = "์žฌ๋ฐœ๊ธ‰ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = TokenResponse.class))), @ApiResponse( - responseCode = "401", - description = "๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ", - content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + responseCode = "403", + description = "๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) public ResponseEntity refresh(String refreshToken, HttpServletResponse response) - throws AccessDeniedException { + throws AccessDeniedException { if (refreshToken == null || !jwtTokenProvider.isValidToken(refreshToken)) { throw new AccessDeniedException("๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ ์ž…๋‹ˆ๋‹ค."); } - String username = jwtTokenProvider.getSubject(refreshToken); // Redis์— ์ €์žฅ๋œ RefreshToken๊ณผ ์ผ์น˜ํ•˜๋Š”์ง€ ํ™•์ธ @@ -180,17 +179,17 @@ public class AuthController { // Redis ๊ฐฑ์‹  refreshTokenService.save( - username, newRefreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); + username, newRefreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); // ์ฟ ํ‚ค ๊ฐฑ์‹  ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, newRefreshToken) - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, newRefreshToken) + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); MembersDto.Member member = new MembersDto.Member(); @@ -201,12 +200,12 @@ public class AuthController { @Operation(summary = "๋กœ๊ทธ์•„์›ƒ", description = "ํ˜„์žฌ ์‚ฌ์šฉ์ž์˜ ํ† ํฐ์„ ๋ฌดํšจํ™”(๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ ์‚ญ์ œ)ํ•ฉ๋‹ˆ๋‹ค.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "๋กœ๊ทธ์•„์›ƒ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = Void.class))) + responseCode = "200", + description = "๋กœ๊ทธ์•„์›ƒ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = Void.class))) }) public ApiResponseDto> logout( - Authentication authentication, HttpServletResponse response) { + Authentication authentication, HttpServletResponse response) { if (authentication != null) { String username = authentication.getName(); // Redis์—์„œ RefreshToken ์‚ญ์ œ @@ -215,13 +214,13 @@ public class AuthController { // ์ฟ ํ‚ค ์‚ญ์ œ (Max-Age=0) ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, "") - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(0) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, "") + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(0) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); return ApiResponseDto.createOK(ResponseEntity.noContent().build()); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java index dfcab8d6..8421fb08 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java @@ -40,11 +40,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity; private final QMapSheetAnalEntity mapSheetAnalEntity = QMapSheetAnalEntity.mapSheetAnalEntity; private final QMapSheetAnalDataEntity mapSheetAnalDataEntity = - QMapSheetAnalDataEntity.mapSheetAnalDataEntity; + QMapSheetAnalDataEntity.mapSheetAnalDataEntity; private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeomEntity = - QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; + QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; private final QMapSheetAnalSttcEntity mapSheetAnalSttcEntity = - QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity; + QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity; /** * ๋ถ„์„๊ฒฐ๊ณผ ๋ชฉ๋ก ์กฐํšŒ @@ -54,7 +54,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC */ @Override public Page getInferenceResultList( - InferenceResultDto.SearchReq searchReq) { + InferenceResultDto.SearchReq searchReq) { Pageable pageable = searchReq.toPageable(); // "0000" ์ „์ฒด์กฐํšŒ BooleanBuilder builder = new BooleanBuilder(); @@ -68,35 +68,35 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - queryFactory - .select( - Projections.constructor( - InferenceResultDto.AnalResList.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, - mapSheetAnalEntity.analMapSheet, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.analState, - Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), - mapSheetAnalEntity.gukyuinUsed)) - .from(mapSheetAnalEntity) - .where(builder) - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .orderBy(mapSheetAnalEntity.id.desc()) - .fetch(); + queryFactory + .select( + Projections.constructor( + InferenceResultDto.AnalResList.class, + mapSheetAnalEntity.id, + mapSheetAnalEntity.analTitle, + mapSheetAnalEntity.analMapSheet, + mapSheetAnalEntity.detectingCnt, + mapSheetAnalEntity.analStrtDttm, + mapSheetAnalEntity.analEndDttm, + mapSheetAnalEntity.analSec, + mapSheetAnalEntity.analPredSec, + mapSheetAnalEntity.analState, + Expressions.stringTemplate( + "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), + mapSheetAnalEntity.gukyuinUsed)) + .from(mapSheetAnalEntity) + .where(builder) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .orderBy(mapSheetAnalEntity.id.desc()) + .fetch(); long total = - queryFactory - .select(mapSheetAnalEntity.id) - .from(mapSheetAnalEntity) - .where(builder) - .fetchCount(); + queryFactory + .select(mapSheetAnalEntity.id) + .from(mapSheetAnalEntity) + .where(builder) + .fetchCount(); return new PageImpl<>(content, pageable, total); } @@ -112,40 +112,41 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // 1. ์ตœ์‹  ๋ฒ„์ „ UID๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์„œ๋ธŒ์ฟผ๋ฆฌ JPQLQuery latestVerUidSub = - JPAExpressions.select(tmv.id.max()).from(tmv).where(tmv.modelUid.eq(tmm.id)); + JPAExpressions.select(tmv.id.max()).from(tmv).where(tmv.modelUid.eq(tmm.id)); Optional content = - Optional.ofNullable( - queryFactory - .select( - Projections.constructor( - InferenceResultDto.AnalResSummary.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, - tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), - mapSheetAnalEntity.targetYyyy, - mapSheetAnalEntity.compareYyyy, - mapSheetAnalEntity.analMapSheet, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.resultUrl, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.accuracy, - mapSheetAnalEntity.analState, - Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) - .from(mapSheetAnalEntity) - .leftJoin(tmm) - .on(mapSheetAnalEntity.modelUid.eq(tmm.id)) - .leftJoin(tmv) - .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) - .where(mapSheetAnalEntity.id.eq(id)) - .fetchOne()); + Optional.ofNullable( + queryFactory + .select( + Projections.constructor( + InferenceResultDto.AnalResSummary.class, + mapSheetAnalEntity.id, + mapSheetAnalEntity.analTitle, + tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), + mapSheetAnalEntity.targetYyyy, + mapSheetAnalEntity.compareYyyy, + mapSheetAnalEntity.analMapSheet, + mapSheetAnalEntity.analStrtDttm, + mapSheetAnalEntity.analEndDttm, + mapSheetAnalEntity.analSec, + mapSheetAnalEntity.analPredSec, + mapSheetAnalEntity.resultUrl, + mapSheetAnalEntity.detectingCnt, + mapSheetAnalEntity.accuracy, + mapSheetAnalEntity.analState, + Expressions.stringTemplate( + "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) + .from(mapSheetAnalEntity) + .leftJoin(tmm) + .on(mapSheetAnalEntity.modelUid.eq(tmm.id)) + .leftJoin(tmv) + .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) + .where(mapSheetAnalEntity.id.eq(id)) + .fetchOne()); return content; } + /** * ๋ถ„์„๊ฒฐ๊ณผ ์ƒ์„ธ class name๋ณ„ ํƒ์ง€ ๊ฐœ์ˆ˜ * @@ -155,16 +156,16 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC @Override public List getDashboard(Long id) { return queryFactory - .select( - Projections.constructor( - Dashboard.class, - mapSheetAnalSttcEntity.id.classAfterCd, - mapSheetAnalSttcEntity.classAfterCnt.sum())) - .from(mapSheetAnalSttcEntity) - .where(mapSheetAnalSttcEntity.id.analUid.eq(id)) - .groupBy(mapSheetAnalSttcEntity.id.classAfterCd) - .orderBy(mapSheetAnalSttcEntity.id.classAfterCd.asc()) - .fetch(); + .select( + Projections.constructor( + Dashboard.class, + mapSheetAnalSttcEntity.id.classAfterCd, + mapSheetAnalSttcEntity.classAfterCnt.sum())) + .from(mapSheetAnalSttcEntity) + .where(mapSheetAnalSttcEntity.id.analUid.eq(id)) + .groupBy(mapSheetAnalSttcEntity.id.classAfterCd) + .orderBy(mapSheetAnalSttcEntity.id.classAfterCd.asc()) + .fetch(); } @Override @@ -181,22 +182,22 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC */ @Override public Page listInferenceResultWithGeom( - List ids, SearchGeoReq searchReq) { + List ids, SearchGeoReq searchReq) { // ๋ถ„์„ ์ฐจ์ˆ˜ QMapSheetAnalDataGeomEntity detectedEntity = - QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; + QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; Pageable pageable = searchReq.toPageable(); // ๊ฒ€์ƒ‰์กฐ๊ฑด JPAQuery query = - queryFactory - .selectFrom(detectedEntity) - .where( - detectedEntity.dataUid.in(ids), - eqTargetClass(detectedEntity, searchReq.getTargetClass()), - eqCompareClass(detectedEntity, searchReq.getCompareClass()), - containsMapSheetNum(detectedEntity, searchReq.getMapSheetNum())); + queryFactory + .selectFrom(detectedEntity) + .where( + detectedEntity.dataUid.in(ids), + eqTargetClass(detectedEntity, searchReq.getTargetClass()), + eqCompareClass(detectedEntity, searchReq.getCompareClass()), + containsMapSheetNum(detectedEntity, searchReq.getMapSheetNum())); // count long total = query.fetchCount(); @@ -208,11 +209,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - query - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .orderBy(orders.toArray(new OrderSpecifier[0])) - .fetch(); + query + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .orderBy(orders.toArray(new OrderSpecifier[0])) + .fetch(); return new PageImpl<>(content, pageable, total); } @@ -234,19 +235,19 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // ๊ธฐ์ค€๋…„๋„ ๋ถ„๋ฅ˜ if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) { builder.and( - mapSheetAnalDataGeomEntity - .classAfterCd - .toLowerCase() - .eq(searchGeoReq.getTargetClass().toLowerCase())); + mapSheetAnalDataGeomEntity + .classAfterCd + .toLowerCase() + .eq(searchGeoReq.getTargetClass().toLowerCase())); } // ๋น„๊ต๋…„๋„ ๋ถ„๋ฅ˜ if (searchGeoReq.getCompareClass() != null && !searchGeoReq.getCompareClass().equals("")) { builder.and( - mapSheetAnalDataGeomEntity - .classBeforeCd - .toLowerCase() - .eq(searchGeoReq.getCompareClass().toLowerCase())); + mapSheetAnalDataGeomEntity + .classBeforeCd + .toLowerCase() + .eq(searchGeoReq.getCompareClass().toLowerCase())); } // ๋ถ„์„๋„์—ฝ @@ -256,39 +257,39 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - queryFactory - .select( - Projections.constructor( - InferenceResultDto.Geom.class, - mapSheetAnalDataGeomEntity.compareYyyy, - mapSheetAnalDataGeomEntity.targetYyyy, - mapSheetAnalDataGeomEntity.classBeforeCd, - mapSheetAnalDataGeomEntity.classBeforeProb, - mapSheetAnalDataGeomEntity.classAfterCd, - mapSheetAnalDataGeomEntity.classAfterProb, - mapSheetAnalDataGeomEntity.mapSheetNum, - mapSheetAnalDataGeomEntity.geom, - mapSheetAnalDataGeomEntity.geomCenter)) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .join(mapSheetAnalDataGeomEntity) - .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) - .where(builder) - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .fetch(); + queryFactory + .select( + Projections.constructor( + InferenceResultDto.Geom.class, + mapSheetAnalDataGeomEntity.compareYyyy, + mapSheetAnalDataGeomEntity.targetYyyy, + mapSheetAnalDataGeomEntity.classBeforeCd, + mapSheetAnalDataGeomEntity.classBeforeProb, + mapSheetAnalDataGeomEntity.classAfterCd, + mapSheetAnalDataGeomEntity.classAfterProb, + mapSheetAnalDataGeomEntity.mapSheetNum, + mapSheetAnalDataGeomEntity.geom, + mapSheetAnalDataGeomEntity.geomCenter)) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .join(mapSheetAnalDataGeomEntity) + .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) + .where(builder) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .fetch(); long total = - queryFactory - .select(mapSheetAnalDataGeomEntity.id) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .join(mapSheetAnalDataGeomEntity) - .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) - .where(builder) - .fetchCount(); + queryFactory + .select(mapSheetAnalDataGeomEntity.id) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .join(mapSheetAnalDataGeomEntity) + .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) + .where(builder) + .fetchCount(); return new PageImpl<>(content, pageable, total); } @@ -302,16 +303,18 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC @Override public List getSheets(Long id) { return queryFactory - .select(mapSheetAnalDataEntity.mapSheetNum) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .where(mapSheetAnalEntity.id.eq(id)) - .groupBy(mapSheetAnalDataEntity.mapSheetNum) - .fetch(); + .select(mapSheetAnalDataEntity.mapSheetNum) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .where(mapSheetAnalEntity.id.eq(id)) + .groupBy(mapSheetAnalDataEntity.mapSheetNum) + .fetch(); } - /** Pageable์˜ Sort๋ฅผ QueryDSL OrderSpecifier๋กœ ๋ณ€ํ™˜ */ + /** + * Pageable์˜ Sort๋ฅผ QueryDSL OrderSpecifier๋กœ ๋ณ€ํ™˜ + */ @SuppressWarnings({"unchecked", "rawtypes"}) private List> getOrderSpecifiers(Sort sort) { List> orders = new ArrayList<>(); @@ -326,8 +329,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // ์œ ํšจํ•œ ํ•„๋“œ๋งŒ ์ฒ˜๋ฆฌ switch (property) { case "classBeforeCd" -> orders.add(new OrderSpecifier(direction, entity.classBeforeCd)); - case "classBeforeProb" -> - orders.add(new OrderSpecifier(direction, entity.classBeforeProb)); + case "classBeforeProb" -> orders.add(new OrderSpecifier(direction, entity.classBeforeProb)); case "classAfterCd" -> orders.add(new OrderSpecifier(direction, entity.classAfterCd)); case "classAfterProb" -> orders.add(new OrderSpecifier(direction, entity.classAfterProb)); case "mapSheetNum" -> orders.add(new OrderSpecifier(direction, entity.mapSheetNum)); @@ -336,8 +338,9 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC case "area" -> orders.add(new OrderSpecifier(direction, entity.area)); case "createdDttm" -> orders.add(new OrderSpecifier(direction, entity.createdDttm)); case "updatedDttm" -> orders.add(new OrderSpecifier(direction, entity.updatedDttm)); - // ์œ ํšจํ•˜์ง€ ์•Š์€ ํ•„๋“œ๋Š” ๋ฌด์‹œ - default -> {} + // ์œ ํšจํ•˜์ง€ ์•Š์€ ํ•„๋“œ๋Š” ๋ฌด์‹œ + default -> { + } } } } @@ -346,21 +349,21 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } private BooleanExpression eqTargetClass( - QMapSheetAnalDataGeomEntity detectedEntity, String targetClass) { + QMapSheetAnalDataGeomEntity detectedEntity, String targetClass) { return targetClass != null && !targetClass.isEmpty() - ? detectedEntity.classAfterCd.toLowerCase().eq(targetClass.toLowerCase()) - : null; + ? detectedEntity.classAfterCd.toLowerCase().eq(targetClass.toLowerCase()) + : null; } private BooleanExpression eqCompareClass( - QMapSheetAnalDataGeomEntity detectedEntity, String compareClass) { + QMapSheetAnalDataGeomEntity detectedEntity, String compareClass) { return compareClass != null && !compareClass.isEmpty() - ? detectedEntity.classBeforeCd.toLowerCase().eq(compareClass.toLowerCase()) - : null; + ? detectedEntity.classBeforeCd.toLowerCase().eq(compareClass.toLowerCase()) + : null; } private BooleanExpression containsMapSheetNum( - QMapSheetAnalDataGeomEntity detectedEntity, List mapSheet) { + QMapSheetAnalDataGeomEntity detectedEntity, List mapSheet) { if (mapSheet == null || mapSheet.isEmpty()) { return null; } diff --git a/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java b/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java new file mode 100644 index 00000000..b0430975 --- /dev/null +++ b/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java @@ -0,0 +1,68 @@ +package com.kamco.cd.kamcoback.test; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.ErrorResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "test api", description = "test api") +@RestController +@RequiredArgsConstructor +@RequestMapping("/api/test") +public class TestApiController { + + @Operation(summary = "admin test", description = "admin test api") + @ApiResponses({ + @ApiResponse( + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse( + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + }) + @GetMapping("/admin") + public String admin() { + return "I am administrator"; + } + + @Operation(summary = "label test", description = "label test api") + @ApiResponses({ + @ApiResponse( + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse( + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + }) + @GetMapping("/label") + public String label() { + return "Labeling is available."; + } + + @Operation(summary = "review test", description = "review test api") + @ApiResponses({ + @ApiResponse( + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse( + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + }) + @GetMapping("/review") + public String review() { + return "Review is available."; + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 0b2d19f6..2013e5fb 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -38,8 +38,10 @@ spring: jwt: secret: "kamco_token_9b71e778-19a3-4c1d-97bf-2d687de17d5b" - access-token-validity-in-ms: 86400000 # 1์ผ - refresh-token-validity-in-ms: 604800000 # 7์ผ + #access-token-validity-in-ms: 86400000 # 1์ผ + #refresh-token-validity-in-ms: 604800000 # 7์ผ + access-token-validity-in-ms: 60000 # 1๋ถ„ + refresh-token-validity-in-ms: 300000 # 5๋ถ„ token: refresh-cookie-name: kamco-dev # ๊ฐœ๋ฐœ์šฉ ์ฟ ํ‚ค ์ด๋ฆ„ From ce8534cf0f14503303fc6db7d007c84cf67fba6b Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 11 Dec 2025 17:06:36 +0900 Subject: [PATCH 4/4] =?UTF-8?q?test=20api=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C=EC=84=9C=EB=B2=84=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EB=A7=8C=EB=A3=8C=EC=8B=9C=EA=B0=84=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/enums/error/AuthErrorCode.java | 1 - .../cd/kamcoback/members/AuthController.java | 134 ++++---- .../InferenceResultRepositoryImpl.java | 287 +++++++++--------- .../cd/kamcoback/test/TestApiController.java | 36 +-- 4 files changed, 227 insertions(+), 231 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java b/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java index f54478ff..4f5f45dd 100644 --- a/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java +++ b/src/main/java/com/kamco/cd/kamcoback/common/enums/error/AuthErrorCode.java @@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus; @Getter public enum AuthErrorCode implements ErrorCode { - LOGIN_ID_NOT_FOUND("LOGIN_ID_NOT_FOUND", HttpStatus.UNAUTHORIZED), LOGIN_PASSWORD_MISMATCH("LOGIN_PASSWORD_MISMATCH", HttpStatus.UNAUTHORIZED), diff --git a/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java b/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java index a2e21d56..8596df04 100644 --- a/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java +++ b/src/main/java/com/kamco/cd/kamcoback/members/AuthController.java @@ -54,59 +54,59 @@ public class AuthController { @Operation(summary = "๋กœ๊ทธ์ธ", description = "์‚ฌ๋ฒˆ์œผ๋กœ ๋กœ๊ทธ์ธํ•˜์—ฌ ์•ก์„ธ์Šค/๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์„ ๋ฐœ๊ธ‰.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "๋กœ๊ทธ์ธ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = TokenResponse.class))), + responseCode = "200", + description = "๋กœ๊ทธ์ธ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = TokenResponse.class))), @ApiResponse( - responseCode = "401", - description = "๋กœ๊ทธ์ธ ์‹คํŒจ (์•„์ด๋””/๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜, ๊ณ„์ •์ž ๊ธˆ ๋“ฑ)", - content = - @Content( - schema = @Schema(implementation = ErrorResponse.class), - examples = { - @ExampleObject( - name = "์•„์ด๋”” ์ž…๋ ฅ ์˜ค๋ฅ˜", - description = "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์•„์ด๋””", - value = - """ + responseCode = "401", + description = "๋กœ๊ทธ์ธ ์‹คํŒจ (์•„์ด๋””/๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜, ๊ณ„์ •์ž ๊ธˆ ๋“ฑ)", + content = + @Content( + schema = @Schema(implementation = ErrorResponse.class), + examples = { + @ExampleObject( + name = "์•„์ด๋”” ์ž…๋ ฅ ์˜ค๋ฅ˜", + description = "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์•„์ด๋””", + value = + """ { "code": "LOGIN_ID_NOT_FOUND", "message": "์•„์ด๋””๋ฅผ ์ž˜๋ชป ์ž…๋ ฅํ•˜์…จ์Šต๋‹ˆ๋‹ค." } """), - @ExampleObject( - name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ ์˜ค๋ฅ˜ (4ํšŒ ์ดํ•˜)", - description = "์•„์ด๋””๋Š” ์ •์ƒ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ํ‹€๋ฆฐ ๊ฒฝ์šฐ", - value = - """ + @ExampleObject( + name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ ์˜ค๋ฅ˜ (4ํšŒ ์ดํ•˜)", + description = "์•„์ด๋””๋Š” ์ •์ƒ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ํ‹€๋ฆฐ ๊ฒฝ์šฐ", + value = + """ { "code": "LOGIN_PASSWORD_MISMATCH", "message": "๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž˜๋ชป ์ž…๋ ฅํ•˜์…จ์Šต๋‹ˆ๋‹ค." } """), - @ExampleObject( - name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜ ์ดˆ๊ณผ", - description = "๋น„๋ฐ€๋ฒˆํ˜ธ 5ํšŒ ์ด์ƒ ์˜ค๋ฅ˜๋กœ ๊ณ„์ • ์ž ๊น€", - value = - """ + @ExampleObject( + name = "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜ ์ดˆ๊ณผ", + description = "๋น„๋ฐ€๋ฒˆํ˜ธ 5ํšŒ ์ด์ƒ ์˜ค๋ฅ˜๋กœ ๊ณ„์ • ์ž ๊น€", + value = + """ { "code": "LOGIN_PASSWORD_EXCEEDED", "message": "๋น„๋ฐ€๋ฒˆํ˜ธ ์˜ค๋ฅ˜ ํšŸ์ˆ˜๋ฅผ ์ดˆ๊ณผํ•˜์—ฌ ์ด์šฉํ•˜์‹ค ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ์ธ ์˜ค๋ฅ˜์— ๋Œ€ํ•ด ๊ด€๋ฆฌ์ž์—๊ฒŒ ๋ฌธ์˜ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค." } """) - })) + })) }) public ApiResponseDto signin( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "๋กœ๊ทธ์ธ ์š”์ฒญ ์ •๋ณด", - required = true) - @RequestBody - SignInRequest request, - HttpServletResponse response) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "๋กœ๊ทธ์ธ ์š”์ฒญ ์ •๋ณด", + required = true) + @RequestBody + SignInRequest request, + HttpServletResponse response) { Authentication authentication = - authenticationManager.authenticate( - new UsernamePasswordAuthenticationToken(request.getUsername(), request.getPassword())); + authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(request.getUsername(), request.getPassword())); String status = authService.getUserStatus(request); @@ -124,17 +124,17 @@ public class AuthController { // Redis์— RefreshToken ์ €์žฅ (TTL = 7์ผ) refreshTokenService.save( - username, refreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); + username, refreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); // HttpOnly + Secure ์ฟ ํ‚ค์— RefreshToken ์ €์žฅ ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, refreshToken) - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, refreshToken) + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); @@ -153,16 +153,16 @@ public class AuthController { @Operation(summary = "ํ† ํฐ ์žฌ๋ฐœ๊ธ‰", description = "๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์œผ๋กœ ์ƒˆ๋กœ์šด ์•ก์„ธ์Šค/๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ์„ ์žฌ๋ฐœ๊ธ‰ํ•ฉ๋‹ˆ๋‹ค.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "์žฌ๋ฐœ๊ธ‰ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = TokenResponse.class))), + responseCode = "200", + description = "์žฌ๋ฐœ๊ธ‰ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = TokenResponse.class))), @ApiResponse( - responseCode = "403", - description = "๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ", - content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + responseCode = "403", + description = "๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) public ResponseEntity refresh(String refreshToken, HttpServletResponse response) - throws AccessDeniedException { + throws AccessDeniedException { if (refreshToken == null || !jwtTokenProvider.isValidToken(refreshToken)) { throw new AccessDeniedException("๋งŒ๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ ์ž…๋‹ˆ๋‹ค."); } @@ -179,17 +179,17 @@ public class AuthController { // Redis ๊ฐฑ์‹  refreshTokenService.save( - username, newRefreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); + username, newRefreshToken, jwtTokenProvider.getRefreshTokenValidityInMs()); // ์ฟ ํ‚ค ๊ฐฑ์‹  ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, newRefreshToken) - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, newRefreshToken) + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(Duration.ofMillis(jwtTokenProvider.getRefreshTokenValidityInMs())) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); MembersDto.Member member = new MembersDto.Member(); @@ -200,12 +200,12 @@ public class AuthController { @Operation(summary = "๋กœ๊ทธ์•„์›ƒ", description = "ํ˜„์žฌ ์‚ฌ์šฉ์ž์˜ ํ† ํฐ์„ ๋ฌดํšจํ™”(๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ ์‚ญ์ œ)ํ•ฉ๋‹ˆ๋‹ค.") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "๋กœ๊ทธ์•„์›ƒ ์„ฑ๊ณต", - content = @Content(schema = @Schema(implementation = Void.class))) + responseCode = "200", + description = "๋กœ๊ทธ์•„์›ƒ ์„ฑ๊ณต", + content = @Content(schema = @Schema(implementation = Void.class))) }) public ApiResponseDto> logout( - Authentication authentication, HttpServletResponse response) { + Authentication authentication, HttpServletResponse response) { if (authentication != null) { String username = authentication.getName(); // Redis์—์„œ RefreshToken ์‚ญ์ œ @@ -214,13 +214,13 @@ public class AuthController { // ์ฟ ํ‚ค ์‚ญ์ œ (Max-Age=0) ResponseCookie cookie = - ResponseCookie.from(refreshCookieName, "") - .httpOnly(true) - .secure(refreshCookieSecure) - .path("/") - .maxAge(0) - .sameSite("Strict") - .build(); + ResponseCookie.from(refreshCookieName, "") + .httpOnly(true) + .secure(refreshCookieSecure) + .path("/") + .maxAge(0) + .sameSite("Strict") + .build(); response.addHeader(HttpHeaders.SET_COOKIE, cookie.toString()); return ApiResponseDto.createOK(ResponseEntity.noContent().build()); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java index 8421fb08..dfcab8d6 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java @@ -40,11 +40,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity; private final QMapSheetAnalEntity mapSheetAnalEntity = QMapSheetAnalEntity.mapSheetAnalEntity; private final QMapSheetAnalDataEntity mapSheetAnalDataEntity = - QMapSheetAnalDataEntity.mapSheetAnalDataEntity; + QMapSheetAnalDataEntity.mapSheetAnalDataEntity; private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeomEntity = - QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; + QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; private final QMapSheetAnalSttcEntity mapSheetAnalSttcEntity = - QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity; + QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity; /** * ๋ถ„์„๊ฒฐ๊ณผ ๋ชฉ๋ก ์กฐํšŒ @@ -54,7 +54,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC */ @Override public Page getInferenceResultList( - InferenceResultDto.SearchReq searchReq) { + InferenceResultDto.SearchReq searchReq) { Pageable pageable = searchReq.toPageable(); // "0000" ์ „์ฒด์กฐํšŒ BooleanBuilder builder = new BooleanBuilder(); @@ -68,35 +68,35 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - queryFactory - .select( - Projections.constructor( - InferenceResultDto.AnalResList.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, - mapSheetAnalEntity.analMapSheet, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.analState, - Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), - mapSheetAnalEntity.gukyuinUsed)) - .from(mapSheetAnalEntity) - .where(builder) - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .orderBy(mapSheetAnalEntity.id.desc()) - .fetch(); + queryFactory + .select( + Projections.constructor( + InferenceResultDto.AnalResList.class, + mapSheetAnalEntity.id, + mapSheetAnalEntity.analTitle, + mapSheetAnalEntity.analMapSheet, + mapSheetAnalEntity.detectingCnt, + mapSheetAnalEntity.analStrtDttm, + mapSheetAnalEntity.analEndDttm, + mapSheetAnalEntity.analSec, + mapSheetAnalEntity.analPredSec, + mapSheetAnalEntity.analState, + Expressions.stringTemplate( + "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), + mapSheetAnalEntity.gukyuinUsed)) + .from(mapSheetAnalEntity) + .where(builder) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .orderBy(mapSheetAnalEntity.id.desc()) + .fetch(); long total = - queryFactory - .select(mapSheetAnalEntity.id) - .from(mapSheetAnalEntity) - .where(builder) - .fetchCount(); + queryFactory + .select(mapSheetAnalEntity.id) + .from(mapSheetAnalEntity) + .where(builder) + .fetchCount(); return new PageImpl<>(content, pageable, total); } @@ -112,41 +112,40 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // 1. ์ตœ์‹  ๋ฒ„์ „ UID๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์„œ๋ธŒ์ฟผ๋ฆฌ JPQLQuery latestVerUidSub = - JPAExpressions.select(tmv.id.max()).from(tmv).where(tmv.modelUid.eq(tmm.id)); + JPAExpressions.select(tmv.id.max()).from(tmv).where(tmv.modelUid.eq(tmm.id)); Optional content = - Optional.ofNullable( - queryFactory - .select( - Projections.constructor( - InferenceResultDto.AnalResSummary.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, - tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), - mapSheetAnalEntity.targetYyyy, - mapSheetAnalEntity.compareYyyy, - mapSheetAnalEntity.analMapSheet, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.resultUrl, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.accuracy, - mapSheetAnalEntity.analState, - Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) - .from(mapSheetAnalEntity) - .leftJoin(tmm) - .on(mapSheetAnalEntity.modelUid.eq(tmm.id)) - .leftJoin(tmv) - .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) - .where(mapSheetAnalEntity.id.eq(id)) - .fetchOne()); + Optional.ofNullable( + queryFactory + .select( + Projections.constructor( + InferenceResultDto.AnalResSummary.class, + mapSheetAnalEntity.id, + mapSheetAnalEntity.analTitle, + tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), + mapSheetAnalEntity.targetYyyy, + mapSheetAnalEntity.compareYyyy, + mapSheetAnalEntity.analMapSheet, + mapSheetAnalEntity.analStrtDttm, + mapSheetAnalEntity.analEndDttm, + mapSheetAnalEntity.analSec, + mapSheetAnalEntity.analPredSec, + mapSheetAnalEntity.resultUrl, + mapSheetAnalEntity.detectingCnt, + mapSheetAnalEntity.accuracy, + mapSheetAnalEntity.analState, + Expressions.stringTemplate( + "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) + .from(mapSheetAnalEntity) + .leftJoin(tmm) + .on(mapSheetAnalEntity.modelUid.eq(tmm.id)) + .leftJoin(tmv) + .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) + .where(mapSheetAnalEntity.id.eq(id)) + .fetchOne()); return content; } - /** * ๋ถ„์„๊ฒฐ๊ณผ ์ƒ์„ธ class name๋ณ„ ํƒ์ง€ ๊ฐœ์ˆ˜ * @@ -156,16 +155,16 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC @Override public List getDashboard(Long id) { return queryFactory - .select( - Projections.constructor( - Dashboard.class, - mapSheetAnalSttcEntity.id.classAfterCd, - mapSheetAnalSttcEntity.classAfterCnt.sum())) - .from(mapSheetAnalSttcEntity) - .where(mapSheetAnalSttcEntity.id.analUid.eq(id)) - .groupBy(mapSheetAnalSttcEntity.id.classAfterCd) - .orderBy(mapSheetAnalSttcEntity.id.classAfterCd.asc()) - .fetch(); + .select( + Projections.constructor( + Dashboard.class, + mapSheetAnalSttcEntity.id.classAfterCd, + mapSheetAnalSttcEntity.classAfterCnt.sum())) + .from(mapSheetAnalSttcEntity) + .where(mapSheetAnalSttcEntity.id.analUid.eq(id)) + .groupBy(mapSheetAnalSttcEntity.id.classAfterCd) + .orderBy(mapSheetAnalSttcEntity.id.classAfterCd.asc()) + .fetch(); } @Override @@ -182,22 +181,22 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC */ @Override public Page listInferenceResultWithGeom( - List ids, SearchGeoReq searchReq) { + List ids, SearchGeoReq searchReq) { // ๋ถ„์„ ์ฐจ์ˆ˜ QMapSheetAnalDataGeomEntity detectedEntity = - QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; + QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity; Pageable pageable = searchReq.toPageable(); // ๊ฒ€์ƒ‰์กฐ๊ฑด JPAQuery query = - queryFactory - .selectFrom(detectedEntity) - .where( - detectedEntity.dataUid.in(ids), - eqTargetClass(detectedEntity, searchReq.getTargetClass()), - eqCompareClass(detectedEntity, searchReq.getCompareClass()), - containsMapSheetNum(detectedEntity, searchReq.getMapSheetNum())); + queryFactory + .selectFrom(detectedEntity) + .where( + detectedEntity.dataUid.in(ids), + eqTargetClass(detectedEntity, searchReq.getTargetClass()), + eqCompareClass(detectedEntity, searchReq.getCompareClass()), + containsMapSheetNum(detectedEntity, searchReq.getMapSheetNum())); // count long total = query.fetchCount(); @@ -209,11 +208,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - query - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .orderBy(orders.toArray(new OrderSpecifier[0])) - .fetch(); + query + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .orderBy(orders.toArray(new OrderSpecifier[0])) + .fetch(); return new PageImpl<>(content, pageable, total); } @@ -235,19 +234,19 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // ๊ธฐ์ค€๋…„๋„ ๋ถ„๋ฅ˜ if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) { builder.and( - mapSheetAnalDataGeomEntity - .classAfterCd - .toLowerCase() - .eq(searchGeoReq.getTargetClass().toLowerCase())); + mapSheetAnalDataGeomEntity + .classAfterCd + .toLowerCase() + .eq(searchGeoReq.getTargetClass().toLowerCase())); } // ๋น„๊ต๋…„๋„ ๋ถ„๋ฅ˜ if (searchGeoReq.getCompareClass() != null && !searchGeoReq.getCompareClass().equals("")) { builder.and( - mapSheetAnalDataGeomEntity - .classBeforeCd - .toLowerCase() - .eq(searchGeoReq.getCompareClass().toLowerCase())); + mapSheetAnalDataGeomEntity + .classBeforeCd + .toLowerCase() + .eq(searchGeoReq.getCompareClass().toLowerCase())); } // ๋ถ„์„๋„์—ฝ @@ -257,39 +256,39 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } List content = - queryFactory - .select( - Projections.constructor( - InferenceResultDto.Geom.class, - mapSheetAnalDataGeomEntity.compareYyyy, - mapSheetAnalDataGeomEntity.targetYyyy, - mapSheetAnalDataGeomEntity.classBeforeCd, - mapSheetAnalDataGeomEntity.classBeforeProb, - mapSheetAnalDataGeomEntity.classAfterCd, - mapSheetAnalDataGeomEntity.classAfterProb, - mapSheetAnalDataGeomEntity.mapSheetNum, - mapSheetAnalDataGeomEntity.geom, - mapSheetAnalDataGeomEntity.geomCenter)) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .join(mapSheetAnalDataGeomEntity) - .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) - .where(builder) - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .fetch(); + queryFactory + .select( + Projections.constructor( + InferenceResultDto.Geom.class, + mapSheetAnalDataGeomEntity.compareYyyy, + mapSheetAnalDataGeomEntity.targetYyyy, + mapSheetAnalDataGeomEntity.classBeforeCd, + mapSheetAnalDataGeomEntity.classBeforeProb, + mapSheetAnalDataGeomEntity.classAfterCd, + mapSheetAnalDataGeomEntity.classAfterProb, + mapSheetAnalDataGeomEntity.mapSheetNum, + mapSheetAnalDataGeomEntity.geom, + mapSheetAnalDataGeomEntity.geomCenter)) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .join(mapSheetAnalDataGeomEntity) + .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) + .where(builder) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .fetch(); long total = - queryFactory - .select(mapSheetAnalDataGeomEntity.id) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .join(mapSheetAnalDataGeomEntity) - .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) - .where(builder) - .fetchCount(); + queryFactory + .select(mapSheetAnalDataGeomEntity.id) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .join(mapSheetAnalDataGeomEntity) + .on(mapSheetAnalDataGeomEntity.dataUid.eq(mapSheetAnalDataEntity.id)) + .where(builder) + .fetchCount(); return new PageImpl<>(content, pageable, total); } @@ -303,18 +302,16 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC @Override public List getSheets(Long id) { return queryFactory - .select(mapSheetAnalDataEntity.mapSheetNum) - .from(mapSheetAnalEntity) - .join(mapSheetAnalDataEntity) - .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) - .where(mapSheetAnalEntity.id.eq(id)) - .groupBy(mapSheetAnalDataEntity.mapSheetNum) - .fetch(); + .select(mapSheetAnalDataEntity.mapSheetNum) + .from(mapSheetAnalEntity) + .join(mapSheetAnalDataEntity) + .on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id)) + .where(mapSheetAnalEntity.id.eq(id)) + .groupBy(mapSheetAnalDataEntity.mapSheetNum) + .fetch(); } - /** - * Pageable์˜ Sort๋ฅผ QueryDSL OrderSpecifier๋กœ ๋ณ€ํ™˜ - */ + /** Pageable์˜ Sort๋ฅผ QueryDSL OrderSpecifier๋กœ ๋ณ€ํ™˜ */ @SuppressWarnings({"unchecked", "rawtypes"}) private List> getOrderSpecifiers(Sort sort) { List> orders = new ArrayList<>(); @@ -329,7 +326,8 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC // ์œ ํšจํ•œ ํ•„๋“œ๋งŒ ์ฒ˜๋ฆฌ switch (property) { case "classBeforeCd" -> orders.add(new OrderSpecifier(direction, entity.classBeforeCd)); - case "classBeforeProb" -> orders.add(new OrderSpecifier(direction, entity.classBeforeProb)); + case "classBeforeProb" -> + orders.add(new OrderSpecifier(direction, entity.classBeforeProb)); case "classAfterCd" -> orders.add(new OrderSpecifier(direction, entity.classAfterCd)); case "classAfterProb" -> orders.add(new OrderSpecifier(direction, entity.classAfterProb)); case "mapSheetNum" -> orders.add(new OrderSpecifier(direction, entity.mapSheetNum)); @@ -338,9 +336,8 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC case "area" -> orders.add(new OrderSpecifier(direction, entity.area)); case "createdDttm" -> orders.add(new OrderSpecifier(direction, entity.createdDttm)); case "updatedDttm" -> orders.add(new OrderSpecifier(direction, entity.updatedDttm)); - // ์œ ํšจํ•˜์ง€ ์•Š์€ ํ•„๋“œ๋Š” ๋ฌด์‹œ - default -> { - } + // ์œ ํšจํ•˜์ง€ ์•Š์€ ํ•„๋“œ๋Š” ๋ฌด์‹œ + default -> {} } } } @@ -349,21 +346,21 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC } private BooleanExpression eqTargetClass( - QMapSheetAnalDataGeomEntity detectedEntity, String targetClass) { + QMapSheetAnalDataGeomEntity detectedEntity, String targetClass) { return targetClass != null && !targetClass.isEmpty() - ? detectedEntity.classAfterCd.toLowerCase().eq(targetClass.toLowerCase()) - : null; + ? detectedEntity.classAfterCd.toLowerCase().eq(targetClass.toLowerCase()) + : null; } private BooleanExpression eqCompareClass( - QMapSheetAnalDataGeomEntity detectedEntity, String compareClass) { + QMapSheetAnalDataGeomEntity detectedEntity, String compareClass) { return compareClass != null && !compareClass.isEmpty() - ? detectedEntity.classBeforeCd.toLowerCase().eq(compareClass.toLowerCase()) - : null; + ? detectedEntity.classBeforeCd.toLowerCase().eq(compareClass.toLowerCase()) + : null; } private BooleanExpression containsMapSheetNum( - QMapSheetAnalDataGeomEntity detectedEntity, List mapSheet) { + QMapSheetAnalDataGeomEntity detectedEntity, List mapSheet) { if (mapSheet == null || mapSheet.isEmpty()) { return null; } diff --git a/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java b/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java index b0430975..ca2dfe53 100644 --- a/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/test/TestApiController.java @@ -21,13 +21,13 @@ public class TestApiController { @Operation(summary = "admin test", description = "admin test api") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "์กฐํšŒ", - content = @Content(schema = @Schema(implementation = String.class))), + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse( - responseCode = "403", - description = "๊ถŒํ•œ ์—†์Œ", - content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) @GetMapping("/admin") public String admin() { @@ -37,13 +37,13 @@ public class TestApiController { @Operation(summary = "label test", description = "label test api") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "์กฐํšŒ", - content = @Content(schema = @Schema(implementation = String.class))), + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse( - responseCode = "403", - description = "๊ถŒํ•œ ์—†์Œ", - content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) @GetMapping("/label") public String label() { @@ -53,13 +53,13 @@ public class TestApiController { @Operation(summary = "review test", description = "review test api") @ApiResponses({ @ApiResponse( - responseCode = "200", - description = "์กฐํšŒ", - content = @Content(schema = @Schema(implementation = String.class))), + responseCode = "200", + description = "์กฐํšŒ", + content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse( - responseCode = "403", - description = "๊ถŒํ•œ ์—†์Œ", - content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + responseCode = "403", + description = "๊ถŒํ•œ ์—†์Œ", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) @GetMapping("/review") public String review() {