department_user.go
798 字节
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
//获取自定义菜单列表
type DepartmentsUsersQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 类型0:部门用户列表 1:全部用户列表(不包含部门)
Type int `json:"type"`
}
func (departmentsUsersQuery *DepartmentsUsersQuery) Valid(validation *validation.Validation) {
}
func (departmentsUsersQuery *DepartmentsUsersQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(departmentsUsersQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}