New file |
| | |
| | | package com.ycl.platform.domain.form; |
| | | |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import com.ycl.platform.base.AbsForm; |
| | | import com.ycl.platform.domain.entity.DefaultRule; |
| | | import java.time.LocalDateTime; |
| | | import org.springframework.beans.BeanUtils; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 违约规则表单 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-05 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "DefaultRule表单", description = "违约规则表单") |
| | | public class DefaultRuleForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "规则名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("规则名称") |
| | | private String ruleName; |
| | | |
| | | @NotBlank(message = "规则设置不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("规则详情JSON") |
| | | private String ruleDetail; |
| | | |
| | | @ApiModelProperty("规则描述") |
| | | private String ruleDesc; |
| | | |
| | | public static DefaultRule getEntityByForm(@NonNull DefaultRuleForm form, DefaultRule entity) { |
| | | if(entity == null) { |
| | | entity = new DefaultRule(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |