2022-05-18 17:57:03 +08:00
|
|
|
package request
|
|
|
|
|
|
|
|
// UserAddReq 创建资源结构体
|
|
|
|
type UserAddReq struct {
|
|
|
|
Username string `json:"username" validate:"required,min=2,max=20"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Nickname string `json:"nickname" validate:"required,min=0,max=20"`
|
|
|
|
GivenName string `json:"givenName" validate:"min=0,max=20"`
|
2022-06-02 11:05:55 +08:00
|
|
|
Mail string `json:"mail" validate:"required,min=0,max=100"`
|
2022-05-18 17:57:03 +08:00
|
|
|
JobNumber string `json:"jobNumber" validate:"required,min=0,max=20"`
|
|
|
|
PostalAddress string `json:"postalAddress" validate:"min=0,max=255"`
|
|
|
|
Departments string `json:"departments" validate:"min=0,max=255"`
|
|
|
|
Position string `json:"position" validate:"min=0,max=255"`
|
|
|
|
Mobile string `json:"mobile" validate:"required,checkMobile"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Introduction string `json:"introduction" validate:"min=0,max=255"`
|
|
|
|
Status uint `json:"status" validate:"oneof=1 2"`
|
2022-05-31 14:08:56 +08:00
|
|
|
DepartmentId []uint `json:"departmentId" validate:"required"`
|
2022-05-28 22:22:36 +08:00
|
|
|
Source string `json:"source" validate:"min=0,max=20"`
|
2022-05-18 17:57:03 +08:00
|
|
|
RoleIds []uint `json:"roleIds" validate:"required"`
|
|
|
|
}
|
|
|
|
|
2022-06-02 11:05:55 +08:00
|
|
|
// DingUserAddReq 钉钉用户创建资源结构体
|
|
|
|
type DingUserAddReq struct {
|
|
|
|
Username string `json:"username" validate:"required,min=2,max=20"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Nickname string `json:"nickname" validate:"required,min=0,max=20"`
|
|
|
|
GivenName string `json:"givenName" validate:"min=0,max=20"`
|
|
|
|
Mail string `json:"mail" validate:"required,min=0,max=100"`
|
|
|
|
JobNumber string `json:"jobNumber" validate:"required,min=0,max=20"`
|
|
|
|
PostalAddress string `json:"postalAddress" validate:"min=0,max=255"`
|
|
|
|
Departments string `json:"departments" validate:"min=0,max=255"`
|
|
|
|
Position string `json:"position" validate:"min=0,max=255"`
|
|
|
|
Mobile string `json:"mobile" validate:"required,checkMobile"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Introduction string `json:"introduction" validate:"min=0,max=255"`
|
|
|
|
Status uint `json:"status" validate:"oneof=1 2"`
|
|
|
|
DepartmentId []uint `json:"departmentId" validate:"required"`
|
|
|
|
Source string `json:"source" validate:"min=0,max=20"`
|
|
|
|
RoleIds []uint `json:"roleIds" validate:"required"`
|
|
|
|
SourceUserId string `json:"sourceUserId"` // 第三方用户id
|
|
|
|
SourceUnionId string `json:"sourceUnionId"` // 第三方唯一unionId
|
|
|
|
}
|
|
|
|
|
2022-06-18 17:09:14 +08:00
|
|
|
// WeComUserAddReq 企业微信用户创建资源结构体
|
|
|
|
type WeComUserAddReq struct {
|
|
|
|
Username string `json:"username" validate:"required,min=2,max=20"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Nickname string `json:"nickname" validate:"required,min=0,max=20"`
|
|
|
|
GivenName string `json:"givenName" validate:"min=0,max=20"`
|
|
|
|
Mail string `json:"mail" validate:"required,min=0,max=100"`
|
|
|
|
JobNumber string `json:"jobNumber" validate:"required,min=0,max=20"`
|
|
|
|
PostalAddress string `json:"postalAddress" validate:"min=0,max=255"`
|
|
|
|
Departments string `json:"departments" validate:"min=0,max=255"`
|
|
|
|
Position string `json:"position" validate:"min=0,max=255"`
|
|
|
|
Mobile string `json:"mobile" validate:"required,checkMobile"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Introduction string `json:"introduction" validate:"min=0,max=255"`
|
|
|
|
Status uint `json:"status" validate:"oneof=1 2"`
|
|
|
|
DepartmentId []uint `json:"departmentId" validate:"required"`
|
|
|
|
Source string `json:"source" validate:"min=0,max=20"`
|
|
|
|
RoleIds []uint `json:"roleIds" validate:"required"`
|
|
|
|
SourceUserId string `json:"sourceUserId"` // 第三方用户id
|
|
|
|
SourceUnionId string `json:"sourceUnionId"` // 第三方唯一unionId
|
|
|
|
}
|
|
|
|
|
2022-05-18 17:57:03 +08:00
|
|
|
// UserUpdateReq 更新资源结构体
|
|
|
|
type UserUpdateReq struct {
|
|
|
|
ID uint `json:"id" validate:"required"`
|
2022-05-28 22:22:36 +08:00
|
|
|
Username string `json:"username" validate:"required,min=2,max=20"`
|
2022-05-18 17:57:03 +08:00
|
|
|
Nickname string `json:"nickname" validate:"min=0,max=20"`
|
|
|
|
GivenName string `json:"givenName" validate:"min=0,max=20"`
|
2022-06-02 11:05:55 +08:00
|
|
|
Mail string `json:"mail" validate:"min=0,max=100"`
|
2022-05-18 17:57:03 +08:00
|
|
|
JobNumber string `json:"jobNumber" validate:"min=0,max=20"`
|
|
|
|
PostalAddress string `json:"postalAddress" validate:"min=0,max=255"`
|
|
|
|
Departments string `json:"departments" validate:"min=0,max=255"`
|
|
|
|
Position string `json:"position" validate:"min=0,max=255"`
|
|
|
|
Mobile string `json:"mobile" validate:"checkMobile"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Introduction string `json:"introduction" validate:"min=0,max=255"`
|
2022-05-31 14:08:56 +08:00
|
|
|
DepartmentId []uint `json:"departmentId" validate:"required"`
|
2022-05-28 22:22:36 +08:00
|
|
|
Source string `json:"source" validate:"min=0,max=20"`
|
2022-05-18 17:57:03 +08:00
|
|
|
RoleIds []uint `json:"roleIds" validate:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserDeleteReq 批量删除资源结构体
|
|
|
|
type UserDeleteReq struct {
|
|
|
|
UserIds []uint `json:"userIds" validate:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserChangePwdReq 修改密码结构体
|
|
|
|
type UserChangePwdReq struct {
|
|
|
|
OldPassword string `json:"oldPassword" validate:"required"`
|
|
|
|
NewPassword string `json:"newPassword" validate:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserChangeUserStatusReq 修改用户状态结构体
|
|
|
|
type UserChangeUserStatusReq struct {
|
|
|
|
ID uint `json:"id" validate:"required"`
|
|
|
|
Status uint `json:"status" validate:"oneof=1 2"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserGetUserInfoReq 获取用户信息结构体
|
|
|
|
type UserGetUserInfoReq struct {
|
|
|
|
}
|
|
|
|
|
2022-06-18 17:09:14 +08:00
|
|
|
// SyncDingUserReq 同步钉钉用户信息
|
2022-06-02 11:05:55 +08:00
|
|
|
type SyncDingUserReq struct {
|
|
|
|
}
|
|
|
|
|
2022-06-18 17:09:14 +08:00
|
|
|
// SyncWeComUserReq 同步企业微信用户信息
|
|
|
|
type SyncWeComUserReq struct {
|
|
|
|
}
|
|
|
|
|
2022-06-21 20:50:38 +08:00
|
|
|
// SyncFeiShuUserReq 同步飞书用户信息
|
|
|
|
type SyncFeiShuUserReq struct {
|
|
|
|
}
|
|
|
|
|
2022-07-10 11:01:27 +08:00
|
|
|
// SyncOpenLdapUserReq 同步ldap用户信息
|
|
|
|
type SyncOpenLdapUserReq struct {
|
|
|
|
}
|
2023-02-22 22:16:13 +08:00
|
|
|
type SyncSqlUserReq struct {
|
|
|
|
UserIds []uint `json:"userIds" validate:"required"`
|
|
|
|
}
|
2022-07-10 11:01:27 +08:00
|
|
|
|
2022-05-18 17:57:03 +08:00
|
|
|
// UserListReq 获取用户列表结构体
|
|
|
|
type UserListReq struct {
|
2022-05-28 22:22:36 +08:00
|
|
|
Username string `json:"username" form:"username"`
|
|
|
|
Mobile string `json:"mobile" form:"mobile" `
|
|
|
|
Nickname string `json:"nickname" form:"nickname"`
|
|
|
|
GivenName string `json:"givenName" form:"givenName"`
|
2022-05-31 14:08:56 +08:00
|
|
|
DepartmentId []uint `json:"departmentId" form:"departmentId"`
|
2022-05-28 22:22:36 +08:00
|
|
|
Status uint `json:"status" form:"status" `
|
2023-02-22 22:16:13 +08:00
|
|
|
SyncState uint `json:"syncState" form:"syncState" `
|
2022-05-28 22:22:36 +08:00
|
|
|
PageNum int `json:"pageNum" form:"pageNum"`
|
|
|
|
PageSize int `json:"pageSize" form:"pageSize"`
|
2022-05-18 17:57:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// RegisterAndLoginReq 用户登录结构体
|
|
|
|
type RegisterAndLoginReq struct {
|
|
|
|
Username string `form:"username" json:"username" binding:"required"`
|
|
|
|
Password string `form:"password" json:"password" binding:"required"`
|
|
|
|
}
|