package com.ycl.domain.form; import com.ycl.common.group.Update; import com.ycl.common.group.Add; import com.ycl.system.domain.base.AbsForm; import com.ycl.domain.entity.Report; import org.springframework.beans.BeanUtils; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import org.springframework.lang.NonNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * 表单 * * @author zxl * @since 2025-12-18 */ @Data @ApiModel(value = "Report表单", description = "表单") public class ReportForm extends AbsForm { @NotBlank(message = "不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("") private String content; @NotNull private String projectName; @NotNull(message = "不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("") private Long projectId; private String[] fileUrl; public static Report getEntityByForm(@NonNull ReportForm form, Report entity) { if(entity == null) { entity = new Report(); } BeanUtils.copyProperties(form, entity); return entity; } }