feat: 统一sql命名、函数命名
This commit is contained in:
38
internal/model/request/user.go
Normal file
38
internal/model/request/user.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"server/internal/model/common"
|
||||
"server/internal/pkg/validator"
|
||||
)
|
||||
|
||||
type CreateUserRequest struct {
|
||||
Username string `json:"username" validate:"required,min=1,max=50"`
|
||||
Account string `json:"account" validate:"required,min=5,max=100"`
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
AvatarID *int32 `json:"avatar_id" validate:"omitempty"`
|
||||
Status *int16 `json:"status" validate:"oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateUserRequest struct {
|
||||
Username *string `json:"username" validate:"omitempty,min=1,max=50"`
|
||||
AvatarID validator.NullInt32 `json:"avatar_id" validate:"omitempty"`
|
||||
Status *int16 `json:"status" validate:"omitempty,oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateUserPassword struct {
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
}
|
||||
|
||||
type SetUserRolesRequest struct {
|
||||
RoleIDs []int32 `json:"role_ids" validate:"required,dive,gt=0"`
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
Account string `json:"account" validate:"required,min=5,max=100"`
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
}
|
||||
|
||||
type SearchUserParams struct {
|
||||
common.Pagination
|
||||
Username string `json:"username" validate:"omitempty,max=50"`
|
||||
}
|
||||
Reference in New Issue
Block a user