add - 新增模型分页查询入参,支持业务上下架
This commit is contained in:
parent
146a2b5e8e
commit
aaf3705630
@ -3,6 +3,7 @@ package cn.axzo.workflow.common.model.response.form.model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -14,6 +15,7 @@ import java.util.Date;
|
||||
*/
|
||||
@ApiModel("基础的表单模型响应模型")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class FormModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "模型 ID")
|
||||
@ -40,4 +42,7 @@ public class FormModelBaseVO {
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateAt;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
|
||||
import org.flowable.engine.repository.Model;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -28,8 +29,19 @@ public interface FormModelConverter extends EntityConverter<FormModelBaseVO, Mod
|
||||
@Mapping(target = "category", source = "entity.category")
|
||||
@Mapping(target = "tenantId", source = "entity.tenantId")
|
||||
@Mapping(target = "version", source = "entity.version")
|
||||
@Mapping(target = "status", expression = "java(convertStatus(entity.getDeploymentId()))")
|
||||
@Mapping(target = "createAt", source = "entity.createTime")
|
||||
@Mapping(target = "updateAt", source = "entity.lastUpdateTime")
|
||||
FormModelBaseVO toVo(Model entity);
|
||||
|
||||
/**
|
||||
* 根据 deploymentId 计算模型状态
|
||||
*
|
||||
* @param deploymentId
|
||||
* @return
|
||||
*/
|
||||
default Integer convertStatus(String deploymentId) {
|
||||
return StringUtils.hasLength(deploymentId) ? 1 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user