init repo

This commit is contained in:
VaalaCat
2024-08-28 00:02:28 +08:00
committed by vaalacat
commit 13148b95e3
97 changed files with 10214 additions and 0 deletions

37
defs/response.go Normal file
View File

@@ -0,0 +1,37 @@
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"`
}