package cn.stylefeng.team.portal.modular.management.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import cn.stylefeng.roses.kernel.sys.api.format.UserNameFormatProcess;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@TableName(value = "portal_design_manager", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class PortalDesignManager extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long id;

    @TableField("design_id")
    @ChineseDescription("门户设计id")
    private Long designId;

    @TableField("manager_user_id")
    @ChineseDescription("管理员用户id")
    @SimpleFieldFormat(processClass = UserNameFormatProcess.class)
    private Long managerUserId;

    @TableField(value = "auth_type_list", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("管理员权限列表，数组，包含：design-拖拽布局配置，content-新闻、轮播图和应用链接维护，admin-管理员权限")
    private List<String> authTypeList;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户id")
    private Long tenantId;

}