ToyBoomServer/defs/response.go
2024-09-02 18:07:30 +00:00

38 lines
772 B
Go

package defs
const (
RespCode_SUCCESS = RespCode(0)
RespCode_ERROR = RespCode(1)
RespCode_UNAUTHORIZED = RespCode(2)
RespCode_INVALID = RespCode(3)
)
const (
RespMessage_SUCCESS = RespMsg("success")
RespMessage_ERROR = RespMsg("error")
RespMessage_UNAUTHORIZED = RespMsg("unauthorized")
RespMessage_INVALID = RespMsg("invalid")
)
type RespCode int
type RespMsg string
type Status struct {
Code RespCode `json:"code"`
Message RespMsg `json:"message"`
}
type CommonResponse struct {
Status *Status `json:"status"`
}
type GetUserInfoResponse struct {
Status *Status `json:"status"`
User *User `json:"user"`
}
type GetUserAuthTokenResponse struct {
Status *Status `json:"status"`
Token string `json:"token"`
}