Merge branch 'jackson'

This commit is contained in:
2025-07-27 14:23:21 +08:00
46 changed files with 805 additions and 254 deletions

View File

@@ -1,6 +1,7 @@
package com.ycwl.basic.model.pc.device.entity;
import com.alibaba.fastjson.JSON;
import com.ycwl.basic.utils.JacksonUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@@ -73,10 +74,10 @@ public class DeviceConfigEntity {
return Collections.singletonList(new DeviceCropConfig());
}
if (StringUtils.startsWith(cropConfig, "{")) {
return Collections.singletonList(JSON.parseObject(cropConfig, DeviceCropConfig.class));
return Collections.singletonList(JacksonUtil.parseObject(cropConfig, DeviceCropConfig.class));
}
if (StringUtils.startsWith(cropConfig, "[")) {
return JSON.parseArray(cropConfig, DeviceCropConfig.class);
return JacksonUtil.parseObject(cropConfig, new TypeReference<List<DeviceCropConfig>>() {});
}
return Collections.singletonList(new DeviceCropConfig());
}

View File

@@ -1,7 +1,7 @@
package com.ycwl.basic.model.pc.faceDetectLog.entity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ycwl.basic.utils.JacksonUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.aliyuncs.facebody.model.v20191230.SearchFaceRequest;
import com.aliyuncs.facebody.model.v20191230.SearchFaceResponse;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -54,7 +54,7 @@ public class FaceDetectLog {
}
public FaceDetectLog fillResponse(Object response) {
this.matchRawResult = JSONObject.toJSONString(response);
this.matchRawResult = JacksonUtil.toJSONString(response);
return this;
}
@@ -62,14 +62,14 @@ public class FaceDetectLog {
if (matchLocalRecord == null) {
return null;
}
return JSONArray.parseArray(matchLocalRecord, MatchLocalRecord.class);
return JacksonUtil.parseObject(matchLocalRecord, new TypeReference<List<MatchLocalRecord>>() {});
}
public void matchLocalRecord(List matchLocalRecord) {
if (matchLocalRecord == null) {
this.matchLocalRecord = null;
} else {
this.matchLocalRecord = JSONArray.toJSONString(matchLocalRecord);
this.matchLocalRecord = JacksonUtil.toJSONString(matchLocalRecord);
}
}

View File

@@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.order.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.math.BigDecimal;
@@ -91,6 +92,7 @@ public class OrderEntity {
*/
private Date refundAt;
@JsonProperty("discountPrice")
public BigDecimal getDiscountPrice() {
if (slashPrice == null) {
return BigDecimal.ZERO;

View File

@@ -1,6 +1,7 @@
package com.ycwl.basic.model.pc.order.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.math.BigDecimal;
@@ -88,6 +89,7 @@ public class OrderAppRespVO {
// 订单明细
private List<OrderItemVO> orderItemList;
@JsonProperty("discountPrice")
public BigDecimal getDiscountPrice() {
if (slashPrice == null) {
return BigDecimal.ZERO;

View File

@@ -1,6 +1,7 @@
package com.ycwl.basic.model.pc.order.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ycwl.basic.model.mobile.goods.GoodsDetailVO;
import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
import lombok.Data;
@@ -112,6 +113,7 @@ public class OrderRespVO {
private String scenicName;
private List<GoodsDetailVO> goodsList;
@JsonProperty("discountPrice")
public BigDecimal getDiscountPrice() {
if (slashPrice == null) {
return BigDecimal.ZERO;

View File

@@ -1,6 +1,7 @@
package com.ycwl.basic.model.pc.video.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.math.BigDecimal;
@@ -62,6 +63,7 @@ public class VideoRespVO {
private Integer width;
private BigDecimal duration;
@JsonProperty("discountPrice")
public BigDecimal getDiscountPrice() {
if (slashPrice == null) {
return BigDecimal.ZERO;