Commit d647b9c9 authored by alex yao's avatar alex yao

feat: Agent应用 获取官方创建应用列表

parent 3715611e
......@@ -43,6 +43,12 @@ public interface AgentApplicationRest extends BaseRest {
@Permission(value = Access.Anonymous)
BizAgentApplicationPublishDto getInfo(@RequestParam String agentId) throws Exception;
/**
* 获取 已发布[官方]默认应用列表
*/
@Permission(value = Access.Anonymous)
List<SearchAgentApplicationDto> getDefaultList(PagingInfo pagingInfo) throws Exception;
/**
* 下架已发布应用
*/
......
......@@ -102,6 +102,28 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
return BizAgentApplicationPublishConvert.entityToDto(entity);
}
@Override
public List<SearchAgentApplicationDto> getDefaultList(PagingInfo pagingInfo) throws Exception {
List<SearchAgentApplicationDto> result = new ArrayList<>();
BizAgentApplicationPublishEntity publishEntity = new BizAgentApplicationPublishEntity();
publishEntity.setMemberId(0);
publishEntity.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizAgentApplicationPublishEntity> entities = bizAgentApplicationPublishService.findByExample(publishEntity, pagingInfo);
if (CollectionUtils.isNotEmpty(entities)) {
result = entities.stream().map(value -> {
SearchAgentApplicationDto searchAgentApplicationDto = new SearchAgentApplicationDto();
searchAgentApplicationDto.setAgentId(value.getAgentId());
searchAgentApplicationDto.setAgentTitle(value.getAgentTitle());
searchAgentApplicationDto.setAgentDesc(value.getAgentDesc());
searchAgentApplicationDto.setAgentAvatar(value.getAgentAvatar());
searchAgentApplicationDto.setPublishedTime(value.getModifiedTime());
searchAgentApplicationDto.setCreator("官方");
return searchAgentApplicationDto;
}).collect(Collectors.toList());
}
return result;
}
@Override
public void unPublish(String agentId) throws Exception {
Assert.notBlank(agentId, "应用ID不能为空");
......
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