feat: AI消息点赞/踩/取消点赞/取消踩/问题反馈信息保存功能完善

This commit is contained in:
郭诚奇
2025-12-04 14:25:39 +08:00
parent ee0a853b1b
commit b9fc27f4fb
4 changed files with 71 additions and 53 deletions

View File

@@ -89,6 +89,7 @@ public class CaseAiChatApi extends ApiBaseController {
@PostMapping("/likeMsg")
public JsonResponse<Boolean> likeMsg(@RequestBody CaseAiMsgLikeDto caseAiMsgLikeDto) {
try {
caseAiMsgLikeDto.setOperation(true);
if (caseAiChatService.msgFeedback(caseAiMsgLikeDto)) {
return success(true, "保存成功");
} else {
@@ -109,6 +110,7 @@ public class CaseAiChatApi extends ApiBaseController {
@PostMapping("/msgFeedback")
public JsonResponse<Boolean> msgFeedback(@RequestBody CaseAiMsgLikeDto caseAiMsgLikeDto) {
try {
caseAiMsgLikeDto.setOperation(false);
if (caseAiChatService.msgFeedback(caseAiMsgLikeDto)) {
return success(true, "保存成功");
} else {

View File

@@ -21,4 +21,12 @@ public class CaseAiMsgLikeDto {
* 反馈
*/
private String feedback;
/**
* 操作
* true: 点踩
* false: 反馈
* 为空:其他情况
*/
private Boolean operation;
}

View File

@@ -810,10 +810,18 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
log.error("操作失败docId为空");
return false;
}
if ((StringUtils.equalsAny(caseAiMsgLikeDto.getLikeStatus(), "0", "1", "-1")) || StringUtils.isBlank(caseAiMsgLikeDto.getFeedback())) {
if (Boolean.TRUE.equals(caseAiMsgLikeDto.getOperation())) {
String likeStatus = caseAiMsgLikeDto.getLikeStatus();
if (!StringUtils.equals(likeStatus, "1") && !StringUtils.equals(likeStatus, "0") && !StringUtils.equals(likeStatus, "-1")) {
log.error("操作失败,参数错误");
return false;
}
} else if (Boolean.FALSE.equals(caseAiMsgLikeDto.getOperation())) {
if (StringUtils.isBlank(caseAiMsgLikeDto.getFeedback())) {
log.error("操作失败,参数错误");
return false;
}
}
aiChatConversationData.setLikeStatus(caseAiMsgLikeDto.getLikeStatus());
aiChatConversationData.setFeedback(caseAiMsgLikeDto.getFeedback());
return elasticSearchIndexService.updateData(caseAiMsgLikeDto.getDocId() ,aiChatConversationData);

View File

@@ -11,22 +11,22 @@ spring:
cloud:
nacos:
discovery:
server-addr: 192.168.0.253:8848
server-addr: 192.168.10.74:8848
config:
server-addr: 192.168.0.253:8848
server-addr: 192.168.10.74:8848
redis:
database: 1
host: 192.168.0.253
password: boe@123
port: 6379
database: 2
host: 39.104.123.58
password: Ebiz2020
port: 6378
jpa:
hibernate:
ddl-auto: none
datasource:
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.0.253:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
username: root
password: boe#1234A
url: jdbc:mysql://rm-hp3cpkk0u50q90eu9vo.mysql.huhehaote.rds.aliyuncs.com:3306/ebiz_doc_manage?characterEncoding=utf8&useUnicode=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
username: ebiz_ai
password: ebiz_ai123
type: com.zaxxer.hikari.HikariDataSource
hikari:
auto-commit: true
@@ -36,7 +36,7 @@ spring:
max-lifetime: 1800000
maximum-pool-size: 20
activemq:
broker-url: tcp://192.168.0.253:61616
broker-url: tcp://192.168.10.74:61616
user: admin
password: admin
jms:
@@ -113,7 +113,7 @@ aop-log-record:
#不进行拦截的包或者类
excludeClassNames:
activemq:
broker-url: tcp://192.168.0.253:61616
broker-url: tcp://192.168.10.74:61616
user: admin
password: admin
elasticsearch: