46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
package responses
|
|
|
|
import (
|
|
"time"
|
|
|
|
"tyapi-server/internal/domains/admin/entities"
|
|
)
|
|
|
|
// AdminLoginResponse 管理员登录响应
|
|
type AdminLoginResponse struct {
|
|
Token string `json:"token"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
Admin AdminInfoResponse `json:"admin"`
|
|
}
|
|
|
|
// AdminInfoResponse 管理员信息响应
|
|
type AdminInfoResponse struct {
|
|
ID string `json:"id"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Phone string `json:"phone"`
|
|
RealName string `json:"real_name"`
|
|
Role entities.AdminRole `json:"role"`
|
|
IsActive bool `json:"is_active"`
|
|
LastLoginAt *time.Time `json:"last_login_at"`
|
|
LoginCount int `json:"login_count"`
|
|
Permissions []string `json:"permissions"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// AdminListResponse 管理员列表响应
|
|
type AdminListResponse struct {
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
Size int `json:"size"`
|
|
Admins []AdminInfoResponse `json:"admins"`
|
|
}
|
|
|
|
// AdminStatsResponse 管理员统计响应
|
|
type AdminStatsResponse struct {
|
|
TotalAdmins int64 `json:"total_admins"`
|
|
ActiveAdmins int64 `json:"active_admins"`
|
|
TodayLogins int64 `json:"today_logins"`
|
|
TotalOperations int64 `json:"total_operations"`
|
|
}
|