package com.heketai.website.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author xjl
 * @since 2019-11-13
 */
@TableName("sys_menu")
@Data
@EqualsAndHashCode(callSuper=true)
public class SysMenu extends Model<SysMenu> {
    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("菜单父id（0：自己为菜单顶级）")
    private Integer parentId;

    @ApiModelProperty("角色名")
    private String menuName;

    @ApiModelProperty("角色描述")
    private String description;

    @ApiModelProperty("菜单图标")
    private String img;

    @ApiModelProperty("菜单排序")
    private Integer sort;

    @ApiModelProperty("创建时间")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;

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

}
