uniugm/admin/apps/user/api/api_user.go

42 lines
778 B
Go
Raw Normal View History

2025-04-30 15:46:14 +08:00
package api
import "context"
var userApiInstance IUserApi
func GetUserApiInstance() IUserApi {
return userApiInstance
}
type IUserApi interface {
Auth(ctx context.Context, req *AuthReq) (*AuthRsp, error)
}
func RegisterUserApiHandler(handler IUserApi) {
userApiInstance = handler
}
type AuthReq struct {
Token string
UserId int
Url string
}
type UserInfo struct {
UserId int `json:"user_id"`
2025-05-05 10:30:33 +08:00
UserName string `json:"user_name"`
2025-04-30 15:46:14 +08:00
NickName string `json:"nick_name"`
Icon string `json:"icon"`
Character string `json:"character"`
Permissions []string `json:"permissions"`
}
type TokenInfo struct {
Token string `json:"token"`
ExpireAt int64 `json:"expire_at"`
}
type AuthRsp struct {
User *UserInfo
Token *TokenInfo
}