30 lines
1.6 KiB
Go
30 lines
1.6 KiB
Go
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) // 导出正则脚本
|
|
}
|
|
}
|