拓展类型 自定义工具类型

This commit is contained in:
2024-10-10 18:22:50 +08:00
parent 3b69ba93ad
commit 1a0a9466d8
14 changed files with 374 additions and 31 deletions
+14 -1
View File
@@ -3,6 +3,7 @@ package models
import (
"time"
"work_cation/pkg/gormx"
"work_cation/pkg/utils"
)
type BaseCard struct {
@@ -19,5 +20,17 @@ type BaseCard struct {
}
const (
ToolTypeErlang = "erlangCard" // 卡片
ToolTypeErlang = "erlangCard" // 卡片
ToolTypeExecFiles = "execFiles" // 可执行文件
)
func NewBaseCard(t, userId string) BaseCard {
return BaseCard{
UUID: utils.Uuid.CreateUUID(),
UserID: userId,
Title: "未命名",
Text: "未命名",
ToolType: t,
UpdateTx: time.Now(),
}
}
+9
View File
@@ -0,0 +1,9 @@
package models
type ExecFiles struct {
BaseCard
// 文件名
Cmd string `json:"common"` // 执行命令
Pwd string `json:"pwd"` // 执行路径
Files []string `json:"files"` // 原始文件
}