🎨 机器人新增vip权限判断

This commit is contained in:
2025-09-27 17:17:20 +08:00
parent ebfdf0dcd7
commit 013b7af7e3
2 changed files with 42 additions and 12 deletions

View File

@@ -6,8 +6,10 @@ import (
botReq "git.echol.cn/loser/lckt/model/bot/request"
"git.echol.cn/loser/lckt/model/common/response"
"git.echol.cn/loser/lckt/utils"
"git.echol.cn/loser/lckt/utils/user_jwt"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"strings"
)
type BotApi struct{}
@@ -183,7 +185,9 @@ func (btApi *BotApi) FindKey(c *gin.Context) {
return
}
bt, err := btService.GetBotPublic(req)
userId := user_jwt.GetUserID(c)
bt, err := btService.GetBotPublic(req, userId)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败:"+err.Error(), c)
@@ -205,8 +209,9 @@ func (btApi *BotApi) BulkBot(c *gin.Context) {
err := btService.BulkBot(p, name)
if err != nil {
global.GVA_LOG.Error("批量创建失败!", zap.Error(err))
response.FailWithMessage("批量创建失败:"+err.Error(), c)
global.GVA_LOG.Error("批量上传失败!", zap.Error(err))
// 只要返回部分失败的文件列表 删除前面的"部分文件上传失败: "即可
response.FailWithDetailed(strings.TrimPrefix(err.Error(), "部分文件上传失败: "), "部分文件上传失败:"+strings.TrimPrefix(err.Error(), "部分文件上传失败: "), c)
return
}
response.OkWithMessage("批量创建成功", c)