package com.heketai.website.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * <p>
 * 产品应用表
 * </p>
 *
 * @author xjl
 * @since 2019-12-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Application extends Model<Application> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 上级id
     */
    @TableField("parent_id")
    private Integer parentId;

    /**
     * 层级  1 一级 2 二级
     */
    private Integer level;

    /**
     * 图片
     */
    private String img;

    /**
     * 名称
     */
    @TableField("name_ch")
    private String nameCh;

    /**
     * 名称
     */
    @TableField("name_en")
    private String nameEn;

    @TableField("create_time")


    private Date createTime;

    @TableField("update_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Application{" +
        "id=" + id +
        ", parentId=" + parentId +
        ", level=" + level +
        ", img=" + img +
        ", nameCh=" + nameCh +
        ", nameEn=" + nameEn +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        "}";
    }
}
