Commit bea1933f authored by alex yao's avatar alex yao

feat:模型列表接口出参修改

parent e8815fb3
......@@ -22,20 +22,5 @@ public class BizAgentApplicationLargeModelListConvert {
model.setOwner(entity.getOwner());
return model;
}
public static BizAgentApplicationLargeModelListDto entityToDto(BizAgentApplicationLargeModelListEntity entity){
BizAgentApplicationLargeModelListDto dto = new BizAgentApplicationLargeModelListDto();
dto.setId(entity.getId());
dto.setModelName(entity.getModelName());
dto.setOwner(entity.getOwner());
return dto;
}
public static BizAgentApplicationLargeModelListEntity dtoToEntity(BizAgentApplicationLargeModelListDto dto){
BizAgentApplicationLargeModelListEntity entity = new BizAgentApplicationLargeModelListEntity();
entity.setId(dto.getId());
entity.setModelName(dto.getModelName());
entity.setOwner(dto.getOwner());
return entity;
}
}
\ No newline at end of file
package cn.com.poc.agent_application.dto;
package cn.com.poc.agent_application.dto;
import java.util.List;
public class BizAgentApplicationLargeModelListDto {
private static final long serialVersionUID = 1L;
/** id
*
*/
private java.lang.Integer id;
/**
* models
* 模型
*/
private List<String> models;
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
public List<String> getModels() {
return models;
}
/** model_name
*模型
*/
private java.lang.String modelName;
public java.lang.String getModelName(){
return this.modelName;
}
public void setModelName(java.lang.String modelName){
this.modelName = modelName;
public void setModels(List<String> models) {
this.models = models;
}
/** owner
*模型服务商
*/
/**
* owner
* 模型服务商
*/
private java.lang.String owner;
public java.lang.String getOwner(){
public java.lang.String getOwner() {
return this.owner;
}
public void setOwner(java.lang.String owner){
public void setOwner(java.lang.String owner) {
this.owner = owner;
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import cn.com.poc.agent_application.convert.BizAgentApplicationLargeModelListCon
import cn.com.poc.agent_application.dto.*;
import cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity;
import cn.com.poc.agent_application.entity.BizAgentApplicationLargeModelListEntity;
import cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity;
import cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity;
import cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition;
import cn.com.poc.agent_application.rest.AgentApplicationInfoRest;
......@@ -26,6 +27,7 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
......@@ -138,11 +140,18 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override
public List<BizAgentApplicationLargeModelListDto> getLargeModelList() throws Exception {
return bizAgentApplicationLargeModelListService
.findByExample(new BizAgentApplicationLargeModelListEntity(), null)
.stream()
.map(BizAgentApplicationLargeModelListConvert::entityToDto)
.collect(Collectors.toList());
List<BizAgentApplicationLargeModelListEntity> entities = bizAgentApplicationLargeModelListService.findByExample(new BizAgentApplicationLargeModelListEntity(), null);
Map<String, List<String>> map = entities.stream()
.collect(Collectors.groupingBy(BizAgentApplicationLargeModelListEntity::getOwner
, Collectors.mapping(BizAgentApplicationLargeModelListEntity::getModelName, Collectors.toList())));
List<BizAgentApplicationLargeModelListDto> result = new ArrayList<>();
for (String owner : map.keySet()) {
BizAgentApplicationLargeModelListDto dto = new BizAgentApplicationLargeModelListDto();
dto.setOwner(owner);
dto.setModels(map.get(owner));
result.add(dto);
}
return result;
}
......@@ -159,7 +168,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override
public String createPreamble(AgentApplicationGCDto dto) throws Exception {
return agentApplicationInfoService.createPreamble(dto.getAgentTitle(), dto.getAgentDesc(),dto.getAgentSystem());
return agentApplicationInfoService.createPreamble(dto.getAgentTitle(), dto.getAgentDesc(), dto.getAgentSystem());
}
@Override
......
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