29 lines
1002 B
Go
29 lines
1002 B
Go
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) // 机器人开放接口
|
|
}
|
|
}
|