@@ -1,6 +1,8 @@
package cn.reghao.tnb.content.api.dto.geo;
+import lombok.AllArgsConstructor;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@@ -13,6 +15,8 @@ import java.util.List;
* @author reghao
* @date 2023-09-01 09:09:35
*/
+@AllArgsConstructor
+@NoArgsConstructor
@Setter
@Getter
public class MallReplyDto implements Serializable {
@@ -30,9 +30,7 @@ public class MallReplyPhotoDto implements Serializable {
private String model;
private String software;
private String shotAt;
- @NotNull
private Double longitude;
private Double latitude;
public MallReplyPhotoDto(String replyId, String uploadId, int channelId, String photoUrl) {
@@ -38,7 +38,12 @@ public class CameraPhoto extends BaseObject<Integer> {
this.manufacturer = mallReplyPhotoDto.getManufacturer();
this.model = mallReplyPhotoDto.getModel();
this.software = mallReplyPhotoDto.getSoftware();
- this.longitude = BigDecimal.valueOf(mallReplyPhotoDto.getLongitude());
- this.latitude = BigDecimal.valueOf(mallReplyPhotoDto.getLatitude());
+ if (mallReplyPhotoDto.getLongitude() != null) {
+ this.longitude = BigDecimal.valueOf(mallReplyPhotoDto.getLongitude());
+ }
+
+ if (mallReplyPhotoDto.getLatitude() != null) {
+ this.latitude = BigDecimal.valueOf(mallReplyPhotoDto.getLatitude());
}