k.e.book.ddh.entity.CcAdminDO Maven / Gradle / Ivy
package k.e.book.ddh.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;
import java.io.Serializable;
import java.util.Date;
/**
* @author kk
* @date 2023-05-21 11:01
*/
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("cc_admin")
@ApiModel(value="CcAdminDO", description="CcAdmin")
public class CcAdminDO extends Model {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 用户名
*/
@TableField("username")
private String username;
/**
* 昵称
*/
@TableField("nickname")
private String nickname;
/**
* 密码
*/
@TableField("password")
private String password;
/**
* 密码盐
*/
@TableField("salt")
private String salt;
/**
* 头像
*/
@TableField("avatar")
private String avatar;
/**
* 电子邮箱
*/
@TableField("email")
private String email;
/**
* 手机号码
*/
@TableField("mobile")
private String mobile;
/**
* 失败次数
*/
@TableField("loginfailure")
private Integer loginfailure;
/**
* 登录时间
*/
@TableField("logintime")
private Long logintime;
/**
* 登录IP
*/
@TableField("loginip")
private String loginip;
/**
* 创建时间
*/
@TableField("createtime")
private Long createtime;
/**
* 更新时间
*/
@TableField("updatetime")
private Long updatetime;
/**
* Session标识
*/
@TableField("token")
private String token;
/**
* 状态
*/
@TableField("status")
private String status;
public static CcAdminVO toVO(CcAdminDO ccAdminDO) {
if(ccAdminDO == null){
return null;
}
CcAdminVO ccAdminVO = new CcAdminVO();
BeanUtils.copyProperties(ccAdminDO, ccAdminVO);
return ccAdminVO;
}
public static CcAdminDO toDO(CcAdminAddDTO ccAdminAddDTO) {
if (ccAdminAddDTO == null) {
return null;
}
CcAdminDO ccAdminDO = new CcAdminDO();
BeanUtils.copyProperties(ccAdminAddDTO, ccAdminDO);
return ccAdminDO;
}
}