✨ init project
This commit is contained in:
28
router/bot/bot.go
Normal file
28
router/bot/bot.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package bot
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type BotRouter struct{}
|
||||
|
||||
// InitBotRouter 初始化 机器人 路由信息
|
||||
func (s *BotRouter) InitBotRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
|
||||
btRouter := Router.Group("bt").Use(middleware.OperationRecord())
|
||||
btRouterWithoutRecord := Router.Group("bt")
|
||||
btRouterWithoutAuth := PublicRouter.Group("bt")
|
||||
{
|
||||
btRouter.POST("createBot", btApi.CreateBot) // 新建机器人
|
||||
btRouter.DELETE("deleteBot", btApi.DeleteBot) // 删除机器人
|
||||
btRouter.DELETE("deleteBotByIds", btApi.DeleteBotByIds) // 批量删除机器人
|
||||
btRouter.PUT("updateBot", btApi.UpdateBot) // 更新机器人
|
||||
}
|
||||
{
|
||||
btRouterWithoutRecord.GET("findBot", btApi.FindBot) // 根据ID获取机器人
|
||||
btRouterWithoutRecord.GET("getBotList", btApi.GetBotList) // 获取机器人列表
|
||||
}
|
||||
{
|
||||
btRouterWithoutAuth.POST("findKey", btApi.FindKey) // 机器人开放接口
|
||||
}
|
||||
}
|
7
router/bot/enter.go
Normal file
7
router/bot/enter.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package bot
|
||||
|
||||
import api "git.echol.cn/loser/lckt/api/v1"
|
||||
|
||||
type RouterGroup struct{ BotRouter }
|
||||
|
||||
var btApi = api.ApiGroupApp.BotApiGroup.BotApi
|
Reference in New Issue
Block a user