升级版本
This commit is contained in:
@@ -11,6 +11,7 @@ import com.volvo.ai.analytic.center.service.HuaWeiEGService;
|
|||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -30,7 +31,8 @@ public class EGEventSubscriptionController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
CompetingBrandsClient CompetingBrandsClient;
|
CompetingBrandsClient CompetingBrandsClient;
|
||||||
|
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
|
||||||
|
private String ltoChannelId;
|
||||||
@GetMapping("/getBrand")
|
@GetMapping("/getBrand")
|
||||||
public void getBrand(){
|
public void getBrand(){
|
||||||
ResultDTO<List<CompetingBrrandsDTO>> result = CompetingBrandsClient.getBrand();
|
ResultDTO<List<CompetingBrrandsDTO>> result = CompetingBrandsClient.getBrand();
|
||||||
@@ -54,7 +56,7 @@ public class EGEventSubscriptionController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/sendEvent")
|
@PostMapping("/sendEvent")
|
||||||
public ResultDTO<PutEventsResponse> sendEvent(@RequestBody CloudEvents req) throws ExecutionException {
|
public ResultDTO<PutEventsResponse> sendEvent(@RequestBody CloudEvents req) throws ExecutionException {
|
||||||
return ResultDTO.success(huaWeiService.sendEvent(req));
|
return ResultDTO.success(huaWeiService.sendEvent(req,ltoChannelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建目标连接
|
// 创建目标连接
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.volvo.ai.analytic.center.dto.event.ListSubscriptionsRequestDto;
|
|||||||
import com.volvo.ai.analytic.center.dto.event.SubscriptionCreateReqDto;
|
import com.volvo.ai.analytic.center.dto.event.SubscriptionCreateReqDto;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
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_REQUEST = "hwReq={}";
|
||||||
private static final String HA_WEI_RESPONSE = "hwRes={}";
|
private static final String HA_WEI_RESPONSE = "hwRes={}";
|
||||||
|
|
||||||
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
|
|
||||||
private String sourceId;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
EgClient egClient;
|
EgClient egClient;
|
||||||
@@ -40,9 +37,9 @@ public class HuaWeiEGService {
|
|||||||
*
|
*
|
||||||
* @param event event
|
* @param event event
|
||||||
*/
|
*/
|
||||||
public PutEventsResponse sendEvent(CloudEvents event) {
|
public PutEventsResponse sendEvent(CloudEvents event, String channelId) {
|
||||||
PutEventsRequest request = new PutEventsRequest();
|
PutEventsRequest request = new PutEventsRequest();
|
||||||
request.withChannelId(sourceId);
|
request.withChannelId(channelId);
|
||||||
|
|
||||||
List<CloudEvents> eventsList = new ArrayList<>();
|
List<CloudEvents> eventsList = new ArrayList<>();
|
||||||
eventsList.add(event);
|
eventsList.add(event);
|
||||||
|
|||||||
@@ -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.corpus.OdsVdqwMessageOTD;
|
||||||
import com.volvo.ai.analytic.center.dto.req.DiFyReq;
|
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.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.CompetingBrrandsDTO;
|
||||||
import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
|
import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
|
||||||
import com.volvo.ai.analytic.center.entity.*;
|
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.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.cloud.context.config.annotation.RefreshScope;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -58,6 +58,9 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
|
|
||||||
// @Value("${huawei.cloud.EG.channel.ltoSourceId}")
|
// @Value("${huawei.cloud.EG.channel.ltoSourceId}")
|
||||||
private String sourceId;
|
private String sourceId;
|
||||||
|
|
||||||
|
@Value("${huawei.cloud.EG.channel.ltoChannelId}")
|
||||||
|
private String ltoChannelId;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataMaskingRuleService dataMaskingRuleService;
|
private DataMaskingRuleService dataMaskingRuleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -121,7 +124,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()), ltoChannelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -221,7 +224,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -271,7 +274,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()));
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("nameplate processItem error {}", e.getMessage());
|
log.error("nameplate processItem error {}", e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user