Commit 05de9276 authored by alex yao's avatar alex yao

style: service命名优化

parent 9a52e406
package cn.com.poc.agent_application.aggregate; package cn.com.poc.agent_application.aggregate;
import cn.com.poc.agent_application.domain.FunctionResult;
import cn.com.poc.agent_application.entity.AgentResultEntity; import cn.com.poc.agent_application.entity.AgentResultEntity;
import cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity; import cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity;
import cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity; import cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity;
import cn.com.poc.agent_application.entity.KnowledgeSuperclassProblemConfig; import cn.com.poc.agent_application.entity.KnowledgeSuperclassProblemConfig;
import cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationKnowledgeConfig;
import cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationModelConfig;
import cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum; import cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum;
import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Message; import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Message;
import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Tool; import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Tool;
...@@ -15,7 +12,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.function.FunctionCallResu ...@@ -15,7 +12,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.function.FunctionCallResu
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
public interface AgentApplicationInfoService { public interface AgentApplicationService {
/** /**
* 创建/更新应用 * 创建/更新应用
...@@ -39,32 +36,6 @@ public interface AgentApplicationInfoService { ...@@ -39,32 +36,6 @@ public interface AgentApplicationInfoService {
*/ */
boolean deletedAgentApplication(String agentId) throws Exception; boolean deletedAgentApplication(String agentId) throws Exception;
/**
* Agent应用对话
*
* @param agentId 应用ID
* @param identifier 对话唯一标识
* @param largeModel 模型
* @param agentSystem 应用角色指令
* @param knowledgeIds 知识库ID
* @param communicationTurn 对话轮数
* @param topP 模型参数topP
* @param temperature 模型参数temperature
* @param messages 对话消息
* @param tools 插件配置
* @param fileUrls 文件URLs
* @param imageUrls 图片URLs
* @param stream 是否流式传输
* @param score 知识库参数score
* @param topK 知识库参数topK
* @param knowledgeSearchType 知识库参数知识搜索类型
*/
@Deprecated
AgentResultEntity callAgentApplication(String agentId, String identifier, String largeModel, String agentSystem,
Integer[] knowledgeIds, Integer communicationTurn, Float topP, Float temperature,
List<Message> messages, List<Tool> tools, List<String> fileUrls, boolean stream, List<String> imageUrls,
Double score, Integer topK, KnowledgeSearchTypeEnum knowledgeSearchType, HttpServletResponse httpServletResponse) throws Exception;
/** /**
* Agent应用对话 * Agent应用对话
* *
......
package cn.com.poc.agent_application.aggregate.impl; package cn.com.poc.agent_application.aggregate.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.constant.AgentApplicationConstants; import cn.com.poc.agent_application.constant.AgentApplicationConstants;
import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants; import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants;
import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants; import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants;
...@@ -65,13 +65,13 @@ import java.util.stream.Collectors; ...@@ -65,13 +65,13 @@ import java.util.stream.Collectors;
import static cn.com.poc.common.constant.XLangConstant.*; import static cn.com.poc.common.constant.XLangConstant.*;
@Component @Component
public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoService { public class AgentApplicationServiceImpl implements AgentApplicationService {
final private String TEXT_EVENT_STREAM_CHARSET_UTF_8 = "text/event-stream;charset=UTF-8"; final private String TEXT_EVENT_STREAM_CHARSET_UTF_8 = "text/event-stream;charset=UTF-8";
final private String EVENT_STREAM_PREFIX = "data: "; final private String EVENT_STREAM_PREFIX = "data: ";
final private Logger logger = LoggerFactory.getLogger(AgentApplicationInfoService.class); final private Logger logger = LoggerFactory.getLogger(AgentApplicationService.class);
@Resource @Resource
private BizKnowledgeDocumentService bizKnowledgeDocumentService; private BizKnowledgeDocumentService bizKnowledgeDocumentService;
...@@ -174,67 +174,58 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -174,67 +174,58 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
} }
@Override @Override
public AgentResultEntity callAgentApplication(String agentId, String dialogueId, String largeModel, public AgentResultEntity callAgentApplication(String agentId, String dialogueId, String largeModel, String agentSystem, Integer[] kdIds,
String agentSystem, Integer[] kdIds, Integer communicationTurn, Float topP, Float temperature, Integer communicationTurn, Float topP, Float temperature, List<Message> messages, List<Tool> tools, FunctionCallResult functionCallResult, List<String> fileUrls, boolean stream, List<String> imageUrls,
List<Message> messages, List<Tool> tools, List<String> fileUrls, boolean stream, List<String> imageUrls, Double score, Integer topK, KnowledgeSearchTypeEnum knowledgeSearchType, KnowledgeSuperclassProblemConfig superclassProblemConfig, HttpServletResponse httpServletResponse) throws Exception {
Double score, Integer topK, KnowledgeSearchTypeEnum knowledgeSearchType, HttpServletResponse httpServletResponse) throws Exception {
logger.info("Call Agent Application, agentId:{}, dialogueId:{},largeModel:{},agentSystem:{},kdIds:{},communicationTurn:{},topP:{},temperature:{},messages:{}, tools:{}"
, agentId, dialogueId, largeModel, agentSystem, kdIds, communicationTurn, topP, temperature, messages, tools);
String model = modelConvert(largeModel); String model = modelConvert(largeModel);
Tool[] toolArray = tools.toArray(new Tool[0]); Tool[] toolArray = tools.toArray(new Tool[0]);
FunctionResult functionResult = functionCall(dialogueId, messages, toolArray, agentId, fileUrls, imageUrls);
List<KnowledgeContentResult> knowledgeResult = knowledge(kdIds, messages, topK, score, knowledgeSearchType); List<KnowledgeContentResult> knowledgeResult = knowledge(kdIds, messages, topK, score, knowledgeSearchType);
if (superclassProblem(superclassProblemConfig, kdIds, knowledgeResult)) {
return sendProblemMess(stream, superclassProblemConfig, httpServletResponse);
} else {
FunctionResult functionResult = functionCall(dialogueId, functionCallResult, agentId);
String promptTemplate = buildDialogsPrompt(functionResult, agentSystem, toolArray, dialogueId, agentId, knowledgeResult); String promptTemplate = buildDialogsPrompt(functionResult, agentSystem, toolArray, dialogueId, agentId, knowledgeResult);
Message[] messageArray = buildMessages(messages, communicationTurn, promptTemplate); Message[] messageArray = buildMessages(messages, communicationTurn, promptTemplate);
return llmExecutorAndOutput(topP, stream, model, messageArray, functionResult, knowledgeResult, httpServletResponse); return llmExecutorAndOutput(topP, stream, model, messageArray, functionResult, knowledgeResult, httpServletResponse);
} }
}
@Override /**
public AgentResultEntity callAgentApplication(String agentId, String dialogueId, String largeModel, String agentSystem, Integer[] kdIds, * 发送知识库超纲回答
Integer communicationTurn, Float topP, Float temperature, List<Message> messages, List<Tool> tools, FunctionCallResult functionCallResult, List<String> fileUrls, boolean stream, List<String> imageUrls, *
Double score, Integer topK, KnowledgeSearchTypeEnum knowledgeSearchType, KnowledgeSuperclassProblemConfig superclassProblemConfig, HttpServletResponse httpServletResponse) throws Exception { * @param stream
String model = modelConvert(largeModel); * @param superclassProblemConfig
* @param httpServletResponse
List<KnowledgeContentResult> knowledgeResult = knowledge(kdIds, messages, topK, score, knowledgeSearchType); * @return
* @throws IOException
if (superclassProblem(superclassProblemConfig, kdIds, knowledgeResult)) { */
private AgentResultEntity sendProblemMess(boolean stream, KnowledgeSuperclassProblemConfig superclassProblemConfig, HttpServletResponse httpServletResponse) throws IOException {
String mess = superclassProblemConfig.getKnowledgeCustomResponse()[0]; String mess = superclassProblemConfig.getKnowledgeCustomResponse()[0];
logger.info("触发知识库超纲回答,mess{}", mess); logger.info("触发知识库超纲回答,mess{}", mess);
if (stream) { if (stream) {
PrintWriter writer = httpServletResponse.getWriter(); SSEUtil sseUtil = new SSEUtil(httpServletResponse);
LargeModelDemandResult result = new LargeModelDemandResult(); LargeModelDemandResult result = new LargeModelDemandResult();
result.setCode("0"); result.setCode("0");
result.setMessage(mess); result.setMessage(mess);
result.setFinish_reason("finish"); result.setFinish_reason("finish");
writer.write(EVENT_STREAM_PREFIX + JsonUtils.serialize(result) + "\n\n"); sseUtil.send(JsonUtils.serialize(result));
writer.write(EVENT_STREAM_PREFIX + "[DONE]" + "\n\n"); sseUtil.send("[DONE]");
writer.flush(); sseUtil.complete();
writer.close();
} }
AgentResultEntity agentResultEntity = new AgentResultEntity(); AgentResultEntity agentResultEntity = new AgentResultEntity();
agentResultEntity.setMessage(mess); agentResultEntity.setMessage(mess);
return agentResultEntity; return agentResultEntity;
} }
Tool[] toolArray = tools.toArray(new Tool[0]);
FunctionResult functionResult = functionCall(dialogueId, functionCallResult, agentId);
String promptTemplate = buildDialogsPrompt(functionResult, agentSystem, toolArray, dialogueId, agentId, knowledgeResult);
Message[] messageArray = buildMessages(messages, communicationTurn, promptTemplate);
return llmExecutorAndOutput(topP, stream, model, messageArray, functionResult, knowledgeResult, httpServletResponse);
}
@Override @Override
public void createAgentSystem(String input, HttpServletResponse httpServletResponse) throws Exception { public void createAgentSystem(String input, HttpServletResponse httpServletResponse) throws Exception {
...@@ -563,15 +554,11 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -563,15 +554,11 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
private AgentResultEntity llmExecutorAndOutput(Float topP, boolean stream, String model, Message[] messageArray, FunctionResult functionResult, List<KnowledgeContentResult> knowledgeResult, HttpServletResponse httpServletResponse) throws Exception { private AgentResultEntity llmExecutorAndOutput(Float topP, boolean stream, String model, Message[] messageArray, FunctionResult functionResult, List<KnowledgeContentResult> knowledgeResult, HttpServletResponse httpServletResponse) throws Exception {
if (stream) { if (stream) {
SSEUtil sseUtil = new SSEUtil(httpServletResponse); SSEUtil sseUtil = new SSEUtil(httpServletResponse);
// httpServletResponse.setContentType(TEXT_EVENT_STREAM_CHARSET_UTF_8);
// PrintWriter writer = httpServletResponse.getWriter();
if (CollectionUtils.isNotEmpty(knowledgeResult)) { if (CollectionUtils.isNotEmpty(knowledgeResult)) {
LargeModelDemandResult result = new LargeModelDemandResult(); LargeModelDemandResult result = new LargeModelDemandResult();
result.setCode("0"); result.setCode("0");
result.setKnowledgeContentResult(knowledgeResult); result.setKnowledgeContentResult(knowledgeResult);
sseUtil.send(JsonUtils.serialize(result)); sseUtil.send(JsonUtils.serialize(result));
// writer.write(EVENT_STREAM_PREFIX + JsonUtils.serialize(result) + "\n\n");
// writer.flush();
} }
if (ObjectUtil.isNotNull(functionResult) && StringUtils.isNotBlank(functionResult.getFunctionName())) { if (ObjectUtil.isNotNull(functionResult) && StringUtils.isNotBlank(functionResult.getFunctionName())) {
LargeModelDemandResult result = new LargeModelDemandResult(); LargeModelDemandResult result = new LargeModelDemandResult();
...@@ -579,8 +566,6 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -579,8 +566,6 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
ToolFunction toolFunction = functionResultConvertToolFunction(functionResult); ToolFunction toolFunction = functionResultConvertToolFunction(functionResult);
result.setFunction(toolFunction); result.setFunction(toolFunction);
sseUtil.send(JsonUtils.serialize(result)); sseUtil.send(JsonUtils.serialize(result));
// writer.write(EVENT_STREAM_PREFIX + JsonUtils.serialize(result) + "\n\n");
// writer.flush();
} }
BufferedReader bufferedReader = invokeLLMStream(model, messageArray, topP); BufferedReader bufferedReader = invokeLLMStream(model, messageArray, topP);
return textOutputStream(sseUtil, bufferedReader); return textOutputStream(sseUtil, bufferedReader);
......
package cn.com.poc.agent_application.rest.impl; package cn.com.poc.agent_application.rest.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.convert.AgentApplicationInfoConvert; import cn.com.poc.agent_application.convert.AgentApplicationInfoConvert;
import cn.com.poc.agent_application.domain.LargeModelInfo; import cn.com.poc.agent_application.domain.LargeModelInfo;
import cn.com.poc.agent_application.dto.*; import cn.com.poc.agent_application.dto.*;
...@@ -57,7 +57,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -57,7 +57,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
private BizAgentApplicationInfoService bizAgentApplicationInfoService; private BizAgentApplicationInfoService bizAgentApplicationInfoService;
@Resource @Resource
private AgentApplicationInfoService agentApplicationInfoService; private AgentApplicationService agentApplicationService;
@Resource @Resource
private BizAgentApplicationPublishService bizAgentApplicationPublishService; private BizAgentApplicationPublishService bizAgentApplicationPublishService;
...@@ -184,7 +184,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -184,7 +184,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
throw new I18nMessageException("exception/create.num.limit"); throw new I18nMessageException("exception/create.num.limit");
} }
} }
return AgentApplicationInfoConvert.entityToDto(agentApplicationInfoService.saveOrUpdate(entity)); return AgentApplicationInfoConvert.entityToDto(agentApplicationService.saveOrUpdate(entity));
} }
...@@ -212,7 +212,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -212,7 +212,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override @Override
public void delete(String agentId) throws Exception { public void delete(String agentId) throws Exception {
Assert.notNull(agentId); Assert.notNull(agentId);
agentApplicationInfoService.deletedAgentApplication(agentId); agentApplicationService.deletedAgentApplication(agentId);
} }
@Override @Override
...@@ -225,7 +225,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -225,7 +225,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
Assert.notNull(dto.getCommModelConfig()); Assert.notNull(dto.getCommModelConfig());
Assert.notNull(dto.getKnowledgeConfig()); Assert.notNull(dto.getKnowledgeConfig());
BizAgentApplicationInfoEntity bizAgentApplicationInfoEntity = AgentApplicationInfoConvert.dtoToEntity(dto); BizAgentApplicationInfoEntity bizAgentApplicationInfoEntity = AgentApplicationInfoConvert.dtoToEntity(dto);
agentApplicationInfoService.updateAndPublish(bizAgentApplicationInfoEntity); agentApplicationService.updateAndPublish(bizAgentApplicationInfoEntity);
return true; return true;
} }
...@@ -276,7 +276,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -276,7 +276,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
agentUseModifyEventInfo.setIsPublish(CommonConstant.IsDeleted.N); agentUseModifyEventInfo.setIsPublish(CommonConstant.IsDeleted.N);
reduceSn = memberEquityService.reducePoint(userBaseEntity.getUserId(), pointDeductionNum, ModifyEventEnum.use, agentUseModifyEventInfo); reduceSn = memberEquityService.reducePoint(userBaseEntity.getUserId(), pointDeductionNum, ModifyEventEnum.use, agentUseModifyEventInfo);
//调用应用服务 //调用应用服务
agentApplicationInfoService.callAgentApplication(agentId, dialogueId, model, agentApplicationService.callAgentApplication(agentId, dialogueId, model,
agentSystem, kdIds.toArray(new Integer[0]), communicationTurn, topP, agentSystem, kdIds.toArray(new Integer[0]), communicationTurn, topP,
temperature, dto.getMessages(), tools, checkPluginUseEntity.getFunctionCallResult(), dto.getFileUrls(), true, imageUrls, temperature, dto.getMessages(), tools, checkPluginUseEntity.getFunctionCallResult(), dto.getFileUrls(), true, imageUrls,
infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()), infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()),
...@@ -411,29 +411,29 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -411,29 +411,29 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override @Override
public void createAgentSystem(AgentApplicationGCDto dto, HttpServletResponse response) throws Exception { public void createAgentSystem(AgentApplicationGCDto dto, HttpServletResponse response) throws Exception {
Assert.notNull(dto.getInput()); Assert.notNull(dto.getInput());
agentApplicationInfoService.createAgentSystem(dto.getInput(), response); agentApplicationService.createAgentSystem(dto.getInput(), response);
} }
@Override @Override
public List<String> createFeaturedQuestions(AgentApplicationGCDto dto) { public List<String> createFeaturedQuestions(AgentApplicationGCDto dto) {
return agentApplicationInfoService.createFeaturedQuestions(dto.getAgentTitle(), dto.getAgentDesc()); return agentApplicationService.createFeaturedQuestions(dto.getAgentTitle(), dto.getAgentDesc());
} }
@Override @Override
public String createPreamble(AgentApplicationGCDto dto) { public String createPreamble(AgentApplicationGCDto dto) {
return agentApplicationInfoService.createPreamble(dto.getAgentTitle(), dto.getAgentDesc(), dto.getAgentSystem()); return agentApplicationService.createPreamble(dto.getAgentTitle(), dto.getAgentDesc(), dto.getAgentSystem());
} }
@Override @Override
public String createAgentApplicationAvatar(AgentApplicationGCDto dto) throws Exception { public String createAgentApplicationAvatar(AgentApplicationGCDto dto) throws Exception {
Assert.isTrue(StringUtils.isNotBlank(dto.getAgentDesc()) || StringUtils.isNotBlank(dto.getAgentTitle())); Assert.isTrue(StringUtils.isNotBlank(dto.getAgentDesc()) || StringUtils.isNotBlank(dto.getAgentTitle()));
return agentApplicationInfoService.createAgentIcon(dto.getAgentTitle(), dto.getAgentDesc()); return agentApplicationService.createAgentIcon(dto.getAgentTitle(), dto.getAgentDesc());
} }
@Override @Override
public AgentApplicationGCDto createAgentTitleAndDesc(AgentApplicationGCDto dto) { public AgentApplicationGCDto createAgentTitleAndDesc(AgentApplicationGCDto dto) {
Assert.notNull(dto.getInput()); Assert.notNull(dto.getInput());
CreateAgentTitleAndDescEntity entity = agentApplicationInfoService.createAgentTitleAndDesc(dto.getInput()); CreateAgentTitleAndDescEntity entity = agentApplicationService.createAgentTitleAndDesc(dto.getInput());
if (null == entity) { if (null == entity) {
throw new I18nMessageException("exception/generation.failed.please.try.again.later"); throw new I18nMessageException("exception/generation.failed.please.try.again.later");
} }
...@@ -447,7 +447,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest { ...@@ -447,7 +447,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@RedisLimit(key = "collect:agent_person", currentUser = true, count = 1, timeout = 1, exceptionInfo = "exception/too.many.requests") @RedisLimit(key = "collect:agent_person", currentUser = true, count = 1, timeout = 1, exceptionInfo = "exception/too.many.requests")
public void collectOrCancelAgentInPerson(String agentId) throws Exception { public void collectOrCancelAgentInPerson(String agentId) throws Exception {
Assert.notNull(agentId); Assert.notNull(agentId);
agentApplicationInfoService.collectOrCancelAgentInPerson(agentId); agentApplicationService.collectOrCancelAgentInPerson(agentId);
} }
@Override @Override
......
package cn.com.poc.agent_application.scheduler; package cn.com.poc.agent_application.scheduler;
import cn.com.poc.expose.aggregate.AgentApplicationService; import cn.com.poc.expose.aggregate.AgentApplicationExposeService;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -11,7 +11,7 @@ import javax.annotation.Resource; ...@@ -11,7 +11,7 @@ import javax.annotation.Resource;
public class RecommendQuestionScheduler { public class RecommendQuestionScheduler {
@Resource @Resource
private AgentApplicationService agentApplicationService; private AgentApplicationExposeService agentApplicationExposeService;
/** /**
* 每日凌晨 * 每日凌晨
...@@ -20,6 +20,6 @@ public class RecommendQuestionScheduler { ...@@ -20,6 +20,6 @@ public class RecommendQuestionScheduler {
*/ */
@Scheduled(cron = "0 0 0 * * ?") @Scheduled(cron = "0 0 0 * * ?")
public void knowledgeInfoStatusUpdateScheduler() throws Exception { public void knowledgeInfoStatusUpdateScheduler() throws Exception {
agentApplicationService.createRecommendQuestion(); agentApplicationExposeService.createRecommendQuestion();
} }
} }
...@@ -2,14 +2,12 @@ package cn.com.poc.expose.aggregate; ...@@ -2,14 +2,12 @@ package cn.com.poc.expose.aggregate;
import cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity; import cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity;
import cn.com.poc.agent_application.query.MemberCollectQueryItem; import cn.com.poc.agent_application.query.MemberCollectQueryItem;
import cn.com.poc.expose.dto.AgentApplicationApiProfileDto;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
public interface AgentApplicationService { public interface AgentApplicationExposeService {
/** /**
* 调用 已发布Agent应用 * 调用 已发布Agent应用
......
package cn.com.poc.expose.aggregate.impl; package cn.com.poc.expose.aggregate.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants; import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants;
import cn.com.poc.agent_application.entity.*; import cn.com.poc.agent_application.entity.*;
import cn.com.poc.agent_application.service.*; import cn.com.poc.agent_application.service.*;
...@@ -55,7 +55,7 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic ...@@ -55,7 +55,7 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic
private BizAgentApplicationPublishService bizAgentApplicationPublishService; private BizAgentApplicationPublishService bizAgentApplicationPublishService;
@Resource @Resource
private AgentApplicationInfoService agentApplicationInfoService; private AgentApplicationService agentApplicationService;
@Resource @Resource
private KnowledgeService knowledgeService; private KnowledgeService knowledgeService;
...@@ -168,7 +168,7 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic ...@@ -168,7 +168,7 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic
//对话 //对话
try { try {
AgentResultEntity agentResultEntity = agentApplicationInfoService.callAgentApplication(agentId, conversationId, infoEntity.getLargeModel(), AgentResultEntity agentResultEntity = agentApplicationService.callAgentApplication(agentId, conversationId, infoEntity.getLargeModel(),
infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(), infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(),
infoEntity.getTopP(), infoEntity.getTemperature(), messages, tools, checkPluginUseEntity.getFunctionCallResult(), fileUrls, stream, imageUrls, infoEntity.getTopP(), infoEntity.getTemperature(), messages, tools, checkPluginUseEntity.getFunctionCallResult(), fileUrls, stream, imageUrls,
infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()), infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()),
......
package cn.com.poc.expose.aggregate.impl; package cn.com.poc.expose.aggregate.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants; import cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants;
import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants; import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants;
import cn.com.poc.agent_application.entity.*; import cn.com.poc.agent_application.entity.*;
...@@ -19,7 +19,7 @@ import cn.com.poc.equity.aggregate.MemberEquityService; ...@@ -19,7 +19,7 @@ import cn.com.poc.equity.aggregate.MemberEquityService;
import cn.com.poc.equity.aggregate.PointDeductionRulesService; import cn.com.poc.equity.aggregate.PointDeductionRulesService;
import cn.com.poc.equity.constants.ModifyEventEnum; import cn.com.poc.equity.constants.ModifyEventEnum;
import cn.com.poc.equity.domain.modifyEquityInfo.AgentUseModifyEventInfo; import cn.com.poc.equity.domain.modifyEquityInfo.AgentUseModifyEventInfo;
import cn.com.poc.expose.aggregate.AgentApplicationService; import cn.com.poc.expose.aggregate.AgentApplicationExposeService;
import cn.com.poc.knowledge.aggregate.KnowledgeService; import cn.com.poc.knowledge.aggregate.KnowledgeService;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity; import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum; import cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum;
...@@ -51,9 +51,9 @@ import java.util.Set; ...@@ -51,9 +51,9 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
public class AgentApplicationServiceImpl implements AgentApplicationService { public class AgentApplicationExposeServiceImpl implements AgentApplicationExposeService {
final private Logger logger = LoggerFactory.getLogger(AgentApplicationService.class); final private Logger logger = LoggerFactory.getLogger(AgentApplicationExposeService.class);
/** /**
* 推荐问Key * 推荐问Key
...@@ -84,7 +84,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -84,7 +84,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
private BizAgentApplicationDialoguesRecordService bizAgentApplicationDialoguesRecordService; private BizAgentApplicationDialoguesRecordService bizAgentApplicationDialoguesRecordService;
@Resource @Resource
private AgentApplicationInfoService agentApplicationInfoService; private AgentApplicationService agentApplicationService;
@Resource @Resource
private BizAgentApplicationGcConfigService bizAgentApplicationGcConfigService; private BizAgentApplicationGcConfigService bizAgentApplicationGcConfigService;
...@@ -185,7 +185,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -185,7 +185,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
} }
} }
//对话 //对话
AgentResultEntity agentResultEntity = agentApplicationInfoService.callAgentApplication(agentId, dialogsId, infoEntity.getLargeModel(), AgentResultEntity agentResultEntity = agentApplicationService.callAgentApplication(agentId, dialogsId, infoEntity.getLargeModel(),
infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(), infoEntity.getAgentSystem(), kdIdList.toArray(new Integer[0]), infoEntity.getCommunicationTurn(),
infoEntity.getTopP(), infoEntity.getTemperature(), messages, tools, checkPluginUseEntity.getFunctionCallResult(), fileUrls, true, imageUrls, infoEntity.getTopP(), infoEntity.getTemperature(), messages, tools, checkPluginUseEntity.getFunctionCallResult(), fileUrls, true, imageUrls,
infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()), infoEntity.getKnowledgeSimilarity(), infoEntity.getKnowledgeNResult(), KnowledgeSearchTypeEnum.valueOf(infoEntity.getKnowledgeSearchType()),
...@@ -258,7 +258,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -258,7 +258,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
String redisKey = AGENT_APPLICATION_RECOMMEND_QUESTIONS + xlang; String redisKey = AGENT_APPLICATION_RECOMMEND_QUESTIONS + xlang;
if (!redisService.hasKey(redisKey)) { if (!redisService.hasKey(redisKey)) {
synchronized (AgentApplicationInfoService.class) { synchronized (AgentApplicationService.class) {
if (!redisService.hasKey(redisKey)) { if (!redisService.hasKey(redisKey)) {
createRecommendQuestion(); createRecommendQuestion();
} }
......
package cn.com.poc.expose.rest.impl; package cn.com.poc.expose.rest.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.agent_application.convert.AgentApplicationInfoConvert; import cn.com.poc.agent_application.convert.AgentApplicationInfoConvert;
import cn.com.poc.agent_application.convert.BizAgentApplicationPublishConvert; import cn.com.poc.agent_application.convert.BizAgentApplicationPublishConvert;
import cn.com.poc.agent_application.dto.AgentApplicationCreateContinueQuesDto; import cn.com.poc.agent_application.dto.AgentApplicationCreateContinueQuesDto;
...@@ -19,7 +19,7 @@ import cn.com.poc.common.utils.StringUtils; ...@@ -19,7 +19,7 @@ import cn.com.poc.common.utils.StringUtils;
import cn.com.poc.common.utils.UUIDTool; import cn.com.poc.common.utils.UUIDTool;
import cn.com.poc.equity.aggregate.PointDeductionRulesService; import cn.com.poc.equity.aggregate.PointDeductionRulesService;
import cn.com.poc.equity.entity.BizPointDeductionRulesEntity; import cn.com.poc.equity.entity.BizPointDeductionRulesEntity;
import cn.com.poc.expose.aggregate.AgentApplicationService; import cn.com.poc.expose.aggregate.AgentApplicationExposeService;
import cn.com.poc.expose.dto.*; import cn.com.poc.expose.dto.*;
import cn.com.poc.expose.rest.AgentApplicationRest; import cn.com.poc.expose.rest.AgentApplicationRest;
import cn.com.poc.message.entity.AgentApplicationClickEventMessage; import cn.com.poc.message.entity.AgentApplicationClickEventMessage;
...@@ -50,10 +50,10 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -50,10 +50,10 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
private Logger logger = LoggerFactory.getLogger(AgentApplicationRest.class); private Logger logger = LoggerFactory.getLogger(AgentApplicationRest.class);
@Resource @Resource
private AgentApplicationService agentApplicationService; private AgentApplicationExposeService agentApplicationExposeService;
@Resource @Resource
private AgentApplicationInfoService agentApplicationInfoService; private AgentApplicationService agentApplicationService;
@Resource @Resource
private BizAgentApplicationPublishService bizAgentApplicationPublishService; private BizAgentApplicationPublishService bizAgentApplicationPublishService;
...@@ -70,7 +70,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -70,7 +70,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
@Override @Override
public List<String> getRecommendQuestions(HttpServletRequest httpServletRequest) throws Exception { public List<String> getRecommendQuestions(HttpServletRequest httpServletRequest) throws Exception {
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException(); UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
return agentApplicationService.getRecommendQuestions(httpServletRequest.getHeader("x-lang"), userBaseEntity.getUserId()); return agentApplicationExposeService.getRecommendQuestions(httpServletRequest.getHeader("x-lang"), userBaseEntity.getUserId());
} }
@Override @Override
...@@ -80,7 +80,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -80,7 +80,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
throw new I18nMessageException("exception/user.not.login"); throw new I18nMessageException("exception/user.not.login");
} }
Long memberId = userBaseEntity.getUserId(); Long memberId = userBaseEntity.getUserId();
List<MemberCollectQueryItem> collectedApplications = agentApplicationService.getCollectedApplications(memberId, pagingInfo); List<MemberCollectQueryItem> collectedApplications = agentApplicationExposeService.getCollectedApplications(memberId, pagingInfo);
List<UserCollectDto> result = new ArrayList<>(); List<UserCollectDto> result = new ArrayList<>();
if (CollectionUtils.isNotEmpty(collectedApplications)) { if (CollectionUtils.isNotEmpty(collectedApplications)) {
for (MemberCollectQueryItem item : collectedApplications) { for (MemberCollectQueryItem item : collectedApplications) {
...@@ -112,7 +112,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -112,7 +112,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
Assert.notNull(dto.getAgentId()); Assert.notNull(dto.getAgentId());
Assert.notNull(dto.getDialogsId()); Assert.notNull(dto.getDialogsId());
try { try {
agentApplicationService.callAgentApplication(dto.getAgentId(), dto.getDialogsId(), dto.getInput(), dto.getFileUrls(), dto.getChannel(), dto.getImageUrl(), httpServletResponse); agentApplicationExposeService.callAgentApplication(dto.getAgentId(), dto.getDialogsId(), dto.getInput(), dto.getFileUrls(), dto.getChannel(), dto.getImageUrl(), httpServletResponse);
} catch (Exception e) { } catch (Exception e) {
httpServletResponse.setContentType("text/event-stream"); httpServletResponse.setContentType("text/event-stream");
PrintWriter writer = httpServletResponse.getWriter(); PrintWriter writer = httpServletResponse.getWriter();
...@@ -181,13 +181,13 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -181,13 +181,13 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
@Override @Override
public void unPublish(String agentId) throws Exception { public void unPublish(String agentId) throws Exception {
Assert.notBlank(agentId); Assert.notBlank(agentId);
agentApplicationInfoService.unPublish(agentId); agentApplicationService.unPublish(agentId);
} }
@Override @Override
public List<String> createContinueQuestions(AgentApplicationCreateContinueQuesDto dto) throws Exception { public List<String> createContinueQuestions(AgentApplicationCreateContinueQuesDto dto) throws Exception {
Assert.notNull(dto.getInput()); Assert.notNull(dto.getInput());
return agentApplicationService.createContinueQuestions(dto.getInput()); return agentApplicationExposeService.createContinueQuestions(dto.getInput());
} }
@Override @Override
...@@ -257,7 +257,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -257,7 +257,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
public String autoPlayByAgentId(String agentId) { public String autoPlayByAgentId(String agentId) {
Assert.notBlank(agentId); Assert.notBlank(agentId);
UserBaseEntity currentUser = BlContext.getCurrentUser(); UserBaseEntity currentUser = BlContext.getCurrentUser();
return agentApplicationService.autoPlayByAgentId(currentUser.getUserId(), agentId); return agentApplicationExposeService.autoPlayByAgentId(currentUser.getUserId(), agentId);
} }
@Override @Override
...@@ -266,13 +266,13 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -266,13 +266,13 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
Assert.notBlank(autoPlay); Assert.notBlank(autoPlay);
Assert.isTrue(CommonConstant.YOrN.N.equals(autoPlay) || CommonConstant.YOrN.Y.equals(autoPlay)); Assert.isTrue(CommonConstant.YOrN.N.equals(autoPlay) || CommonConstant.YOrN.Y.equals(autoPlay));
UserBaseEntity currentUser = BlContext.getCurrentUser(); UserBaseEntity currentUser = BlContext.getCurrentUser();
return agentApplicationService.enableAutoPlay(currentUser.getUserId(), agentId, autoPlay); return agentApplicationExposeService.enableAutoPlay(currentUser.getUserId(), agentId, autoPlay);
} }
@Override @Override
public AgentApplicationApiProfileDto getApiProfile() { public AgentApplicationApiProfileDto getApiProfile() {
UserBaseEntity userBaseEntity = BlContext.getCurrentUser(); UserBaseEntity userBaseEntity = BlContext.getCurrentUser();
BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationService.getApiProfile(userBaseEntity.getUserId()); BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationExposeService.getApiProfile(userBaseEntity.getUserId());
AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto(); AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto();
result.setApiKey(apiProfileEntity.getApiKey()); result.setApiKey(apiProfileEntity.getApiKey());
result.setApiSecret(apiProfileEntity.getApiSecret()); result.setApiSecret(apiProfileEntity.getApiSecret());
...@@ -282,7 +282,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest { ...@@ -282,7 +282,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
@Override @Override
public AgentApplicationApiProfileDto resetApiProfile() throws Exception { public AgentApplicationApiProfileDto resetApiProfile() throws Exception {
UserBaseEntity userBaseEntity = BlContext.getCurrentUser(); UserBaseEntity userBaseEntity = BlContext.getCurrentUser();
BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationService.resetApiProfile(userBaseEntity.getUserId()); BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationExposeService.resetApiProfile(userBaseEntity.getUserId());
AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto(); AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto();
result.setApiKey(apiProfileEntity.getApiKey()); result.setApiKey(apiProfileEntity.getApiKey());
result.setApiSecret(apiProfileEntity.getApiSecret()); result.setApiSecret(apiProfileEntity.getApiSecret());
......
package cn.com.poc.expose.rest.impl; package cn.com.poc.expose.rest.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService; import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import cn.com.poc.common.utils.BlContext; import cn.com.poc.common.utils.BlContext;
import cn.com.poc.common.utils.ListUtils;
import cn.com.poc.data_analyze.constants.DataAnalyzeChannelEnum;
import cn.com.poc.data_analyze.entity.*; import cn.com.poc.data_analyze.entity.*;
import cn.com.poc.expose.aggregate.AgentDataAnalyzeService; import cn.com.poc.expose.aggregate.AgentDataAnalyzeService;
import cn.com.poc.expose.dto.agent_data_analyze.*; import cn.com.poc.expose.dto.agent_data_analyze.*;
import cn.com.poc.expose.rest.AgentDataAnalyzeRest; import cn.com.poc.expose.rest.AgentDataAnalyzeRest;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity; import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.i18n.I18nMessageException; import cn.com.yict.framemax.core.i18n.I18nMessageException;
import cn.hutool.core.collection.ListUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -31,7 +28,7 @@ public class AgentDataAnalyzeRestImpl implements AgentDataAnalyzeRest { ...@@ -31,7 +28,7 @@ public class AgentDataAnalyzeRestImpl implements AgentDataAnalyzeRest {
private AgentDataAnalyzeService agentDataAnalyzeService; private AgentDataAnalyzeService agentDataAnalyzeService;
@Resource @Resource
private AgentApplicationInfoService agentApplicationInfoService; private AgentApplicationService agentApplicationService;
@Override @Override
public List<AgentDataAnalyzeGeneralDto> getGeneralUsageData(String agentId, List<String> channel) { public List<AgentDataAnalyzeGeneralDto> getGeneralUsageData(String agentId, List<String> channel) {
...@@ -128,7 +125,7 @@ public class AgentDataAnalyzeRestImpl implements AgentDataAnalyzeRest { ...@@ -128,7 +125,7 @@ public class AgentDataAnalyzeRestImpl implements AgentDataAnalyzeRest {
if (userBaseEntity == null) { if (userBaseEntity == null) {
throw new I18nMessageException("exception/user.does.not.exist"); throw new I18nMessageException("exception/user.does.not.exist");
} }
if (!agentApplicationInfoService.hasPublishAgentPermission(agentId, userBaseEntity.getUserId())) { if (!agentApplicationService.hasPublishAgentPermission(agentId, userBaseEntity.getUserId())) {
throw new I18nMessageException("exception/no.permission"); throw new I18nMessageException("exception/no.permission");
} }
} }
......
...@@ -3,7 +3,7 @@ package cn.com.poc.agent_application; ...@@ -3,7 +3,7 @@ package cn.com.poc.agent_application;
import cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity; import cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity;
import cn.com.poc.agent_application.service.BizAgentApplicationApiProfileService; import cn.com.poc.agent_application.service.BizAgentApplicationApiProfileService;
import cn.com.poc.common.utils.JsonUtils; import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.expose.aggregate.AgentApplicationService; import cn.com.poc.expose.aggregate.AgentApplicationExposeService;
import cn.com.poc.expose.dto.AgentApplicationApiProfileDto; import cn.com.poc.expose.dto.AgentApplicationApiProfileDto;
import cn.com.yict.framemax.core.spring.SingleContextInitializer; import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import org.junit.Test; import org.junit.Test;
...@@ -34,12 +34,12 @@ public class AgentApplicationApiProfileTest { ...@@ -34,12 +34,12 @@ public class AgentApplicationApiProfileTest {
} }
@Resource @Resource
private AgentApplicationService agentApplicationService; private AgentApplicationExposeService agentApplicationExposeService;
@Test @Test
public void test_getApiProfile() { public void test_getApiProfile() {
String agentId = "d37d4a9b2fe0421ea991127c247fbbf3"; String agentId = "d37d4a9b2fe0421ea991127c247fbbf3";
BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationService.getApiProfile(197L); BizAgentApplicationApiProfileEntity apiProfileEntity = agentApplicationExposeService.getApiProfile(197L);
AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto(); AgentApplicationApiProfileDto result = new AgentApplicationApiProfileDto();
result.setApiKey(apiProfileEntity.getApiKey()); result.setApiKey(apiProfileEntity.getApiKey());
result.setApiSecret(apiProfileEntity.getApiSecret()); result.setApiSecret(apiProfileEntity.getApiSecret());
......
...@@ -4,14 +4,12 @@ import cn.com.poc.agent_application.query.MemberCollectQueryCondition; ...@@ -4,14 +4,12 @@ import cn.com.poc.agent_application.query.MemberCollectQueryCondition;
import cn.com.poc.agent_application.query.MemberCollectQueryItem; import cn.com.poc.agent_application.query.MemberCollectQueryItem;
import cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService; import cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService;
import cn.com.poc.common.constant.CommonConstant; import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.expose.aggregate.impl.AgentApplicationServiceImpl; import cn.com.poc.expose.aggregate.impl.AgentApplicationExposeServiceImpl;
import cn.com.yict.framemax.core.spring.SingleContextInitializer; import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
...@@ -27,11 +25,11 @@ import static org.mockito.Mockito.when; ...@@ -27,11 +25,11 @@ import static org.mockito.Mockito.when;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = SingleContextInitializer.class) @ContextConfiguration(initializers = SingleContextInitializer.class)
@WebAppConfiguration @WebAppConfiguration
public class AgentApplicationServiceTest { public class AgentApplicationExposeServiceTest {
private BizMemberAgentApplicationCollectService bizMemberAgentApplicationCollectService; private BizMemberAgentApplicationCollectService bizMemberAgentApplicationCollectService;
@Resource @Resource
private AgentApplicationServiceImpl agentApplicationService; private AgentApplicationExposeServiceImpl agentApplicationService;
private Long memberId; private Long memberId;
private PagingInfo pagingInfo; private PagingInfo pagingInfo;
......
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