k.e.book.ddh.entity.CcUserTokenDO 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_user_token")
@ApiModel(value="CcUserTokenDO", description="CcUserToken")
public class CcUserTokenDO extends Model {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* Token
*/
@TableField("token")
private String token;
/**
* 会员ID
*/
@TableField("user_id")
private Integer userId;
/**
* loginIp
*/
@TableField("login_ip")
private String loginIp;
/**
* 创建时间
*/
@TableField("createtime")
private Long createtime;
/**
* 过期时间
*/
@TableField("expiretime")
private Long expiretime;
/**
* createdAt
*/
@TableField("created_at")
private Date createdAt;
/**
* updatedAt
*/
@TableField("updated_at")
private Date updatedAt;
/**
* deletedAt
*/
@TableField("deleted_at")
private Date deletedAt;
public static CcUserTokenVO toVO(CcUserTokenDO ccUserTokenDO) {
if(ccUserTokenDO == null){
return null;
}
CcUserTokenVO ccUserTokenVO = new CcUserTokenVO();
BeanUtils.copyProperties(ccUserTokenDO, ccUserTokenVO);
return ccUserTokenVO;
}
public static CcUserTokenDO toDO(CcUserTokenAddDTO ccUserTokenAddDTO) {
if (ccUserTokenAddDTO == null) {
return null;
}
CcUserTokenDO ccUserTokenDO = new CcUserTokenDO();
BeanUtils.copyProperties(ccUserTokenAddDTO, ccUserTokenDO);
return ccUserTokenDO;
}
}