@@ -7,4 +7,5 @@ type RouterGroup struct {
|
||||
AIConfigRouter
|
||||
PresetRouter
|
||||
UploadRouter
|
||||
WorldbookRouter
|
||||
}
|
||||
|
||||
29
server/router/app/worldbook.go
Normal file
29
server/router/app/worldbook.go
Normal 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) // 删除条目
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user