package com.yuchen.saas.manage.system.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nest.springwrap.core.tenant.mp.TenantEntity;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author linyb
 * @since 2023-09-18
 */
@Data
@TableName("nest_feature")
@ApiModel(value="NestFeature对象", description="功能表")
public class NestFeature extends TenantEntity {


    /**
     * 父级功能
     */
    @ApiModelProperty(name = "parentId", value = "父级功能")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;
    /**
     * 排序
     */
    @ApiModelProperty(name = "sort", value = "排序")
    private Integer sort;
    /**
     * 备注
     */
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;
    /**
     * 功能类型
     */
    @ApiModelProperty(name = "type", value = "功能类型（1：业务功能，2：通用功能，3：默认功能，4：平台管理）",required = true)
    @NotNull(message = "功能类型不能为空")
    private String type;

    /**
     * 功能名称
     */
    @ApiModelProperty(name = "name", value = "功能名称",required = true)
    @NotNull(message = "功能名称不能为空")
    private String name;
    /**
     * 应用类型
     */
    @ApiModelProperty(name = "applyType", value = "应用类型（多个，号隔开）1：pcWEB端，2：PC客户端，3：移动APP端，4：微信小程序，5：微信公众号，6：支付宝小程序，7：支付宝商户号")
    private String applyType;

    /**
     * 功能编码
     */
    @ApiModelProperty(name = "featureCode", value = "功能编码")
    private String featureCode;

    /**
     * 应用id多个逗号隔开
     */
    @ApiModelProperty(name = "applyId", value = "应用id多个逗号隔开")
    private String applyId;
    /**
     * 是否权限分配（0：不可分配，1：可分配）
     */
    @ApiModelProperty(name = "permissionEnable", value = "是否权限分配（0：不可分配，1：可分配）",required = true)
    @NotNull(message = "是否权限分配不能为空")
    private String permissionEnable;
    @ApiModelProperty(name = "usingObjects", value = "使用对象（1：平台客户，2：平台组织）")
    private String usingObjects;
    @ApiModelProperty(name = "featureGroupId", value = "分组id")
    private Long featureGroupId;
    /**
     * 身份（admin：管理员，clerk：员工,operation：运营端）
     * @see org.nest.springwrap.core.secure.enums.IdEntityEnum
     */
    @ApiModelProperty(name = "idEntity", value = "身份（admin：管理员，clerk：员工,operation：运营端）")
    private String idEntity;
    @TableField(exist = false)
    @ApiModelProperty(name = "featureGroupName", value = "分组名称")
    private String featureGroupName;
    @TableField(exist = false)
    @ApiModelProperty(name = "businessName", value = "业务名称")
    private String businessName;

    @TableField(exist = false)
    @ApiModelProperty(name = "businessId", value = "业务id（多个的话逗号隔开）")
    private String businessId;

    @TableField(exist = false)
    @ApiModelProperty(name = "updateUserName", value = "最近操作人姓名")
    private String updateUserName;

    @TableField(exist = false)
    @ApiModelProperty(name = "apiPaths", value = "接口地址数组")
    private List<String> apiPaths;

    /**
     * org创建人
     */
    @ApiModelProperty(name = "createOrgUser", value = "org创建人")
    private Long createOrgUser;
    /**
     * org修改人
     */
    @ApiModelProperty(name = "updateOrgUser", value = "org修改人")
    private Long updateOrgUser;
}
