mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
监控部分迁移
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package monitor
|
||||
|
||||
import "time"
|
||||
|
||||
type Monitor struct {
|
||||
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
|
||||
UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
|
||||
Cluster string `gorm:"column:cluster;type:varchar(36);NOT NULL;comment:集群ID"`
|
||||
Driver string `gorm:"column:driver;type:VARCHAR(36);NOT NULL;comment:驱动"`
|
||||
Config string `gorm:"column:config;type:TEXT;NOT NULL;comment:配置"`
|
||||
Creator string `gorm:"type:varchar(36);not null;column:creator;comment:creator" aovalue:"creator"`
|
||||
Updater string `gorm:"type:varchar(36);not null;column:updater;comment:updater" aovalue:"updater"`
|
||||
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
|
||||
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
|
||||
}
|
||||
|
||||
func (c *Monitor) IdValue() int64 {
|
||||
return c.Id
|
||||
}
|
||||
|
||||
func (c *Monitor) TableName() string {
|
||||
return "monitor"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/eolinker/go-common/autowire"
|
||||
"github.com/eolinker/go-common/store"
|
||||
)
|
||||
|
||||
type IMonitorStore interface {
|
||||
store.IBaseStore[Monitor]
|
||||
}
|
||||
|
||||
type storeMonitor struct {
|
||||
store.Store[Monitor]
|
||||
}
|
||||
|
||||
func init() {
|
||||
autowire.Auto[IMonitorStore](func() reflect.Value {
|
||||
return reflect.ValueOf(new(storeMonitor))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user