Skip to content

Commit

Permalink
[POT-80][Fix] 포트홀 생성 RequestDTO 원복
Browse files Browse the repository at this point in the history
  • Loading branch information
jjunsik committed Oct 22, 2024
1 parent 559d91d commit f32d09f
Showing 1 changed file with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,35 @@
import pothole_solution.core.domain.pothole.entity.Pothole;
import pothole_solution.core.domain.pothole.entity.Progress;

import java.util.Random;

@Getter
@NoArgsConstructor
public class ReqPotRegPotMngrServDto {
private String roadName = "None";

@NotNull(message = "위도의 값은 반드시 존재해야 합니다.")
private double lat;

@NotNull(message = "경도의 값은 반드시 존재해야 합니다.")
private double lon;

private Integer dangerous;

private Integer importance;

@Builder
public ReqPotRegPotMngrServDto(String roadName, double lat, double lon, Integer dangerous, Integer importance) {
if (roadName != null) {
this.roadName = roadName;
}

public ReqPotRegPotMngrServDto(double lat, double lon) {
this.lat = lat;
this.lon = lon;
this.importance = importance;
this.dangerous = dangerous;
}

public Pothole toPothole() {
GeometryFactory geometryFactory = new GeometryFactory();

Integer randomImportance = new Random().nextInt(101);
Integer randomDangerous = new Random().nextInt(101);

return Pothole.builder()
.roadName(roadName)
.roadName("강남로 1")
.point(geometryFactory.createPoint(new Coordinate(lon, lat)))
.importance(importance)
.dangerous(dangerous)
.importance(randomImportance)
.dangerous(randomDangerous)
.processStatus(Progress.REGISTER)
.build();
}
}
}

0 comments on commit f32d09f

Please sign in to comment.