feat(resource): 增加模型类型字段

master
yang 2025-02-05 15:20:45 +08:00
parent bb64605dc4
commit 0d9a485c19
3 changed files with 17 additions and 5 deletions

View File

@ -47,10 +47,10 @@ public class ModelProduct extends BaseEntity {
@ApiModelProperty(value = "用户id")
private Long userId;
/**
* ID
*
*/
@ApiModelProperty(value = "模型类型ID")
private Long modelTypeId;
@ApiModelProperty(value = "模型类型")
private Long modelType;
/**
*
*/

View File

@ -10,13 +10,18 @@ public class ModelVo {
/**
* id
*/
@ApiModelProperty(value = "模型id", required = true)
@ApiModelProperty(value = "模型id")
private Long id;
/**
*
*/
@ApiModelProperty(value = "模型名称", required = true)
@ApiModelProperty(value = "模型名称")
private String modelName;
/**
*
*/
@ApiModelProperty(value = "模型类型")
private String modelType;
/**
*
*/

View File

@ -155,6 +155,13 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
for (ModelProduct modelImage : modelImageList) {
ModelVo modelVo = new ModelVo();
BeanUtil.copyProperties(modelImage, modelVo);
// 设置模型类型
if (Objects.nonNull(modelImage.getModelType())) {
String modelTypeName = DictInit.getDictValue(DictConstants.MODEL_CATEGORY, modelImage.getModelType().toString());
modelVo.setModelType(modelTypeName);
}
// 获取用户信息
SysUser sysUser = sysUserService.selectUserById(modelImage.getUserId());
if (Objects.isNull(sysUser)) {