package com.qmth.sop.business.bean.params;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.annotation.EditKey;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @Description: 用户角色权限编辑参数
 * @Author: CaoZixuan
 * @Date: 2022-12-06
 */
public class SysRolePrivilegeParam implements Serializable {

    @ApiModelProperty("角色id")
    @JsonSerialize(using = ToStringSerializer.class)
    @EditKey
    private Long id;

    @ApiModelProperty("角色名称")
    @NotNull(message = "请输入角色名称")
    @Length(min = 1, message = "请输入角色名称")
    private String name;

    @ApiModelProperty("权限id数组")
    @NotEmpty(message = "权限集合不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private List<Long> privilegeIds;

    public SysRolePrivilegeParam() {

    }

    public SysRolePrivilegeParam(Long id, String name, List<Long> privilegeIds) {
        this.id = id;
        this.name = name;
        this.privilegeIds = privilegeIds;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Long> getPrivilegeIds() {
        return privilegeIds;
    }

    public void setPrivilegeIds(List<Long> privilegeIds) {
        this.privilegeIds = privilegeIds;
    }
}
