修改应用中心的应用分类
This commit is contained in:
parent
5b4c00053d
commit
b276a4206c
@ -67,8 +67,8 @@ public class ApplicationController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:application:query')")
|
||||
public CommonResult<ApplicationRespVO> getApplication(@RequestParam("id") Long id) {
|
||||
ApplicationDO application = applicationService.getApplication(id);
|
||||
return success(BeanUtils.toBean(application, ApplicationRespVO.class));
|
||||
ApplicationRespVO application = applicationService.getApplication(id);
|
||||
return success(application);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
|
@ -35,6 +35,9 @@ public class ApplicationRespVO {
|
||||
@ExcelProperty("应用标签,保存多个标签ID,用逗号分隔")
|
||||
private String appLabel;
|
||||
|
||||
@Schema(description = "应用标签,保存多个标签名称,用逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String appLabelName;
|
||||
|
||||
@Schema(description = "模型服务,模型服务ID")
|
||||
@ExcelProperty("模型服务,模型服务ID")
|
||||
private Long appModel;
|
||||
|
@ -42,7 +42,7 @@ public interface ApplicationService {
|
||||
* @param id 编号
|
||||
* @return 大模型应用
|
||||
*/
|
||||
ApplicationDO getApplication(Long id);
|
||||
ApplicationRespVO getApplication(Long id);
|
||||
|
||||
/**
|
||||
* 获得大模型应用分页
|
||||
|
@ -79,17 +79,18 @@ public class ApplicationServiceImpl implements ApplicationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationDO getApplication(Long id) {
|
||||
public ApplicationRespVO getApplication(Long id) {
|
||||
ApplicationDO applicationDO = applicationMapper.selectById(id);
|
||||
if (applicationDO.getAppLabel() != null && !applicationDO.getAppLabel().equals("")) {
|
||||
String[] split = applicationDO.getAppLabel().split(",");
|
||||
ApplicationRespVO bean = BeanUtils.toBean(applicationDO, ApplicationRespVO.class);
|
||||
if (bean.getAppLabel() != null && !bean.getAppLabel().equals("")) {
|
||||
String[] split = bean.getAppLabel().split(",");
|
||||
LambdaQueryWrapper<LabelDO> wrapper = new LambdaQueryWrapper<LabelDO>()
|
||||
.in(LabelDO::getId, split);
|
||||
List<LabelDO> labelDOS = labelMapper.selectList(wrapper);
|
||||
List<String> collect = labelDOS.stream().map(LabelDO::getLabelName).collect(Collectors.toList());
|
||||
applicationDO.setAppLabel(String.join(",", collect));
|
||||
bean.setAppLabelName(String.join(",", collect));
|
||||
}
|
||||
return applicationDO;
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +134,7 @@ public class ApplicationServiceImpl implements ApplicationService {
|
||||
.in(LabelDO::getId, split);
|
||||
List<LabelDO> labelDOS = labelMapper.selectList(wrapper);
|
||||
List<String> collect = labelDOS.stream().map(LabelDO::getLabelName).collect(Collectors.toList());
|
||||
applicationRespVO.setAppLabel(String.join(",", collect));
|
||||
applicationRespVO.setAppLabelName(String.join(",", collect));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user