role_user_query.go 561 字节
package command

import "github.com/beego/beego/v2/core/validation"

// UserRoleQueryCommand 角色中的用户
type UserRoleQueryCommand struct {
	CompanyId  int64 `cname:"公司ID" json:"companyId"`
	RoleId     int64 `cname:"角色ID" json:"roleId,string" valid:"Required"`
	PageNumber int   `cname:"分页页码" json:"pageNumber"`
	PageSize   int   `cname:"分页数量" json:"pageSize"`
}

func (in *UserRoleQueryCommand) Valid(validation *validation.Validation) {
	if in.CompanyId == 0 {
		validation.SetError("companyId", "公司ID无效")
		return
	}
}