🎨 新增世界书模块,将原有的世界书分离

Signed-off-by: Echo <1711788888@qq.com>
This commit is contained in:
2026-02-27 23:15:30 +08:00
parent 689e8af3df
commit 032d0ccdf0
18 changed files with 1880 additions and 8 deletions

View File

@@ -7,4 +7,5 @@ type RouterGroup struct {
AIConfigRouter
PresetRouter
UploadRouter
WorldbookRouter
}

View File

@@ -0,0 +1,29 @@
package app
import (
v1 "git.echol.cn/loser/st/server/api/v1"
"git.echol.cn/loser/st/server/middleware"
"github.com/gin-gonic/gin"
)
type WorldbookRouter struct{}
// InitWorldbookRouter 初始化世界书路由
func (r *WorldbookRouter) InitWorldbookRouter(Router *gin.RouterGroup) {
worldbookRouter := Router.Group("worldbook").Use(middleware.AppJWTAuth())
worldbookApi := v1.ApiGroupApp.AppApiGroup.WorldbookApi
{
worldbookRouter.POST("", worldbookApi.CreateWorldbook) // 创建世界书
worldbookRouter.GET("", worldbookApi.GetWorldbookList) // 获取世界书列表
worldbookRouter.POST("import", worldbookApi.ImportWorldbook) // 导入世界书
worldbookRouter.GET(":id", worldbookApi.GetWorldbookByID) // 获取世界书详情
worldbookRouter.PUT(":id", worldbookApi.UpdateWorldbook) // 更新世界书
worldbookRouter.DELETE(":id", worldbookApi.DeleteWorldbook) // 删除世界书
worldbookRouter.GET(":id/export", worldbookApi.ExportWorldbook) // 导出世界书
worldbookRouter.POST(":id/entry", worldbookApi.CreateEntry) // 创建条目
worldbookRouter.GET(":id/entries", worldbookApi.GetEntryList) // 获取条目列表
worldbookRouter.PUT(":id/entry/:entryId", worldbookApi.UpdateEntry) // 更新条目
worldbookRouter.DELETE(":id/entry/:entryId", worldbookApi.DeleteEntry) // 删除条目
}
}