Files
2026-05-20 16:13:58 +08:00

76 lines
2.8 KiB
Go

package proto
import (
"stat/common"
"time"
)
// 管理员登陆请求
type AdminLoginReq struct {
Account *string `form:"account" json:"account" binding:"required"` // 账号
Password *string `form:"password" json:"password" binding:"required"` // 密码
}
// 管理员验证请求
type AdminVerifyReq struct {
Account *string `form:"account" json:"account" binding:"required"` // 账号
VerifyCode *string `form:"verifyCode" json:"verifyCode" binding:"required"` // 验证码
}
// 管理员登陆响应
type AdminLoginRes struct {
Account string `json:"account"` // 用户名
Token string `json:"token"` // token
Name string `json:"name"` // 名称
RoleInfo RoleInfo `json:"roleInfo"` // 角色信息
}
// 请求管理员列表
type AdminListReq struct {
common.Page
BlocRole *int `json:"blocRole"` // 角色
}
type AdminInfo struct {
Account string `json:"account"` // 账号
Password string `json:"password"` // 密码
Name string `json:"name"` // 名称
RoleId int64 `json:"roleId"` // 角色
Role string `json:"role"` // 角色
MerchantId string `json:"merchantId"` // 商人id
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
LastTime time.Time `json:"lastTime"` // 登录时间
}
// 响应管理员列表
type AdminListRes struct {
Total int64 `json:"total"`
List []AdminInfo `json:"list"`
}
// 新增管理员账号
type AddAdminReq struct {
Account *string `form:"account" json:"account" binding:"required"` // 账号(唯一)
Password *string `form:"password" json:"password" binding:"required"` // 密码
Name *string `form:"name" json:"name" binding:"required"` // 名称
RoleId *int64 `form:"roleId" json:"roleId" binding:"required"` // 角色id
MerchantId *string `form:"merchantId" json:"merchantId" binding:"omitempty"` // 商人id
BlocRole *int `json:"blocRole"` // 角色
}
// 更新管理员信息
type UpdateAdminReq struct {
Account *string `form:"account" json:"account" binding:"required"` // 用户名
Password *string `form:"password" json:"password" binding:"omitempty"` // 密码
Name *string `form:"name" json:"name" binding:"omitempty"` // 名称
RoleId *int64 `form:"roleId" json:"roleId" binding:"omitempty"` // 角色id
Status *int64 `form:"status" json:"status" binding:"omitempty"` // 状态
MerchantId *string `form:"merchantId" json:"merchantId" binding:"omitempty"` // 商人id
BlocRole *int `json:"blocRole"` // 角色
}
type DelAdminReq struct {
Account *string `form:"account" json:"account" binding:"required"` // 用户id
}