46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
package adminmgr
|
|
|
|
import (
|
|
"time"
|
|
|
|
"hfb_sys/backend/internal/modules/adminrole"
|
|
)
|
|
|
|
type AdminUserDTO struct {
|
|
ID uint64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Nickname string `json:"nickname"`
|
|
Status string `json:"status"`
|
|
Roles []adminrole.RoleDTO `json:"roles"`
|
|
LastLoginAt *time.Time `json:"last_login_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type PaginatedResult struct {
|
|
Items []AdminUserDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
type CreateAdminRequest struct {
|
|
Username string `json:"username" binding:"required"`
|
|
Password string `json:"password" binding:"required"`
|
|
Nickname string `json:"nickname"`
|
|
}
|
|
|
|
type UpdateAdminRequest struct {
|
|
Nickname string `json:"nickname"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type AssignRolesRequest struct {
|
|
RoleIDs []uint64 `json:"role_ids"`
|
|
}
|
|
|
|
type ChangePasswordRequest struct {
|
|
OldPassword string `json:"old_password" binding:"required"`
|
|
NewPassword string `json:"new_password" binding:"required"`
|
|
}
|