feat(REQ-3383) - 完善 API 模型的入参校验
This commit is contained in:
parent
46597dc64b
commit
7b6b92242a
@ -15,6 +15,7 @@ import lombok.NoArgsConstructor;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -54,9 +55,11 @@ public class BpmnProcessInstanceCancelDTO {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5)}
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.workflow.common.model.request.bpmn.process;
|
||||
|
||||
import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
|
||||
import cn.axzo.workflow.common.constraint.AttachmentValidator;
|
||||
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -11,6 +14,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -43,6 +47,12 @@ public class BpmnProcessInstanceCarbonCopyDTO {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.workflow.common.model.request.bpmn.task;
|
||||
|
||||
import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
|
||||
import cn.axzo.workflow.common.constraint.AttachmentValidator;
|
||||
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
|
||||
import cn.axzo.workflow.common.enums.BpmnFlowNodeType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -12,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -41,6 +45,12 @@ public class BpmnTaskAuditDTO {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.workflow.common.model.request.bpmn.task;
|
||||
|
||||
import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
|
||||
import cn.axzo.workflow.common.constraint.AttachmentValidator;
|
||||
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -11,6 +14,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ -60,6 +64,12 @@ public class BpmnTaskCommentDTO implements Serializable {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
@Valid
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.workflow.common.model.request.bpmn.task;
|
||||
|
||||
import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
|
||||
import cn.axzo.workflow.common.constraint.AttachmentValidator;
|
||||
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
|
||||
import cn.axzo.workflow.common.enums.BpmnCountersignTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -11,6 +14,7 @@ import lombok.experimental.Accessors;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ -58,6 +62,12 @@ public class BpmnTaskCountersignDTO implements Serializable {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.workflow.common.model.request.bpmn.task;
|
||||
|
||||
import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
|
||||
import cn.axzo.workflow.common.constraint.AttachmentValidator;
|
||||
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -9,6 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ -44,6 +48,12 @@ public class BpmnTaskTransferDTO implements Serializable {
|
||||
* 附件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
@Size(max = 11, message = "附件数量超过限制")
|
||||
@AttachmentValidator(types = {
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
|
||||
@AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
|
||||
)
|
||||
private List<AttachmentDTO> attachmentList;
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user