Initial commit: Modular personal toolbox with high-fidelity Chinese stroke order tool and CI/CD
Build and Push Docker Image / build (push) Failing after 3h14m47s

This commit is contained in:
2026-02-23 02:04:11 -08:00
commit 4fd43d7200
17 changed files with 1183 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package base
import (
"github.com/gin-gonic/gin"
)
// Tool 定义了工具箱中每个子工具必须实现的接口
type Tool interface {
ID() string // 工具的唯一标识,用于路由前缀,如 "jitie"
Name() string // 工具的显示名称
Description() string // 工具的描述
Init() error // 初始化逻辑,如加载 embed 的数据
RegisterRoutes(r *gin.RouterGroup) // 注册该工具的 API 路由
}
// Registry 存储所有已注册的工具
var Registry = make(map[string]Tool)
// Register 用于工具在 init() 函数中注册自己
func Register(t Tool) {
Registry[t.ID()] = t
}