This commit is contained in:
2025-07-27 08:59:08 +08:00
parent e9f44dd851
commit 563d83f849
35 changed files with 482 additions and 255 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);
}
}