xiangpei
7 天以前 56224037cde5a381dbdce941bfc3a4f555584e3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package cn.lili.modules.lmk.domain.form;
 
import cn.lili.group.Update;
import cn.lili.group.Add;
import cn.lili.base.AbsForm;
import cn.lili.modules.lmk.domain.entity.Share;
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 xp
 * @since 2025-06-16
 */
@Data
@ApiModel(value = "Share表单", description = "分享记录表单")
public class ShareForm extends AbsForm {
 
    @NotBlank(message = "业务类型不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("哪个业务的分享")
    private String shareType;
 
    @NotBlank(message = "业务id不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("业务id")
    private String refId;
 
    @NotBlank(message = "分享人不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("分享人")
    private String shareUser;
 
    @ApiModelProperty("分享时间")
    private Date shareTime;
 
    public static Share getEntityByForm(@NonNull ShareForm form, Share entity) {
        if(entity == null) {
          entity = new Share();
        }
        BeanUtils.copyProperties(form, entity);
        return entity;
    }
 
}