From 1fb74a53c75dd4f9c333f20fc221b92b0a6fecfd Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 27 Nov 2025 16:59:09 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80,=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cd/kamcoback/auth/AuthApiController.java | 172 +++++++++--------- .../kamco/cd/kamcoback/auth/dto/AuthDto.java | 40 ++-- .../ChangeDetectionApiController.java | 6 +- .../dto/ChangeDetectionDto.java | 47 ++--- .../service/ChangeDetectionService.java | 2 +- .../postgres/core/AuthCoreService.java | 31 ++-- .../core/ChangeDetectionCoreService.java | 21 ++- .../entity/MapSheetAnalDataEntity.java | 4 - .../kamcoback/postgres/entity/UserEntity.java | 35 ++-- .../repository/auth/AuthRepositoryImpl.java | 39 ++-- .../ChangeDetectionRepositoryImpl.java | 12 +- 11 files changed, 204 insertions(+), 205 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/auth/AuthApiController.java b/src/main/java/com/kamco/cd/kamcoback/auth/AuthApiController.java index a718a490..6ae7033c 100644 --- a/src/main/java/com/kamco/cd/kamcoback/auth/AuthApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/auth/AuthApiController.java @@ -33,127 +33,119 @@ public class AuthApiController { @Operation(summary = "관리자 등록", description = "관리자를 등록 합니다.") @ApiResponses( - value = { - @ApiResponse( - responseCode = "201", - description = "관리자 등록 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Long.class))), - @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "201", + description = "관리자 등록 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Long.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @PostMapping("/save") public ApiResponseDto save( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "관리자 정보", - required = true, - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = AuthDto.SaveReq.class))) - @RequestBody - @Valid - AuthDto.SaveReq saveReq) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "관리자 정보", + required = true, + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = AuthDto.SaveReq.class))) + @RequestBody + @Valid + AuthDto.SaveReq saveReq) { return ApiResponseDto.createOK(authService.save(saveReq).getId()); } @Operation(summary = "관리자 정보 수정", description = "관리자 정보를 수정 합니다.") @ApiResponses( - value = { - @ApiResponse( - responseCode = "201", - description = "관리자 정보 수정 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Long.class))), - @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "201", + description = "관리자 정보 수정 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Long.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @PutMapping("/update/{id}") - public ApiResponseDto update( - @PathVariable - Long id, - @RequestBody - AuthDto.SaveReq saveReq - ) { + public ApiResponseDto update(@PathVariable Long id, @RequestBody AuthDto.SaveReq saveReq) { return ApiResponseDto.createOK(authService.update(id, saveReq).getId()); } @Operation(summary = "관리자 정보 탈퇴처리", description = "관리자 정보를 탈퇴처리 합니다.") @ApiResponses( - value = { - @ApiResponse( - responseCode = "201", - description = "관리자 탈퇴처리 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Long.class))), - @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "201", + description = "관리자 탈퇴처리 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Long.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @PutMapping("/withdrawal/{id}") public ApiResponseDto withdrawal(@PathVariable Long id) { return ApiResponseDto.deleteOk(authService.withdrawal(id).getId()); } - @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "조회 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = AuthDto.Basic.class))), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "조회 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = AuthDto.Basic.class))), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @Operation(summary = "관리자 상세조회", description = "관리자 정보를 조회 합니다.") @GetMapping("/detail") public ApiResponseDto getDetail( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "관리자 목록 id", - required = true) - @RequestParam - Long id) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "관리자 목록 id", + required = true) + @RequestParam + Long id) { return ApiResponseDto.ok(authService.getFindUserById(id)); } @Operation(summary = "관리자 목록", description = "관리자 목록 조회") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "검색 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Page.class))), - @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "검색 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Page.class))), + @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/list") public ApiResponseDto> getUserList( - @Parameter(description = "관리자 이름") - @RequestParam(required = false) String userNm, - @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") - @RequestParam(defaultValue = "0") int page, - @Parameter(description = "페이지 크기", example = "20") - @RequestParam(defaultValue = "20") int size, - @Parameter(description = "정렬 조건 (형식: 필드명,방향)", example = "name,asc") - @RequestParam(required = false) String sort - ) { + @Parameter(description = "관리자 이름") @RequestParam(required = false) String userNm, + @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0") + int page, + @Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20") + int size, + @Parameter(description = "정렬 조건 (형식: 필드명,방향)", example = "name,asc") + @RequestParam(required = false) + String sort) { AuthDto.SearchReq searchReq = new AuthDto.SearchReq(userNm, page, size, sort); Page userList = authService.getUserList(searchReq); return ApiResponseDto.ok(userList); } - } diff --git a/src/main/java/com/kamco/cd/kamcoback/auth/dto/AuthDto.java b/src/main/java/com/kamco/cd/kamcoback/auth/dto/AuthDto.java index 969c42a6..939ff27b 100644 --- a/src/main/java/com/kamco/cd/kamcoback/auth/dto/AuthDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/auth/dto/AuthDto.java @@ -26,10 +26,16 @@ public class AuthDto { private String userId; private String empId; private String userEmail; - @JsonFormatDttm - private ZonedDateTime createdDttm; + @JsonFormatDttm private ZonedDateTime createdDttm; - public Basic(Long id, String userAuth, String userNm, String userId, String empId, String userEmail, ZonedDateTime createdDttm) { + public Basic( + Long id, + String userAuth, + String userNm, + String userId, + String empId, + String userEmail, + ZonedDateTime createdDttm) { this.id = id; this.userAuth = userAuth; this.userNm = userNm; @@ -70,12 +76,12 @@ public class AuthDto { private String userEmail; public SaveReq( - String userAuth, - String userNm, - String userId, - String userPw, - String empId, - String userEmail) { + String userAuth, + String userNm, + String userId, + String userPw, + String empId, + String userEmail) { this.userAuth = userAuth; this.userNm = userNm; this.userId = userId; @@ -119,13 +125,13 @@ public class AuthDto { private String userEmail; public UpdateReq( - Long id, - String userAuth, - String userNm, - String userId, - String userPw, - String empId, - String userEmail) { + Long id, + String userAuth, + String userNm, + String userId, + String userPw, + String empId, + String userEmail) { this.id = id; this.userAuth = userAuth; this.userNm = userNm; @@ -163,7 +169,7 @@ public class AuthDto { String[] sortParams = sort.split(","); String property = sortParams[0]; Sort.Direction direction = - sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC; + sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC; return PageRequest.of(page, size, Sort.by(direction, property)); } return PageRequest.of(page, size); diff --git a/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java b/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java index 5e387fcf..9f8766cd 100644 --- a/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java @@ -7,13 +7,12 @@ import com.kamco.cd.kamcoback.config.api.ApiResponseDto; import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.transaction.Transactional; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - @Tag(name = "변화탐지", description = "변화탐지 API") @RequiredArgsConstructor @RestController @@ -32,10 +31,11 @@ public class ChangeDetectionApiController { /** * PolygonData -> JsonNode 변환 예제 + * * @return */ @GetMapping("/json-data") - public ApiResponseDto> getPolygonToJson(){ + public ApiResponseDto> getPolygonToJson() { return ApiResponseDto.ok(changeDetectionService.getPolygonToJson()); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/changedetection/dto/ChangeDetectionDto.java b/src/main/java/com/kamco/cd/kamcoback/changedetection/dto/ChangeDetectionDto.java index cb3c971e..8d67eb07 100644 --- a/src/main/java/com/kamco/cd/kamcoback/changedetection/dto/ChangeDetectionDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/changedetection/dto/ChangeDetectionDto.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; import lombok.Setter; import org.locationtech.jts.geom.Geometry; -public class ChangeDetectionDto{ +public class ChangeDetectionDto { @Schema(name = "TestDto", description = "테스트용") @Getter @@ -17,7 +17,8 @@ public class ChangeDetectionDto{ public static class TestDto { private Long id; private Geometry polygon; - private Double centroidX;; + private Double centroidX; + ; private Double centroidY; } @@ -26,12 +27,12 @@ public class ChangeDetectionDto{ @Setter @NoArgsConstructor @AllArgsConstructor - public static class PointGeometry{ + public static class PointGeometry { private Long geoUid; - private String type; // "Point" - private Geometry coordinates; //Point 값 - private String before_class; //기준 분류 - private String after_class; //비교 분류 + private String type; // "Point" + private Geometry coordinates; // Point 값 + private String before_class; // 기준 분류 + private String after_class; // 비교 분류 } @Schema(name = "PolygonGeometry", description = "폴리곤 리턴 객체") @@ -39,12 +40,12 @@ public class ChangeDetectionDto{ @Setter @NoArgsConstructor @AllArgsConstructor - public static class PolygonGeometry{ + public static class PolygonGeometry { private Long geoUid; - private String type; // "MultiPolygon" - private Geometry coordinates; //Polygon 값 - private Double center_latitude; //폴리곤 중심 위도 - private Double center_longitude; //폴리곤 중심 경도 + private String type; // "MultiPolygon" + private Geometry coordinates; // Polygon 값 + private Double center_latitude; // 폴리곤 중심 위도 + private Double center_longitude; // 폴리곤 중심 경도 } @Schema(name = "CogURL", description = "COG URL") @@ -52,9 +53,9 @@ public class ChangeDetectionDto{ @Setter @NoArgsConstructor @AllArgsConstructor - public static class CogURL{ - private String before_cog_url; //기준 COG URL - private String after_cog_url; //비교 COG URL + public static class CogURL { + private String before_cog_url; // 기준 COG URL + private String after_cog_url; // 비교 COG URL } @Schema(name = "PolygonProperties", description = "폴리곤 정보") @@ -62,13 +63,13 @@ public class ChangeDetectionDto{ @Setter @NoArgsConstructor @AllArgsConstructor - public static class PolygonProperties{ - private Double area; //면적 - private String before_year; //기준년도 - private Double before_confidence; //기준 신뢰도(확률) - private String before_class; //기준 분류 - private String after_year; //비교년도 - private Double after_confidence; //비교 신뢰도(확률) - private String after_class; //비교 분류 + public static class PolygonProperties { + private Double area; // 면적 + private String before_year; // 기준년도 + private Double before_confidence; // 기준 신뢰도(확률) + private String before_class; // 기준 분류 + private String after_year; // 비교년도 + private Double after_confidence; // 비교 신뢰도(확률) + private String after_class; // 비교 분류 } } diff --git a/src/main/java/com/kamco/cd/kamcoback/changedetection/service/ChangeDetectionService.java b/src/main/java/com/kamco/cd/kamcoback/changedetection/service/ChangeDetectionService.java index 48a365dd..c02c0f76 100644 --- a/src/main/java/com/kamco/cd/kamcoback/changedetection/service/ChangeDetectionService.java +++ b/src/main/java/com/kamco/cd/kamcoback/changedetection/service/ChangeDetectionService.java @@ -17,7 +17,7 @@ public class ChangeDetectionService { return changeDetectionCoreService.getPolygonToPoint(); } - public List getPolygonToJson(){ + public List getPolygonToJson() { return changeDetectionCoreService.getPolygonToJson(); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/AuthCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/AuthCoreService.java index 1f364d35..72c55c89 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/AuthCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/AuthCoreService.java @@ -27,15 +27,15 @@ public class AuthCoreService { new EntityNotFoundException("중복된 아이디가 있습니다. " + saveReq.getUserId()); } - UserEntity userEntity = new UserEntity( - null, - saveReq.getUserAuth(), - saveReq.getUserNm(), - saveReq.getUserId(), - saveReq.getEmpId(), - saveReq.getUserEmail(), - saveReq.getUserPw() - ); + UserEntity userEntity = + new UserEntity( + null, + saveReq.getUserAuth(), + saveReq.getUserNm(), + saveReq.getUserId(), + saveReq.getEmpId(), + saveReq.getUserEmail(), + saveReq.getUserPw()); return authRepository.save(userEntity); } @@ -48,8 +48,8 @@ public class AuthCoreService { * @return */ public UserEntity update(Long id, AuthDto.SaveReq saveReq) { - UserEntity userEntity = authRepository.findById(id) - .orElseThrow(() -> new RuntimeException("유저가 존재하지 않습니다.")); + UserEntity userEntity = + authRepository.findById(id).orElseThrow(() -> new RuntimeException("유저가 존재하지 않습니다.")); if (saveReq.getUserAuth() != null) { userEntity.setUserAuth(saveReq.getUserAuth()); @@ -85,8 +85,8 @@ public class AuthCoreService { * @return */ public UserEntity withdrawal(Long id) { - UserEntity userEntity = authRepository.findById(id) - .orElseThrow(() -> new RuntimeException("유저가 존재하지 않습니다.")); + UserEntity userEntity = + authRepository.findById(id).orElseThrow(() -> new RuntimeException("유저가 존재하지 않습니다.")); userEntity.setId(id); userEntity.setDateWithdrawal(ZonedDateTime.now()); @@ -102,7 +102,10 @@ public class AuthCoreService { * @return */ public AuthDto.Basic findUserById(Long id) { - UserEntity entity = authRepository.findUserById(id).orElseThrow(() -> new EntityNotFoundException("관리자를 찾을 수 없습니다. " + id)); + UserEntity entity = + authRepository + .findUserById(id) + .orElseThrow(() -> new EntityNotFoundException("관리자를 찾을 수 없습니다. " + id)); return entity.toDto(); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/ChangeDetectionCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/ChangeDetectionCoreService.java index 491137b7..b86c0f1d 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/ChangeDetectionCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/ChangeDetectionCoreService.java @@ -29,7 +29,8 @@ public class ChangeDetectionCoreService { // 중심 좌표 계산 Point centroid = polygon.getCentroid(); - return new ChangeDetectionDto.TestDto(p.getId(), polygon, centroid.getX(), centroid.getY()); + return new ChangeDetectionDto.TestDto( + p.getId(), polygon, centroid.getX(), centroid.getY()); }) .collect(Collectors.toList()); } @@ -39,14 +40,14 @@ public class ChangeDetectionCoreService { ObjectMapper mapper = new ObjectMapper(); return list.stream() - .map( - s -> { - try { - return mapper.readTree(s); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - }) - .collect(Collectors.toList()); + .map( + s -> { + try { + return mapper.readTree(s); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + }) + .collect(Collectors.toList()); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataEntity.java b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataEntity.java index 78f04515..5e5cb36e 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataEntity.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataEntity.java @@ -10,12 +10,9 @@ import jakarta.persistence.Table; import jakarta.validation.constraints.Size; import java.time.OffsetDateTime; import java.time.ZonedDateTime; -import java.util.Map; import lombok.Getter; import lombok.Setter; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.type.SqlTypes; @Getter @Setter @@ -149,5 +146,4 @@ public class MapSheetAnalDataEntity { @Column(name = "ref_map_sheet_num") private Long refMapSheetNum; - } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/UserEntity.java b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/UserEntity.java index c0f2469c..1e09d023 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/UserEntity.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/UserEntity.java @@ -23,16 +23,16 @@ import org.hibernate.annotations.ColumnDefault; @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table( - name = "tb_user", - uniqueConstraints = {@UniqueConstraint(name = "ux_tb_user_user_id", columnNames = "user_id")}) + name = "tb_user", + uniqueConstraints = {@UniqueConstraint(name = "ux_tb_user_user_id", columnNames = "user_id")}) public class UserEntity { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_user_id_gen") @SequenceGenerator( - name = "tb_user_id_gen", - sequenceName = "tb_user_user_uid_seq", - allocationSize = 1) + name = "tb_user_id_gen", + sequenceName = "tb_user_user_uid_seq", + allocationSize = 1) @Column(name = "user_uid", nullable = false) private Long id; @@ -88,7 +88,14 @@ public class UserEntity { @Column(name = "emp_id", nullable = false) private String empId; - public UserEntity(Long id, String userAuth, String userNm, String userId, String empId, String userEmail, String userPw) { + public UserEntity( + Long id, + String userAuth, + String userNm, + String userId, + String empId, + String userEmail, + String userPw) { this.id = id; this.userAuth = userAuth; this.userNm = userNm; @@ -100,14 +107,12 @@ public class UserEntity { public AuthDto.Basic toDto() { return new AuthDto.Basic( - this.id, - this.userAuth, - this.userNm, - this.userId, - this.empId, - this.userEmail, - this.createdDttm - ); - + this.id, + this.userAuth, + this.userNm, + this.userId, + this.empId, + this.userEmail, + this.createdDttm); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/auth/AuthRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/auth/AuthRepositoryImpl.java index 85aec762..c386e70e 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/auth/AuthRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/auth/AuthRepositoryImpl.java @@ -23,7 +23,6 @@ public class AuthRepositoryImpl implements AuthRepositoryCustom { private final JPAQueryFactory queryFactory; private final QUserEntity userEntity = QUserEntity.userEntity; - /** * 유저 아이디로 조회 * @@ -33,7 +32,7 @@ public class AuthRepositoryImpl implements AuthRepositoryCustom { @Override public Optional findByUserId(String userId) { return Optional.ofNullable( - queryFactory.selectFrom(userEntity).where(userEntity.userId.eq(userId)).fetchOne()); + queryFactory.selectFrom(userEntity).where(userEntity.userId.eq(userId)).fetchOne()); } /** @@ -45,7 +44,7 @@ public class AuthRepositoryImpl implements AuthRepositoryCustom { @Override public Optional findUserById(Long id) { return Optional.ofNullable( - queryFactory.selectFrom(userEntity).where(userEntity.id.eq(id)).fetchOne()); + queryFactory.selectFrom(userEntity).where(userEntity.id.eq(id)).fetchOne()); } /** @@ -63,25 +62,23 @@ public class AuthRepositoryImpl implements AuthRepositoryCustom { } List content = - queryFactory - .select(Projections.constructor(AuthDto.Basic.class, - userEntity.id, - userEntity.userAuth, - userEntity.userNm, - userEntity.userId, - userEntity.empId, - userEntity.userEmail, - userEntity.createdDttm - )) - .from(userEntity) - .where( - builder - ) - .orderBy(userEntity.userId.asc()) - .fetch(); + queryFactory + .select( + Projections.constructor( + AuthDto.Basic.class, + userEntity.id, + userEntity.userAuth, + userEntity.userNm, + userEntity.userId, + userEntity.empId, + userEntity.userEmail, + userEntity.createdDttm)) + .from(userEntity) + .where(builder) + .orderBy(userEntity.userId.asc()) + .fetch(); - long total = - queryFactory.select(userEntity.id).from(userEntity).where(builder).fetchCount(); + long total = queryFactory.select(userEntity.id).from(userEntity).where(builder).fetchCount(); return new PageImpl<>(content, pageable, total); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/changedetection/ChangeDetectionRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/changedetection/ChangeDetectionRepositoryImpl.java index 4ec6e2f8..65e4d581 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/changedetection/ChangeDetectionRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/changedetection/ChangeDetectionRepositoryImpl.java @@ -25,13 +25,11 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport } @Override - public List findPolygonJson(){ + public List findPolygonJson() { return queryFactory - .select( - Expressions.stringTemplate("ST_AsGeoJSON({0})", mapSheetAnalDataGeomEntity.geom) - ) - .from(mapSheetAnalDataGeomEntity) - .orderBy(mapSheetAnalDataGeomEntity.id.desc()) - .fetch(); + .select(Expressions.stringTemplate("ST_AsGeoJSON({0})", mapSheetAnalDataGeomEntity.geom)) + .from(mapSheetAnalDataGeomEntity) + .orderBy(mapSheetAnalDataGeomEntity.id.desc()) + .fetch(); } }