字段修改

This commit is contained in:
2025-12-19 17:17:27 +08:00
parent 428b8ce28e
commit cc372bc7ea
7 changed files with 32 additions and 16 deletions

View File

@@ -90,7 +90,7 @@ public class AgentChatServiceImpl implements AgentChatService {
private Boolean isOuterAgent(String agentId){
// 智能体必须是outer
ResultDomain<TbAgent> agentResult = agentService.selectAgentById(agentId);
if(!agentResult.getSuccess()|| agentResult.getData() == null || !agentResult.getData().getOuter()){
if(!agentResult.getSuccess()|| agentResult.getData() == null || !agentResult.getData().getIsOuter()){
return false;
}
return true;
@@ -101,7 +101,7 @@ public class AgentChatServiceImpl implements AgentChatService {
@Override
@Transactional(rollbackFor = Exception.class)
public ResultDomain<TbChat> createChat(TbChat chat) {
// 如果是来客userType=false校验智能体是否是 outer
// 如果是来客userType=false校验智能体是否是 isOuter
if(!chat.getUserType()){
if(!isOuterAgent(chat.getAgentId())){
return ResultDomain.failure("智能体不可用");
@@ -235,7 +235,7 @@ public class AgentChatServiceImpl implements AgentChatService {
// 1. 校验智能体
ResultDomain<TbAgent> agentResult = agentService.selectAgentById(agentId);
if (!agentResult.getSuccess() || agentResult.getData() == null || !agentResult.getData().getOuter()) {
if (!agentResult.getSuccess() || agentResult.getData() == null || !agentResult.getData().getIsOuter()) {
return ResultDomain.failure("智能体不存在或不可用");
}
TbAgent agent = agentResult.getData();
@@ -409,7 +409,7 @@ public class AgentChatServiceImpl implements AgentChatService {
public ResultDomain<Boolean> stopChatMessageByTaskId(TbChat filter, String taskId) {
// 1. 获取智能体
ResultDomain<TbAgent> agentResult = agentService.selectAgentById(filter.getAgentId());
if (!agentResult.getSuccess() || agentResult.getData() == null || !agentResult.getData().getOuter()) {
if (!agentResult.getSuccess() || agentResult.getData() == null || !agentResult.getData().getIsOuter()) {
return ResultDomain.failure("智能体不存在");
}
TbAgent agent = agentResult.getData();

View File

@@ -9,7 +9,7 @@
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="link" property="link" jdbcType="VARCHAR"/>
<result column="api_key" property="apiKey" jdbcType="VARCHAR"/>
<result column="outer" property="outer" jdbcType="BOOLEAN"/>
<result column="is_outer" property="isOuter" jdbcType="BOOLEAN"/>
<result column="introduce" property="introduce" jdbcType="VARCHAR"/>
<result column="prompt_cards" property="promptCards" jdbcType="OTHER" typeHandler="org.xyzh.ai.handler.PromptCardsTypeHandler"/>
<result column="category" property="category" jdbcType="VARCHAR"/>
@@ -22,21 +22,21 @@
</resultMap>
<sql id="Base_Column_List">
optsn, agent_id, name, description, link, api_key, outer, introduce, prompt_cards,
optsn, agent_id, name, description, link, api_key, is_outer, introduce, prompt_cards,
category, creator, updater, create_time, update_time, delete_time, deleted
</sql>
<insert id="insertAgent" parameterType="org.xyzh.api.ai.dto.TbAgent">
INSERT INTO ai.tb_agent (
optsn, agent_id, name, api_key, introduce, category
<if test="outer !=null">, outer</if>
<if test="isOuter !=null">, is_outer</if>
<if test="description != null">, description</if>
<if test="link != null">, link</if>
<if test="promptCards != null">, prompt_cards</if>
<if test="creator != null">, creator</if>
) VALUES (
#{optsn}, #{agentId}, #{name}, #{apiKey}, #{introduce}, #{category}
<if test="outer !=null">, #{outer}</if>
<if test="isOuter !=null">, #{isOuter}</if>
<if test="description != null">, #{description}</if>
<if test="link != null">, #{link}</if>
<if test="promptCards != null">, #{promptCards, typeHandler=org.xyzh.ai.handler.PromptCardsTypeHandler}</if>
@@ -51,7 +51,7 @@
<if test="description != null">description = #{description},</if>
<if test="link != null">link = #{link},</if>
<if test="apiKey != null">api_key = #{apiKey},</if>
<if test="outer != null">outer = #{outer},</if>
<if test="isOuter != null">is_outer = #{isOuter},</if>
<if test="introduce != null">introduce = #{introduce},</if>
<if test="promptCards != null">prompt_cards = #{promptCards, typeHandler=org.xyzh.ai.handler.PromptCardsTypeHandler},</if>
<if test="category != null">category = #{category},</if>