nezha/model/api.go

22 lines
450 B
Go
Raw Permalink Normal View History

package model
2024-10-20 00:09:16 +08:00
const (
ApiErrorUnauthorized = 10001
)
type LoginRequest struct {
2024-10-20 14:05:43 +08:00
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
2024-10-20 00:09:16 +08:00
}
2024-10-20 14:05:43 +08:00
type CommonResponse[T any] struct {
Success bool `json:"success,omitempty"`
Data T `json:"data,omitempty"`
Error string `json:"error,omitempty"`
2024-10-20 00:09:16 +08:00
}
2024-10-20 14:05:43 +08:00
type LoginResponse struct {
Token string `json:"token,omitempty"`
Expire string `json:"expire,omitempty"`
2024-10-20 00:09:16 +08:00
}