mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 18:10:25 +08:00
增加脚本相关表
This commit is contained in:
@@ -955,6 +955,12 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, cacheMap *utils
|
||||
}
|
||||
config.OCSPVersion = ocspVersion
|
||||
|
||||
// 初始化扩展配置
|
||||
err = this.composeExtConfig(tx, config, cacheMap)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
||||
15
internal/db/models/node_dao_ext.go
Normal file
15
internal/db/models/node_dao_ext.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
//go:build community
|
||||
// +build community
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
)
|
||||
|
||||
func (this *NodeDAO) composeExtConfig(tx *dbs.Tx, config *nodeconfigs.NodeConfig, cacheMap *utils.CacheMap) error {
|
||||
return nil
|
||||
}
|
||||
@@ -17,6 +17,7 @@ const (
|
||||
NodeTaskTypeConfigChanged NodeTaskType = "configChanged"
|
||||
NodeTaskTypeIPItemChanged NodeTaskType = "ipItemChanged"
|
||||
NodeTaskTypeNodeVersionChanged NodeTaskType = "nodeVersionChanged"
|
||||
NodeTaskTypeScriptsChanged NodeTaskType = "scriptsChanged"
|
||||
|
||||
// NS相关
|
||||
|
||||
|
||||
6
internal/db/models/script_dao_plus_test.go
Normal file
6
internal/db/models/script_dao_plus_test.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package models_test
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/iwind/TeaGo/bootstrap"
|
||||
)
|
||||
6
internal/db/models/script_history_dao_plus_test.go
Normal file
6
internal/db/models/script_history_dao_plus_test.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package models_test
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/iwind/TeaGo/bootstrap"
|
||||
)
|
||||
24
internal/db/models/script_history_model.go
Normal file
24
internal/db/models/script_history_model.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
// ScriptHistory 脚本历史记录
|
||||
type ScriptHistory struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
UserId uint64 `field:"userId"` // 用户ID
|
||||
ScriptId uint64 `field:"scriptId"` // 脚本ID
|
||||
Filename string `field:"filename"` // 文件名
|
||||
Code string `field:"code"` // 代码
|
||||
Version uint64 `field:"version"` // 版本号
|
||||
}
|
||||
|
||||
type ScriptHistoryOperator struct {
|
||||
Id interface{} // ID
|
||||
UserId interface{} // 用户ID
|
||||
ScriptId interface{} // 脚本ID
|
||||
Filename interface{} // 文件名
|
||||
Code interface{} // 代码
|
||||
Version interface{} // 版本号
|
||||
}
|
||||
|
||||
func NewScriptHistoryOperator() *ScriptHistoryOperator {
|
||||
return &ScriptHistoryOperator{}
|
||||
}
|
||||
1
internal/db/models/script_history_model_ext.go
Normal file
1
internal/db/models/script_history_model_ext.go
Normal file
@@ -0,0 +1 @@
|
||||
package models
|
||||
30
internal/db/models/script_model.go
Normal file
30
internal/db/models/script_model.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package models
|
||||
|
||||
// Script 脚本库
|
||||
type Script struct {
|
||||
Id uint64 `field:"id"` // ID
|
||||
UserId uint64 `field:"userId"` // 用户ID
|
||||
IsOn bool `field:"isOn"` // 是否启用
|
||||
Name string `field:"name"` // 名称
|
||||
Filename string `field:"filename"` // 文件名
|
||||
Code string `field:"code"` // 代码
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
UpdatedAt uint64 `field:"updatedAt"` // 修改时间
|
||||
State uint8 `field:"state"` // 是否启用
|
||||
}
|
||||
|
||||
type ScriptOperator struct {
|
||||
Id interface{} // ID
|
||||
UserId interface{} // 用户ID
|
||||
IsOn interface{} // 是否启用
|
||||
Name interface{} // 名称
|
||||
Filename interface{} // 文件名
|
||||
Code interface{} // 代码
|
||||
CreatedAt interface{} // 创建时间
|
||||
UpdatedAt interface{} // 修改时间
|
||||
State interface{} // 是否启用
|
||||
}
|
||||
|
||||
func NewScriptOperator() *ScriptOperator {
|
||||
return &ScriptOperator{}
|
||||
}
|
||||
1
internal/db/models/script_model_ext.go
Normal file
1
internal/db/models/script_model_ext.go
Normal file
@@ -0,0 +1 @@
|
||||
package models
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user