找回密码
 立即注册
查看: 61|回复: 0

实体枚举类案例

[复制链接]

176

主题

5

精华

180

金币

技术维护QQ:515138

积分
385
发表于 6 天前 | 显示全部楼层 |阅读模式
  1. package com.heima.model.wemedia.pojos;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import lombok.Data;
  7. import org.apache.ibatis.type.Alias;
  8. import java.io.Serializable;
  9. import java.util.Date;
  10. /**
  11. * <p>
  12. * 自媒体图文内容信息表
  13. * </p>
  14. *
  15. * @author itheima
  16. */
  17. @Data
  18. @TableName("wm_news")
  19. public class WmNews implements Serializable {
  20.     private static final long serialVersionUID = 1L;
  21.     /**
  22.      * 主键
  23.      */
  24.     @TableId(value = "id", type = IdType.AUTO)
  25.     private Integer id;
  26.     /**
  27.      * 自媒体用户ID
  28.      */
  29.     @TableField("user_id")
  30.     private Integer userId;
  31.     /**
  32.      * 标题
  33.      */
  34.     @TableField("title")
  35.     private String title;
  36.     /**
  37.      * 图文内容
  38.      */
  39.     @TableField("content")
  40.     private String content;
  41.     /**
  42.      * 文章布局
  43.             0 无图文章
  44.             1 单图文章
  45.             3 多图文章
  46.      */
  47.     @TableField("type")
  48.     private Short type;
  49.     /**
  50.      * 图文频道ID
  51.      */
  52.     @TableField("channel_id")
  53.     private Integer channelId;
  54.     @TableField("labels")
  55.     private String labels;
  56.     /**
  57.      * 创建时间
  58.      */
  59.     @TableField("created_time")
  60.     private Date createdTime;
  61.     /**
  62.      * 提交时间
  63.      */
  64.     @TableField("submited_time")
  65.     private Date submitedTime;
  66.     /**
  67.      * 当前状态
  68.             0 草稿
  69.             1 提交(待审核)
  70.             2 审核失败
  71.             3 人工审核
  72.             4 人工审核通过
  73.             8 审核通过(待发布)
  74.             9 已发布
  75.      */
  76.     @TableField("status")
  77.     private Short status;
  78.     /**
  79.      * 定时发布时间,不定时则为空
  80.      */
  81.     @TableField("publish_time")
  82.     private Date publishTime;
  83.     /**
  84.      * 拒绝理由
  85.      */
  86.     @TableField("reason")
  87.     private String reason;
  88.     /**
  89.      * 发布库文章ID
  90.      */
  91.     @TableField("article_id")
  92.     private Long articleId;
  93.     /**
  94.      * //图片用逗号分隔
  95.      */
  96.     @TableField("images")
  97.     private String images;
  98.     @TableField("enable")
  99.     private Short enable;
  100.    
  101.      //状态枚举类
  102.     @Alias("WmNewsStatus")
  103.     public enum Status{
  104.         NORMAL((short)0),SUBMIT((short)1),FAIL((short)2),ADMIN_AUTH((short)3),ADMIN_SUCCESS((short)4),SUCCESS((short)8),PUBLISHED((short)9);
  105.         short code;
  106.         Status(short code){
  107.             this.code = code;
  108.         }
  109.         public short getCode(){
  110.             return this.code;
  111.         }
  112.     }
  113. }
复制代码





上一篇:OpenFeign
网站建设,公众号小程序开发,系统定制,软件App开发,技术维护【联系我们】手机/微信:17817817816 QQ:515138

QQ|Archiver|自丢网 ( 粤ICP备2024252464号-1 )

GMT+8, 2026-2-1 19:50

专注于网站建设,公众号小程序制作,商城小程序,系统定制,软件App开发

【联系我们】手机/微信:17817817816 QQ:515138

快速回复 返回顶部 返回列表