修改更新参数
This commit is contained in:
@@ -14,10 +14,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController()
|
||||
@@ -37,9 +34,9 @@ public class AiAnalysisDifyController {
|
||||
|
||||
@PostMapping("/updateByAiId")
|
||||
@ApiOperation(value = "更新dify结果")
|
||||
public ResultMsg<Object> updateByAiId(@RequestBody AnalysisDifyResultDTO analysisResp) {
|
||||
log.info("updateByAiId message: {}",analysisResp.getAiAnalysisRequestId());
|
||||
aiAnalysisDifyService.updateAiDifyResult(analysisResp);
|
||||
public ResultMsg<Object> updateByAiId(@RequestBody String message) {
|
||||
log.info("updateByAiId message: {}", message);
|
||||
aiAnalysisDifyService.updateAiDifyResult(message);
|
||||
return ResultMsg.ok("ok");
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.volvo.ai.analytic.center.dto.resp.AnalysisResp;
|
||||
|
||||
public interface AiAnalysisDifyService {
|
||||
|
||||
public boolean updateAiDifyResult(AnalysisDifyResultDTO analysisResp);
|
||||
public boolean updateAiDifyResult(String message);
|
||||
|
||||
|
||||
AnalysisResp aiAnalyze(AnalysisReq analysisReq);
|
||||
|
||||
@@ -61,12 +61,13 @@ public class AiAnalysisDifyServiceImpl implements AiAnalysisDifyService {
|
||||
@Autowired
|
||||
private RedisCounterRateLimiter redisCounterRateLimiter;
|
||||
@Override
|
||||
public boolean updateAiDifyResult(AnalysisDifyResultDTO analysisResp) {
|
||||
public boolean updateAiDifyResult(String message) {
|
||||
|
||||
// 计数-1
|
||||
redisCounterRateLimiter.decrement(ConstantStr.DIFY_COUNTERRATELIMIT);
|
||||
log.info("redisdecrement计数数量: " + redisCounterRateLimiter.getCurrentCount(ConstantStr.DIFY_COUNTERRATELIMIT));
|
||||
if(null != analysisResp){
|
||||
if(StringUtils.isNotEmpty(message)){
|
||||
AnalysisDifyResultDTO analysisResp = JSONObject.parseObject(message, AnalysisDifyResultDTO.class);
|
||||
|
||||
Optional.ofNullable(aiAnalysisRequestLogsService.queryByAiAnalysisRequestId(analysisResp.getAiAnalysisRequestId()))
|
||||
.orElseThrow(() -> new IllegalArgumentException("AiAnalysisRequestId查询对象为空!"));
|
||||
|
||||
Reference in New Issue
Block a user