diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java index 52f2527..0f0ea00 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java @@ -29,6 +29,7 @@ import com.biutag.lan.flow.node.FirstSignFlow; import com.biutag.lan.mapper.MailMapper; import com.biutag.lan.mapper.MailSourceMapper; import com.biutag.lan.mapper.WorkMapper; +import com.biutag.lan.validate.commons.MailIdValidate; import jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -455,9 +456,6 @@ public class MailService extends ServiceImpl { } public boolean delete(MailIdValidate mailId) { - if (mailId.getId()==null || mailId.getId().equals("")){ - return false; - } Mail mail = baseMapper.selectById(mailId.getId()); if (mailId.getId()!=null||!mailId.getId().equals("")){ if (mail.getFlowKey().equals(FlowNodeEnum.FIRST_SIGN.getKey())||mail.getFlowKey().equals(FlowNodeEnum.FIRST_DISTRIBUTE.getKey())){ diff --git a/mailbox-lan/src/main/java/com/biutag/lan/validate/commons/MailIdValidate.java b/mailbox-lan/src/main/java/com/biutag/lan/validate/commons/MailIdValidate.java new file mode 100644 index 0000000..9fd3010 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/validate/commons/MailIdValidate.java @@ -0,0 +1,19 @@ +package com.biutag.lan.validate.commons; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + + +import java.io.Serializable; + +@Data +@ApiModel("ID参数") +public class MailIdValidate implements Serializable { + + private static final long serialVersionUID = 1L; + @NotBlank + @ApiModelProperty(value = "ID", required = true) + private String id; + +}