mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
init jwt
This commit is contained in:
20
model/api.go
20
model/api.go
@@ -1,5 +1,9 @@
|
||||
package model
|
||||
|
||||
const (
|
||||
ApiErrorUnauthorized = 10001
|
||||
)
|
||||
|
||||
type ServiceItemResponse struct {
|
||||
Monitor *Monitor
|
||||
CurrentUp uint64
|
||||
@@ -17,3 +21,19 @@ func (r ServiceItemResponse) TotalUptime() float32 {
|
||||
}
|
||||
return float32(r.TotalUp) / (float32(r.TotalUp + r.TotalDown)) * 100
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type CommonError struct {
|
||||
Code int `json:"code"`
|
||||
Args map[string]string `json:"args"`
|
||||
}
|
||||
|
||||
type CommonResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Data interface{} `json:"data"`
|
||||
Error CommonError `json:"error"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user