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; 
 | 
    } 
 | 
} 
 |