新增正则和扩展模块

This commit is contained in:
2026-02-11 23:44:09 +08:00
parent 2bca8e2788
commit 4e611d3a5e
47 changed files with 10058 additions and 49 deletions

View File

@@ -0,0 +1,29 @@
package app
import (
"git.echol.cn/loser/st/server/api/v1"
"git.echol.cn/loser/st/server/middleware"
"github.com/gin-gonic/gin"
)
type RegexScriptRouter struct{}
// InitRegexScriptRouter 初始化正则脚本路由
func (r *RegexScriptRouter) InitRegexScriptRouter(Router *gin.RouterGroup) {
regexRouter := Router.Group("regex").Use(middleware.AppJWTAuth())
regexApi := v1.ApiGroupApp.AppApiGroup.RegexScriptApi
{
regexRouter.POST("", regexApi.CreateRegexScript) // 创建正则脚本
regexRouter.PUT(":id", regexApi.UpdateRegexScript) // 更新正则脚本
regexRouter.DELETE(":id", regexApi.DeleteRegexScript) // 删除正则脚本
regexRouter.GET(":id", regexApi.GetRegexScript) // 获取正则脚本详情
regexRouter.GET("", regexApi.GetRegexScriptList) // 获取正则脚本列表
regexRouter.POST(":id/link", regexApi.LinkCharactersToRegex) // 关联角色到脚本
regexRouter.GET("character/:characterId", regexApi.GetCharacterRegexScripts) // 获取角色的脚本
regexRouter.POST(":id/duplicate", regexApi.DuplicateRegexScript) // 复制脚本
regexRouter.POST("test", regexApi.TestRegexScript) // 测试正则脚本
regexRouter.POST("apply", regexApi.ApplyRegexScripts) // 应用正则脚本
regexRouter.POST("import", regexApi.ImportRegexScripts) // 导入正则脚本
regexRouter.GET("export", regexApi.ExportRegexScripts) // 导出正则脚本
}
}