mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 11:27:17 +08:00
refactor: models
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
"github.com/goravel/framework/support/carbon"
|
||||
)
|
||||
|
||||
type Cron struct {
|
||||
orm.Model
|
||||
Name string `gorm:"not null;unique"`
|
||||
Status bool `gorm:"not null;default:false"`
|
||||
Type string `gorm:"not null"`
|
||||
Time string `gorm:"not null"`
|
||||
Shell string `gorm:"default:''"`
|
||||
Log string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"not null;unique" json:"name"`
|
||||
Status bool `gorm:"not null;default:false" json:"status"`
|
||||
Type string `gorm:"not null" json:"type"`
|
||||
Time string `gorm:"not null" json:"time"`
|
||||
Shell string `gorm:"default:''" json:"shell"`
|
||||
Log string `gorm:"default:''" json:"log"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
)
|
||||
import "github.com/goravel/framework/support/carbon"
|
||||
|
||||
type Database struct {
|
||||
orm.Model
|
||||
Name string `gorm:"unique;not null"`
|
||||
Type string `gorm:"not null;index"`
|
||||
Host string `gorm:"not null"`
|
||||
Port int `gorm:"not null"`
|
||||
Username string `gorm:"not null"`
|
||||
Password string `gorm:"default:''"`
|
||||
Remark string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"unique;not null" json:"name"`
|
||||
Type string `gorm:"not null;index" json:"type"`
|
||||
Host string `gorm:"not null" json:"host"`
|
||||
Port int `gorm:"not null" json:"port"`
|
||||
Username string `gorm:"not null" json:"username"`
|
||||
Password string `gorm:"default:''" json:"password"`
|
||||
Remark string `gorm:"default:''" json:"remark"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/support/carbon"
|
||||
"panel/packages/helpers"
|
||||
|
||||
"github.com/goravel/framework/database/orm"
|
||||
)
|
||||
|
||||
type Monitor struct {
|
||||
orm.Model
|
||||
Info helpers.MonitoringInfo `gorm:"type:json;serializer:json"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Info helpers.MonitoringInfo `gorm:"type:json;serializer:json" json:"info"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
)
|
||||
import "github.com/goravel/framework/support/carbon"
|
||||
|
||||
type Plugin struct {
|
||||
orm.Model
|
||||
Slug string `gorm:"unique;not null"`
|
||||
Version string `gorm:"not null"`
|
||||
Show bool `gorm:"default:false;not null"`
|
||||
ShowOrder int `gorm:"default:0;not null"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Slug string `gorm:"unique;not null" json:"slug"`
|
||||
Version string `gorm:"not null" json:"version"`
|
||||
Show bool `gorm:"default:false;not null" json:"show"`
|
||||
ShowOrder int `gorm:"default:0;not null" json:"show_order"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
)
|
||||
import "github.com/goravel/framework/support/carbon"
|
||||
|
||||
type Setting struct {
|
||||
orm.Model
|
||||
Key string `gorm:"unique;not null"`
|
||||
Value string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Key string `gorm:"unique;not null" json:"key"`
|
||||
Value string `gorm:"default:''" json:"value"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
"github.com/goravel/framework/support/carbon"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -12,9 +12,11 @@ const (
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
orm.Model
|
||||
Name string `gorm:"not null"`
|
||||
Status string `gorm:"not null;default:'waiting'"`
|
||||
Shell string `gorm:"default:''"`
|
||||
Log string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Status string `gorm:"not null;default:'waiting'" json:"status"`
|
||||
Shell string `gorm:"default:''" json:"shell"`
|
||||
Log string `gorm:"default:''" json:"log"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
)
|
||||
import "github.com/goravel/framework/support/carbon"
|
||||
|
||||
type User struct {
|
||||
orm.Model
|
||||
Username string `gorm:"unique;not null"`
|
||||
Password string `gorm:"not null"`
|
||||
Email string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Username string `gorm:"unique;not null" json:"username"`
|
||||
Password string `gorm:"not null" json:"password"`
|
||||
Email string `gorm:"default:''" json:"email"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/goravel/framework/database/orm"
|
||||
"github.com/goravel/framework/support/carbon"
|
||||
)
|
||||
|
||||
type Website struct {
|
||||
orm.Model
|
||||
Name string `gorm:"unique;not null"`
|
||||
Status bool `gorm:"default:true;not null;index"`
|
||||
Path string `gorm:"not null"`
|
||||
Php int `gorm:"default:0;not null;index"`
|
||||
Ssl bool `gorm:"default:false;not null;index"`
|
||||
Remark string `gorm:"default:''"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"unique;not null" json:"name"`
|
||||
Status bool `gorm:"default:true;not null;index" json:"status"`
|
||||
Path string `gorm:"not null" json:"path"`
|
||||
Php int `gorm:"default:0;not null;index" json:"php"`
|
||||
Ssl bool `gorm:"default:false;not null;index" json:"ssl"`
|
||||
Remark string `gorm:"default:''" json:"remark"`
|
||||
CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
|
||||
UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user