mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
refactor(smartCamCarLicenseSnapshotData): 优化数据保存逻辑- 在 PojoProcessor 中增加对 ResponseEntity 类型的处理,避免不必要的操作
- 在 SmartCamCarLicenseSnapshotDataController 中添加 OrgScope 注解 - 在 SmartCamCarLicenseSnapshotDataService 中增加日志记录,便于调试和监控
This commit is contained in:
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
@@ -100,6 +101,10 @@ public class PojoProcessor {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pojo instanceof ResponseEntity<?>){
|
||||
return;
|
||||
}
|
||||
|
||||
if (pojo instanceof Iterable<?> it) {
|
||||
it.forEach(this::collectActions);
|
||||
return;
|
||||
|
||||
@@ -62,6 +62,7 @@ public class SmartCamCarLicenseSnapshotDataController {
|
||||
@RateLimit(value = false)
|
||||
@SignCheck(value = false)
|
||||
@SubmitToken(value = false)
|
||||
@OrgScope(value = false)
|
||||
@PostMapping("/saveEvent")
|
||||
public ResponseEntity<String> saveEvent(@RequestBody String json) {
|
||||
ObjectNode jsonNodes = this.service.saveEvent(json);
|
||||
|
||||
@@ -106,6 +106,8 @@ public class SmartCamCarLicenseSnapshotDataService
|
||||
|
||||
@SneakyThrows
|
||||
public ObjectNode saveEvent(String json) {
|
||||
|
||||
log.info("saveEvent {}", json);
|
||||
JsonNode rootNode = objectMapper.readTree(json);
|
||||
SmartCamCarLicenseSnapshotDataEntity entity = new SmartCamCarLicenseSnapshotDataEntity();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user