k.e.book.ddh.entity.CcNewsDO 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_news")
@ApiModel(value="CcNewsDO", description="CcNews")
public class CcNewsDO extends Model {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 标题
*/
@TableField("subject")
private String subject;
/**
* 类目
*/
@TableField("category_ids")
private String categoryIds;
/**
* 封面图
*/
@TableField("image")
private String image;
/**
* 内容
*/
@TableField("content")
private String content;
/**
* 浏览量
*/
@TableField("views")
private Integer views;
/**
* 创建时间
*/
@TableField("createtime")
private Integer createtime;
/**
* 更新时间
*/
@TableField("updatetime")
private Integer updatetime;
/**
* 状态:0=隐藏,1=已发布
*/
@TableField("status")
private Boolean status;
/**
* 标志
*/
@TableField("flag")
private String flag;
/**
* 权重
*/
@TableField("weigh")
private Integer weigh;
/**
* 否推送:0=否,1=是
*/
@TableField("is_push")
private Integer isPush;
/**
* 推送内容
*/
@TableField("min_content")
private String minContent;
/**
* 推送TAG
*/
@TableField("push_tags")
private String pushTags;
/**
* updatedAt
*/
@TableField("updated_at")
private Date updatedAt;
public static CcNewsVO toVO(CcNewsDO ccNewsDO) {
if(ccNewsDO == null){
return null;
}
CcNewsVO ccNewsVO = new CcNewsVO();
BeanUtils.copyProperties(ccNewsDO, ccNewsVO);
return ccNewsVO;
}
public static CcNewsDO toDO(CcNewsAddDTO ccNewsAddDTO) {
if (ccNewsAddDTO == null) {
return null;
}
CcNewsDO ccNewsDO = new CcNewsDO();
BeanUtils.copyProperties(ccNewsAddDTO, ccNewsDO);
return ccNewsDO;
}
}