This commit is contained in:
naiba
2024-10-20 00:09:16 +08:00
parent 6cd243ea40
commit 843ecdaa33
528 changed files with 281 additions and 19449 deletions

View File

@@ -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"`
}