refactor: IDL structure modification (#475)
This commit is contained in:
@@ -24,8 +24,10 @@ import (
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
|
||||
dataset "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset"
|
||||
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
||||
"github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||
application "github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||
"github.com/coze-dev/coze-studio/backend/application/memory"
|
||||
"github.com/coze-dev/coze-studio/backend/application/upload"
|
||||
)
|
||||
|
||||
@@ -526,3 +528,48 @@ func ExtractPhotoCaption(ctx context.Context, c *app.RequestContext) {
|
||||
}
|
||||
c.JSON(consts.StatusOK, resp)
|
||||
}
|
||||
|
||||
// GetDocumentTableInfo .
|
||||
// @router /api/memory/doc_table_info [GET]
|
||||
func GetDocumentTableInfo(ctx context.Context, c *app.RequestContext) {
|
||||
var err error
|
||||
var req dataset.GetDocumentTableInfoRequest
|
||||
err = c.BindAndValidate(&req)
|
||||
if err != nil {
|
||||
c.String(consts.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
resp := new(dataset.GetDocumentTableInfoResponse)
|
||||
resp, err = knowledge.KnowledgeSVC.GetDocumentTableInfo(ctx, &req)
|
||||
if err != nil {
|
||||
internalServerErrorResponse(ctx, c, err)
|
||||
return
|
||||
}
|
||||
c.JSON(consts.StatusOK, resp)
|
||||
}
|
||||
|
||||
// GetModeConfig .
|
||||
// @router /api/memory/table_mode_config [GET]
|
||||
func GetModeConfig(ctx context.Context, c *app.RequestContext) {
|
||||
var err error
|
||||
var req dataset.GetModeConfigRequest
|
||||
err = c.BindAndValidate(&req)
|
||||
if err != nil {
|
||||
c.String(consts.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if req.BotID == 0 {
|
||||
invalidParamRequestResponse(c, "bot_id is zero")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := memory.DatabaseApplicationSVC.GetModeConfig(ctx, &req)
|
||||
if err != nil {
|
||||
internalServerErrorResponse(ctx, c, err)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(consts.StatusOK, resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user