41 lines
1.7 KiB
Go
41 lines
1.7 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 WorldInfoRouter struct{}
|
|
|
|
func (r *WorldInfoRouter) InitWorldInfoRouter(Router *gin.RouterGroup) {
|
|
worldInfoRouter := Router.Group("worldbook").Use(middleware.AppJWTAuth())
|
|
worldInfoApi := v1.ApiGroupApp.AppApiGroup.WorldInfoApi
|
|
|
|
{
|
|
// 世界书管理
|
|
worldInfoRouter.POST("", worldInfoApi.CreateWorldBook) // 创建世界书
|
|
worldInfoRouter.PUT("/:id", worldInfoApi.UpdateWorldBook) // 更新世界书
|
|
worldInfoRouter.DELETE("/:id", worldInfoApi.DeleteWorldBook) // 删除世界书
|
|
worldInfoRouter.GET("/:id", worldInfoApi.GetWorldBook) // 获取世界书详情
|
|
worldInfoRouter.GET("/list", worldInfoApi.GetWorldBookList) // 获取世界书列表
|
|
worldInfoRouter.POST("/:id/duplicate", worldInfoApi.DuplicateWorldBook) // 复制世界书
|
|
|
|
// 条目管理
|
|
worldInfoRouter.POST("/entry", worldInfoApi.CreateWorldEntry) // 创建条目
|
|
worldInfoRouter.PUT("/entry", worldInfoApi.UpdateWorldEntry) // 更新条目
|
|
worldInfoRouter.DELETE("/entry", worldInfoApi.DeleteWorldEntry) // 删除条目
|
|
|
|
// 关联管理
|
|
worldInfoRouter.POST("/link", worldInfoApi.LinkCharactersToWorldBook) // 关联角色
|
|
worldInfoRouter.GET("/character/:characterId", worldInfoApi.GetCharacterWorldBooks) // 获取角色的世界书
|
|
|
|
// 导入导出
|
|
worldInfoRouter.POST("/import", worldInfoApi.ImportWorldBook) // 导入世界书
|
|
worldInfoRouter.GET("/:id/export", worldInfoApi.ExportWorldBook) // 导出世界书
|
|
|
|
// 匹配引擎(用于聊天)
|
|
worldInfoRouter.POST("/match", worldInfoApi.MatchWorldInfo) // 匹配世界书条目
|
|
}
|
|
}
|