mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
852 B
43 lines
852 B
package v1
|
|
|
|
import (
|
|
. "github.com/alimy/mir/v3"
|
|
. "github.com/alimy/mir/v3/engine"
|
|
)
|
|
|
|
func init() {
|
|
AddEntry(new(User))
|
|
}
|
|
|
|
type AgentInfo struct {
|
|
Platform string `json:"platform"`
|
|
UserAgent string `json:"user_agent"`
|
|
}
|
|
|
|
type ServerInfo struct {
|
|
ApiVer string `json:"api_ver"`
|
|
}
|
|
|
|
type UserInfo struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type LoginReq struct {
|
|
AgentInfo AgentInfo `json:"agent_info"`
|
|
Name string `json:"name"`
|
|
Passwd string `json:"passwd"`
|
|
}
|
|
|
|
type LoginResp struct {
|
|
UserInfo
|
|
ServerInfo ServerInfo `json:"server_info"`
|
|
JwtToken string `json:"jwt_token"`
|
|
}
|
|
|
|
type User struct {
|
|
Group Group `mir:"s/v1"`
|
|
Index func(Get) `mir:"/index/"`
|
|
Login func(Post, LoginReq) LoginResp `mir:"/user/login/"`
|
|
Logout func(Post) `mir:"/user/logout/"`
|
|
}
|