فهرست منبع

update content-service/geo

reghao 7 ماه پیش
والد
کامیت
c687f166e6

+ 4 - 0
content/content-api/src/main/java/cn/reghao/tnb/content/api/dto/geo/MallReplyDto.java

@@ -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 {

+ 0 - 2
content/content-api/src/main/java/cn/reghao/tnb/content/api/dto/geo/MallReplyPhotoDto.java

@@ -30,9 +30,7 @@ public class MallReplyPhotoDto implements Serializable {
     private String model;
     private String software;
     private String shotAt;
-    @NotNull
     private Double longitude;
-    @NotNull
     private Double latitude;
 
     public MallReplyPhotoDto(String replyId, String uploadId, int channelId, String photoUrl) {

+ 7 - 2
content/content-service/src/main/java/cn/reghao/tnb/content/app/geo/model/po/CameraPhoto.java

@@ -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());
+        }
     }
 }