feat: add redis
This commit is contained in:
@@ -17,6 +17,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TestDto {
|
||||
|
||||
private Long id;
|
||||
private Geometry polygon;
|
||||
private Double centroidX;
|
||||
@@ -29,6 +30,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CountDto {
|
||||
|
||||
private String classCd; // 영문코드
|
||||
private String className; // 한글명
|
||||
private Long count; // 건수
|
||||
@@ -40,6 +42,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogUrlReq {
|
||||
|
||||
private Integer beforeYear;
|
||||
private Integer afterYear;
|
||||
private String mapSheetNum;
|
||||
@@ -51,6 +54,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogUrlDto {
|
||||
|
||||
private String beforeCogUrl;
|
||||
private String afterCogUrl;
|
||||
private Geometry bbox;
|
||||
@@ -62,6 +66,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class AnalYearList {
|
||||
|
||||
private Long analUid;
|
||||
private String analTitle;
|
||||
private Integer beforeYear;
|
||||
@@ -75,6 +80,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MapSheetList {
|
||||
|
||||
private String mapSheetNum;
|
||||
private String mapSheetName;
|
||||
private String alias;
|
||||
@@ -86,6 +92,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PolygonFeatureList {
|
||||
|
||||
private String type;
|
||||
private List<PolygonFeature> features; // Point 값
|
||||
}
|
||||
@@ -96,6 +103,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PointFeatureList {
|
||||
|
||||
private String type;
|
||||
private List<PointFeature> features; // Point 값
|
||||
}
|
||||
@@ -106,6 +114,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PolygonFeature {
|
||||
|
||||
private String type;
|
||||
private JsonNode geometry; // after 분류
|
||||
private PolygonProperties properties; //
|
||||
@@ -117,6 +126,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PolygonQueryData {
|
||||
|
||||
private String type;
|
||||
private String geometry; // geoJson String
|
||||
private Long geoUid;
|
||||
@@ -135,6 +145,7 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PointFeature {
|
||||
|
||||
private String type;
|
||||
private Geometry geometry; // point
|
||||
private PointProperties properties; // Point 정보
|
||||
@@ -146,14 +157,18 @@ public class ChangeDetectionDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PointProperties {
|
||||
|
||||
private Long geoUid;
|
||||
private String classCd; // after 분류
|
||||
}
|
||||
|
||||
@Schema(name = "PolygonProperties", description = "폴리곤 정보")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PolygonProperties {
|
||||
|
||||
private Long geoUid;
|
||||
private Double area; // 면적
|
||||
private Integer beforeYear; // 기준년도
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ChangeDetectionCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -34,11 +35,14 @@ public class ChangeDetectionService {
|
||||
return changeDetectionCoreService.getChangeDetectionYearList();
|
||||
}
|
||||
|
||||
@Cacheable(value = "changeDetectionPolygon", key = "#analUid + '_' + #mapSheetNum")
|
||||
public ChangeDetectionDto.PolygonFeatureList getChangeDetectionPolygonList(
|
||||
Long analUid, String mapSheetNum) {
|
||||
|
||||
return changeDetectionCoreService.getChangeDetectionPolygonList(analUid, mapSheetNum);
|
||||
}
|
||||
|
||||
// Geometry 객체 순환 참조 문제로 캐싱 불가
|
||||
public ChangeDetectionDto.PointFeatureList getChangeDetectionPointList(
|
||||
Long analUid, String mapSheetNum) {
|
||||
return changeDetectionCoreService.getChangeDetectionPointList(analUid, mapSheetNum);
|
||||
|
||||
Reference in New Issue
Block a user