refactor: IDL structure modification (#475)

This commit is contained in:
liuyunchao-1998
2025-08-07 15:59:51 +08:00
committed by GitHub
parent b25bf6728a
commit e7d25319ff
221 changed files with 8289 additions and 17471 deletions

View File

@@ -23,12 +23,13 @@ import (
"fmt"
"github.com/coze-dev/coze-studio/backend/application/plugin"
"github.com/coze-dev/coze-studio/backend/application/singleagent"
"github.com/coze-dev/coze-studio/backend/application/upload"
"github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/protocol/consts"
bot_open_api "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api"
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api"
)
// OauthAuthorizationCode .
@@ -63,3 +64,43 @@ func OauthAuthorizationCode(ctx context.Context, c *app.RequestContext) {
return
}
// UploadFileOpen .
// @router /v1/files/upload [POST]
func UploadFileOpen(ctx context.Context, c *app.RequestContext) {
var err error
var req bot_open_api.UploadFileOpenRequest
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(bot_open_api.UploadFileOpenResponse)
resp, err = upload.SVC.UploadFileOpen(ctx, &req)
if err != nil {
internalServerErrorResponse(ctx, c, err)
return
}
c.JSON(consts.StatusOK, resp)
}
// GetBotOnlineInfo .
// @router /v1/bot/get_online_info [GET]
func GetBotOnlineInfo(ctx context.Context, c *app.RequestContext) {
var err error
var req bot_open_api.GetBotOnlineInfoReq
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp, err := singleagent.SingleAgentSVC.GetAgentOnlineInfo(ctx, &req)
if err != nil {
internalServerErrorResponse(ctx, c, err)
return
}
c.JSON(consts.StatusOK, resp)
}