package com.bizzan.bitrade.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.util.Date;

/**
 * 帮助文章分类枚举表
 */
@Entity
@Data
@Table(name = "sys_help_category")
public class SysHelpCategory {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 分类编码（唯一英文标识，业务方通过此字段查询） */
    @Column(nullable = false, unique = true, length = 50)
    private String code;

    /** 中文名称 */
    @Column(name = "name_zh", nullable = false, length = 100)
    private String nameZh;

    /** 英文名称 */
    @Column(name = "name_en", nullable = false, length = 100)
    private String nameEn;

    /** 适用场景: HELP=帮助中心, PROTOCOL=协议展示, NOTICE=公告 */
    @Column(nullable = false, length = 50)
    private String scene = "HELP";

    /** 排序值，越大越靠前 */
    @Column(nullable = false)
    private Integer sort = 0;

    /** 状态: 1=启用, 0=禁用 */
    @Column(nullable = false)
    private Integer status = 1;

    /** 备注 */
    private String remark;

    @CreationTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "create_time", updatable = false)
    private Date createTime;

    @UpdateTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "update_time")
    private Date updateTime;
}
