2025/3/14 10:22:25----修改配置111

This commit is contained in:
2025-03-14 02:22:40 +00:00 committed by root
parent b00d2f96e2
commit 2a12d523df
2 changed files with 6 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package com.example.processor;
import com.example.model.AdvancedSearchRequest;
import com.example.model.PageRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.camel.Exchange;
import org.apache.camel.Configuration;
import org.apache.camel.BindToRegistry;
@ -93,15 +94,15 @@ public class RequestProcessor {
AdvancedSearchRequest searchRequest = null;
if(body instanceof String){
String bodyStr = (String) body;
LOGGER.info("高级搜索拿到的请求body: {}", bodyStr);
LOGGER.info("高级搜索拿到的请求body--string: {}", bodyStr);
searchRequest = objectMapper.readValue(bodyStr, AdvancedSearchRequest.class);
}else if(body instanceof Map){
@SuppressWarnings("unchecked")
Map<String, Object> bodyMap = (Map<String, Object>) body;
LOGGER.info("高级搜索拿到的请求body: {}", bodyMap);
LOGGER.info("高级搜索拿到的请求body---map: {}", bodyMap);
searchRequest = objectMapper.convertValue(bodyMap, AdvancedSearchRequest.class);
}else{
LOGGER.warn("无法处理的请求体类型: {}", body != null ? body.getClass().getName() : "null");
LOGGER.warn("无法处理的请求体类型: {}---body的类型{}", body != null ? body.getClass().getName() : "null",body.getClass());
searchRequest = new AdvancedSearchRequest();
}
@ -115,6 +116,7 @@ public class RequestProcessor {
params.put("sortField", searchRequest.getSortField());
params.put("sortOrder", searchRequest.getSortOrder());
LOGGER.info("转换后参数:{}",params);
return params;
}

View File

@ -8,8 +8,6 @@
value: WRITE_DATES_AS_TIMESTAMPS
- key: json.in.disableFeatures
value: FAIL_ON_UNKNOWN_PROPERTIES
- key: unmarshalType
value: com.fasterxml.jackson.databind.JsonNode
- rest:
id: rest-523c
description: 用户服务