kaiyu
2021-05-20 7537e950c29dd68a34f16cf1e841fa548c89d58d
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
package com.moral.api.pojo.form.version;
 
import com.moral.api.entity.Version;
import lombok.Data;
import org.springframework.util.ObjectUtils;
 
/**
 * @ClassName VersionUpdateForm
 * @Description TODO
 * @Author 陈凯裕
 * @Date 2021/5/20 11:26
 * @Version TODO
 **/
@Data
public class VersionUpdateForm {
 
    private Integer id;
 
    private String name;
 
    private String desc;
 
    public boolean valid() {
        if (ObjectUtils.isEmpty(id) ||
                (ObjectUtils.isEmpty(name) &&
                        ObjectUtils.isEmpty(desc))
                )
            return false;
        return true;
    }
 
    public Version formConvertEntity(){
        Version version = new Version();
        version.setId(id);
        version.setName(name);
        version.setDesc(desc);
        return version;
    }
}