package com.sy.coinage.sys.req;

import com.sy.coinage.core.interceptor.Update;
import com.sy.coinage.sys.vo.MenuPermissionVO;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.List;

import org.hibernate.validator.constraints.Range;

/**
 * 添加请求bean
 */
@Data
public class MenuReq implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 自增主键
     */
    @ApiModelProperty(value = "自增主键")
    @NotNull(message = "自增主键不能为空", groups = {Update.class})
    @Range(min = 1, groups = {Update.class})
    private Integer id;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sorted;
    /**
     * 上级id -10
     */
    @ApiModelProperty(value = "上级id")
    private Integer pid;
    /**
     * 名称 -10
     */
    @ApiModelProperty(value = "名称")
    @Length(max = 100, message = "名称长度不正确")
    private String name;
    /**
     * 图标 -20
     */
    @ApiModelProperty(value = "图标")
    @Length(max = 100, message = "图标长度不正确")
    private String icon;
    /**
     * 组件 -50
     */
    @ApiModelProperty(value = "组件")
    @Length(max = 50, message = "组件长度不正确")
    private String component;
    /**
     * 重定向 -50
     */
    @ApiModelProperty(value = "重定向")
    @Length(max = 50, message = "重定向长度不正确")
    private String redirect;
    /**
     * 隐藏菜单 -3
     */
    @ApiModelProperty(value = "隐藏菜单")
    private Boolean hideMenu;
    /**
     * 标题 -20
     */
    @ApiModelProperty(value = "标题")
    @NotBlank(message = "标题不能为空")
    @Length(max = 20, message = "标题长度不正确")
    private String title;
    /**
     * 路径 -50
     */
    // @NotBlank(message = "path不能为空")
    @ApiModelProperty(value = "路径")
    @Length(max = 50, message = "路径长度不正确")
    private String path;

    @ApiModelProperty(value = "按钮操作权限集合")
    private List<MenuPermissionVO> permissionList;

}

