升级版本

This commit is contained in:
zren25
2025-06-06 16:42:55 +08:00
parent 14603f8c36
commit 58336e4aef
3 changed files with 13 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ import com.volvo.ai.analytic.center.service.HuaWeiEGService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -30,7 +31,8 @@ public class EGEventSubscriptionController {
@Autowired
CompetingBrandsClient CompetingBrandsClient;
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
private String ltoChannelId;
@GetMapping("/getBrand")
public void getBrand(){
ResultDTO<List<CompetingBrrandsDTO>> result = CompetingBrandsClient.getBrand();
@@ -54,7 +56,7 @@ public class EGEventSubscriptionController {
*/
@PostMapping("/sendEvent")
public ResultDTO<PutEventsResponse> sendEvent(@RequestBody CloudEvents req) throws ExecutionException {
return ResultDTO.success(huaWeiService.sendEvent(req));
return ResultDTO.success(huaWeiService.sendEvent(req,ltoChannelId));
}
// 创建目标连接

View File

@@ -7,7 +7,6 @@ import com.volvo.ai.analytic.center.dto.event.ListSubscriptionsRequestDto;
import com.volvo.ai.analytic.center.dto.event.SubscriptionCreateReqDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -21,8 +20,6 @@ public class HuaWeiEGService {
private static final String HA_WEI_REQUEST = "hwReq={}";
private static final String HA_WEI_RESPONSE = "hwRes={}";
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
private String sourceId;
@Resource
EgClient egClient;
@@ -40,9 +37,9 @@ public class HuaWeiEGService {
*
* @param event event
*/
public PutEventsResponse sendEvent(CloudEvents event) {
public PutEventsResponse sendEvent(CloudEvents event, String channelId) {
PutEventsRequest request = new PutEventsRequest();
request.withChannelId(sourceId);
request.withChannelId(channelId);
List<CloudEvents> eventsList = new ArrayList<>();
eventsList.add(event);

View File

@@ -9,7 +9,6 @@ import com.volvo.ai.analytic.center.dto.corpus.CorpusReportDTO;
import com.volvo.ai.analytic.center.dto.corpus.OdsVdqwMessageOTD;
import com.volvo.ai.analytic.center.dto.req.DiFyReq;
import com.volvo.ai.analytic.center.dto.req.RunMaskingRuleInput;
import com.volvo.ai.analytic.center.dto.resp.CarModelRespDTO;
import com.volvo.ai.analytic.center.dto.resp.CompetingBrrandsDTO;
import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
import com.volvo.ai.analytic.center.entity.*;
@@ -23,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;
@@ -58,6 +58,9 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
// @Value("${huawei.cloud.EG.channel.ltoSourceId}")
private String sourceId;
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
private String ltoChannelId;
@Autowired
private DataMaskingRuleService dataMaskingRuleService;
@Autowired
@@ -121,7 +124,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
JSONObject text = execDifyFlow.getJSONObject("outputs");
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()), ltoChannelId);
}
try {
@@ -221,7 +224,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
JSONObject text = execDifyFlow.getJSONObject("outputs");
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
}
try {
@@ -271,7 +274,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
JSONObject text = execDifyFlow.getJSONObject("outputs");
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
}
} catch (Exception e) {
log.error("nameplate processItem error {}", e.getMessage());