Commit f6fc511c authored by alex yao's avatar alex yao

merge release

parent cbfef1d5
...@@ -21,6 +21,13 @@ public interface AgentApplicationInfoService { ...@@ -21,6 +21,13 @@ public interface AgentApplicationInfoService {
String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem, String callAgentApplication(String identifier, String largeModel, String[] unitIds, String agentSystem,
Integer[] knowledgeIds, Integer communicationTurn, Float topP, Float temperature, Integer[] knowledgeIds, Integer communicationTurn, Float topP, Float temperature,
List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception; List<Message> messages, List<Tool> tools, HttpServletResponse httpServletResponse) throws Exception;
/**
* 应用下架
*
* @param agentId
* @return
*/
boolean unPublish(String agentId) throws Exception;
/** /**
* 角色指令AI生成 * 角色指令AI生成
......
...@@ -6,10 +6,12 @@ public interface AgentApplicationConstants { ...@@ -6,10 +6,12 @@ public interface AgentApplicationConstants {
String DRAFT = "draft"; // 草稿 String DRAFT = "draft"; // 草稿
String PUBLISH = "publish"; // 已发布 String PUBLISH = "publish"; // 发布
String UN_PUBLISH = "unPublish"; // 已下架
static boolean isPublishStatus(String status) { static boolean isPublishStatus(String status) {
return PUBLISH.equals(status) || DRAFT.equals(status); return PUBLISH.equals(status) || DRAFT.equals(status) || UN_PUBLISH.equals(status);
} }
} }
......
...@@ -25,4 +25,5 @@ public interface BizAgentApplicationInfoService extends BaseService { ...@@ -25,4 +25,5 @@ public interface BizAgentApplicationInfoService extends BaseService {
boolean publish(String agentId) throws Exception; boolean publish(String agentId) throws Exception;
boolean unPublish(String agentId);
} }
\ No newline at end of file
...@@ -144,6 +144,22 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl ...@@ -144,6 +144,22 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
return true; return true;
} }
@Override
public boolean unPublish(String agentId) {
Assert.notNull(agentId);
BizAgentApplicationInfoModel model = new BizAgentApplicationInfoModel();
model.setAgentId(agentId);
model.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizAgentApplicationInfoModel> models = this.repository.findByExample(model);
if (CollectionUtils.isEmpty(models)) {
return false;
}
model = models.get(0);
model.setAgentPublishStatus(AgentApplicationConstants.AGENT_PUBLISH_STATUS.UN_PUBLISH);
this.repository.save(model);
return true;
}
/** /**
* 参数验证和转换 Entity To Model * 参数验证和转换 Entity To Model
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment