feat: Added ID field to PublicService DTO, update fields in Service model, fix CalculateUptimePercent method, transform services to Public services in goroutines
This commit is contained in:
@@ -9,17 +9,18 @@ import (
|
||||
type StatusCode string
|
||||
|
||||
const (
|
||||
StatusOK StatusCode = "ok" // Means - response ok, service is alive
|
||||
StatusFailed StatusCode = "failed" // Means - response failed, all tries failed, service down
|
||||
StatusWarn StatusCode = "warn" // Means - response failed after N tries and still watched
|
||||
StatusOK StatusCode = "ok" // Means - response ok, service is alive
|
||||
StatusFailed StatusCode = "failed" // Means - response failed, all tries failed, service down
|
||||
StatusWarn StatusCode = "warn" // Means - response failed after N tries and still watched
|
||||
StatusUncheck StatusCode = "unchecked" // Means - no data
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
ID int `gorm:"primary_key;auto_increment" json:"-"`
|
||||
ID int `gorm:"primary_key;auto_increment" json:"id"`
|
||||
ServiceID int `gorm:"one" json:"-"`
|
||||
Status StatusCode `gorm:"size:255;not null" json:"status"`
|
||||
Description *string `gorm:"size:255" json:"description"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (Status) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user