diff --git a/backend/api/handler/coze/bot_open_api_service.go b/backend/api/handler/coze/bot_open_api_service.go index a7cf32aa..5ec84a4e 100644 --- a/backend/api/handler/coze/bot_open_api_service.go +++ b/backend/api/handler/coze/bot_open_api_service.go @@ -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) +} diff --git a/backend/api/handler/coze/database_service.go b/backend/api/handler/coze/database_service.go index 7f5effb2..38900fee 100644 --- a/backend/api/handler/coze/database_service.go +++ b/backend/api/handler/coze/database_service.go @@ -23,9 +23,8 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" "github.com/coze-dev/coze-studio/backend/application/memory" "github.com/coze-dev/coze-studio/backend/application/singleagent" ) @@ -341,7 +340,7 @@ func GetDatabaseTableSchema(ctx context.Context, c *app.RequestContext) { return } - var resp *document.GetTableSchemaInfoResponse + var resp *knowledge.GetTableSchemaInfoResponse resp, err = memory.DatabaseApplicationSVC.GetDatabaseTableSchema(ctx, &req) if err != nil { internalServerErrorResponse(ctx, c, err) diff --git a/backend/api/handler/coze/developer_api_service.go b/backend/api/handler/coze/developer_api_service.go index 8a80a94f..5038474d 100644 --- a/backend/api/handler/coze/developer_api_service.go +++ b/backend/api/handler/coze/developer_api_service.go @@ -30,7 +30,7 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - developer_api "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/modelmgr" "github.com/coze-dev/coze-studio/backend/application/singleagent" diff --git a/backend/api/handler/coze/intelligence_service.go b/backend/api/handler/coze/intelligence_service.go index 49015f92..a3dc8f2a 100644 --- a/backend/api/handler/coze/intelligence_service.go +++ b/backend/api/handler/coze/intelligence_service.go @@ -24,12 +24,11 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - - "github.com/coze-dev/coze-studio/backend/api/model/intelligence" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - project "github.com/coze-dev/coze-studio/backend/api/model/project" - publish "github.com/coze-dev/coze-studio/backend/api/model/publish" - task "github.com/coze-dev/coze-studio/backend/api/model/task" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" + project "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project" + publish "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish" + task "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task" appApplication "github.com/coze-dev/coze-studio/backend/application/app" "github.com/coze-dev/coze-studio/backend/application/search" ) diff --git a/backend/api/handler/coze/knowledge_service.go b/backend/api/handler/coze/knowledge_service.go index edde1eac..b85f802e 100644 --- a/backend/api/handler/coze/knowledge_service.go +++ b/backend/api/handler/coze/knowledge_service.go @@ -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) +} diff --git a/backend/api/handler/coze/memory_service.go b/backend/api/handler/coze/memory_service.go index 3cf1b64a..60ba9174 100644 --- a/backend/api/handler/coze/memory_service.go +++ b/backend/api/handler/coze/memory_service.go @@ -24,12 +24,9 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" - table "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" appApplication "github.com/coze-dev/coze-studio/backend/application/app" - "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/pkg/lang/conv" ) @@ -230,48 +227,3 @@ func GetPlayGroundMemory(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 document.GetDocumentTableInfoRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(document.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 table.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) -} diff --git a/backend/api/handler/coze/playground_service.go b/backend/api/handler/coze/playground_service.go index d0ce5c9e..15731c8b 100644 --- a/backend/api/handler/coze/playground_service.go +++ b/backend/api/handler/coze/playground_service.go @@ -23,8 +23,7 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" appApplication "github.com/coze-dev/coze-studio/backend/application/app" "github.com/coze-dev/coze-studio/backend/application/prompt" "github.com/coze-dev/coze-studio/backend/application/shortcutcmd" @@ -371,43 +370,3 @@ func GetFileUrls(ctx context.Context, c *app.RequestContext) { c.JSON(consts.StatusOK, resp) } - -// UploadFileOpen . -// @router /v1/files/upload [POST] -func UploadFileOpen(ctx context.Context, c *app.RequestContext) { - var err error - var req playground.UploadFileOpenRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(playground.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 playground.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) -} diff --git a/backend/api/handler/coze/plugin_develop_service.go b/backend/api/handler/coze/plugin_develop_service.go index 8ed24d46..7c7f65e5 100644 --- a/backend/api/handler/coze/plugin_develop_service.go +++ b/backend/api/handler/coze/plugin_develop_service.go @@ -25,8 +25,8 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/application/plugin" appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow" ) diff --git a/backend/api/handler/coze/public_product_service.go b/backend/api/handler/coze/public_product_service.go index bf74c7a7..169f3a25 100644 --- a/backend/api/handler/coze/public_product_service.go +++ b/backend/api/handler/coze/public_product_service.go @@ -22,18 +22,18 @@ import ( "context" "strconv" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + product_public_api "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow" "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common" + "github.com/coze-dev/coze-studio/backend/api/model/playground" appApplication "github.com/coze-dev/coze-studio/backend/application/app" "github.com/coze-dev/coze-studio/backend/application/modelmgr" "github.com/coze-dev/coze-studio/backend/application/plugin" diff --git a/backend/api/handler/coze/workflow_service.go b/backend/api/handler/coze/workflow_service.go index 2f0dbc91..4512576c 100644 --- a/backend/api/handler/coze/workflow_service.go +++ b/backend/api/handler/coze/workflow_service.go @@ -29,7 +29,7 @@ import ( "github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/cloudwego/hertz/pkg/protocol/sse" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" diff --git a/backend/api/handler/coze/workflow_service_test.go b/backend/api/handler/coze/workflow_service_test.go index fd2f0ceb..621a73c9 100644 --- a/backend/api/handler/coze/workflow_service_test.go +++ b/backend/api/handler/coze/workflow_service_test.go @@ -50,9 +50,9 @@ import ( modelknowledge "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" plugin2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" pluginmodel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/playground" + pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" appknowledge "github.com/coze-dev/coze-studio/backend/application/knowledge" appmemory "github.com/coze-dev/coze-studio/backend/application/memory" diff --git a/backend/api/model/ocean/cloud/bot_common/bot_common.go b/backend/api/model/app/bot_common/bot_common.go similarity index 100% rename from backend/api/model/ocean/cloud/bot_common/bot_common.go rename to backend/api/model/app/bot_common/bot_common.go diff --git a/backend/api/model/app/bot_open_api/bot_open_api.go b/backend/api/model/app/bot_open_api/bot_open_api.go new file mode 100644 index 00000000..ac3fb5da --- /dev/null +++ b/backend/api/model/app/bot_open_api/bot_open_api.go @@ -0,0 +1,2887 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Code generated by thriftgo (0.4.1). DO NOT EDIT. + +package bot_open_api + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/base" +) + +type OauthAuthorizationCodeReq struct { + Code string `thrift:"code,1" json:"code" query:"code"` + State string `thrift:"state,2" json:"state" query:"state"` +} + +func NewOauthAuthorizationCodeReq() *OauthAuthorizationCodeReq { + return &OauthAuthorizationCodeReq{} +} + +func (p *OauthAuthorizationCodeReq) InitDefault() { +} + +func (p *OauthAuthorizationCodeReq) GetCode() (v string) { + return p.Code +} + +func (p *OauthAuthorizationCodeReq) GetState() (v string) { + return p.State +} + +var fieldIDToName_OauthAuthorizationCodeReq = map[int16]string{ + 1: "code", + 2: "state", +} + +func (p *OauthAuthorizationCodeReq) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeReq[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *OauthAuthorizationCodeReq) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *OauthAuthorizationCodeReq) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.State = _field + return nil +} + +func (p *OauthAuthorizationCodeReq) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthAuthorizationCodeReq"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *OauthAuthorizationCodeReq) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *OauthAuthorizationCodeReq) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("state", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.State); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *OauthAuthorizationCodeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OauthAuthorizationCodeReq(%+v)", *p) + +} + +type OauthAuthorizationCodeResp struct { + BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` +} + +func NewOauthAuthorizationCodeResp() *OauthAuthorizationCodeResp { + return &OauthAuthorizationCodeResp{} +} + +func (p *OauthAuthorizationCodeResp) InitDefault() { +} + +var OauthAuthorizationCodeResp_BaseResp_DEFAULT *base.BaseResp + +func (p *OauthAuthorizationCodeResp) GetBaseResp() (v *base.BaseResp) { + if !p.IsSetBaseResp() { + return OauthAuthorizationCodeResp_BaseResp_DEFAULT + } + return p.BaseResp +} + +var fieldIDToName_OauthAuthorizationCodeResp = map[int16]string{ + 255: "BaseResp", +} + +func (p *OauthAuthorizationCodeResp) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *OauthAuthorizationCodeResp) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetBaseResp bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + issetBaseResp = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetBaseResp { + fieldId = 255 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeResp[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_OauthAuthorizationCodeResp[fieldId])) +} + +func (p *OauthAuthorizationCodeResp) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *OauthAuthorizationCodeResp) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthAuthorizationCodeResp"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *OauthAuthorizationCodeResp) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *OauthAuthorizationCodeResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OauthAuthorizationCodeResp(%+v)", *p) + +} + +type GetBotOnlineInfoReq struct { + // botId + BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` + // Keep it first, don't expose it, and don't use the field + ConnectorID *string `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` + // bot version, get the latest version if you don't pass it on. + Version *string `thrift:"version,3,optional" form:"version" json:"version,omitempty" query:"version"` +} + +func NewGetBotOnlineInfoReq() *GetBotOnlineInfoReq { + return &GetBotOnlineInfoReq{} +} + +func (p *GetBotOnlineInfoReq) InitDefault() { +} + +func (p *GetBotOnlineInfoReq) GetBotID() (v int64) { + return p.BotID +} + +var GetBotOnlineInfoReq_ConnectorID_DEFAULT string + +func (p *GetBotOnlineInfoReq) GetConnectorID() (v string) { + if !p.IsSetConnectorID() { + return GetBotOnlineInfoReq_ConnectorID_DEFAULT + } + return *p.ConnectorID +} + +var GetBotOnlineInfoReq_Version_DEFAULT string + +func (p *GetBotOnlineInfoReq) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetBotOnlineInfoReq_Version_DEFAULT + } + return *p.Version +} + +var fieldIDToName_GetBotOnlineInfoReq = map[int16]string{ + 1: "bot_id", + 2: "connector_id", + 3: "version", +} + +func (p *GetBotOnlineInfoReq) IsSetConnectorID() bool { + return p.ConnectorID != nil +} + +func (p *GetBotOnlineInfoReq) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetBotOnlineInfoReq) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetBotID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetBotID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetBotID { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBotOnlineInfoReq[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetBotOnlineInfoReq[fieldId])) +} + +func (p *GetBotOnlineInfoReq) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.BotID = _field + return nil +} +func (p *GetBotOnlineInfoReq) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ConnectorID = _field + return nil +} +func (p *GetBotOnlineInfoReq) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetBotOnlineInfoReq) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetBotOnlineInfoReq"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetBotOnlineInfoReq) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.BotID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetBotOnlineInfoReq) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetConnectorID() { + if err = oprot.WriteFieldBegin("connector_id", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ConnectorID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetBotOnlineInfoReq) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetBotOnlineInfoReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBotOnlineInfoReq(%+v)", *p) + +} + +type UploadFileOpenRequest struct { + // file type + ContentType string `thrift:"ContentType,1,required" header:"Content-Type,required" json:"ContentType,required"` + // binary data + Data []byte `thrift:"Data,2,required" json:"Data,required" raw_body:",required"` + Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` +} + +func NewUploadFileOpenRequest() *UploadFileOpenRequest { + return &UploadFileOpenRequest{} +} + +func (p *UploadFileOpenRequest) InitDefault() { +} + +func (p *UploadFileOpenRequest) GetContentType() (v string) { + return p.ContentType +} + +func (p *UploadFileOpenRequest) GetData() (v []byte) { + return p.Data +} + +var UploadFileOpenRequest_Base_DEFAULT *base.Base + +func (p *UploadFileOpenRequest) GetBase() (v *base.Base) { + if !p.IsSetBase() { + return UploadFileOpenRequest_Base_DEFAULT + } + return p.Base +} + +var fieldIDToName_UploadFileOpenRequest = map[int16]string{ + 1: "ContentType", + 2: "Data", + 255: "Base", +} + +func (p *UploadFileOpenRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *UploadFileOpenRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetContentType bool = false + var issetData bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetContentType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetData = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetContentType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetData { + fieldId = 2 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadFileOpenRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadFileOpenRequest[fieldId])) +} + +func (p *UploadFileOpenRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ContentType = _field + return nil +} +func (p *UploadFileOpenRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Data = _field + return nil +} +func (p *UploadFileOpenRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *UploadFileOpenRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadFileOpenRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UploadFileOpenRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("ContentType", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ContentType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *UploadFileOpenRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("Data", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Data)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *UploadFileOpenRequest) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *UploadFileOpenRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadFileOpenRequest(%+v)", *p) + +} + +type UploadFileOpenResponse struct { + File *File `thrift:"File,1,optional" form:"data" json:"data,omitempty"` + Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"` + Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` +} + +func NewUploadFileOpenResponse() *UploadFileOpenResponse { + return &UploadFileOpenResponse{} +} + +func (p *UploadFileOpenResponse) InitDefault() { +} + +var UploadFileOpenResponse_File_DEFAULT *File + +func (p *UploadFileOpenResponse) GetFile() (v *File) { + if !p.IsSetFile() { + return UploadFileOpenResponse_File_DEFAULT + } + return p.File +} + +func (p *UploadFileOpenResponse) GetCode() (v int64) { + return p.Code +} + +func (p *UploadFileOpenResponse) GetMsg() (v string) { + return p.Msg +} + +var UploadFileOpenResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *UploadFileOpenResponse) GetBaseResp() (v *base.BaseResp) { + if !p.IsSetBaseResp() { + return UploadFileOpenResponse_BaseResp_DEFAULT + } + return p.BaseResp +} + +var fieldIDToName_UploadFileOpenResponse = map[int16]string{ + 1: "File", + 253: "code", + 254: "msg", + 255: "BaseResp", +} + +func (p *UploadFileOpenResponse) IsSetFile() bool { + return p.File != nil +} + +func (p *UploadFileOpenResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *UploadFileOpenResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetCode bool = false + var issetMsg bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 253: + if fieldTypeId == thrift.I64 { + if err = p.ReadField253(iprot); err != nil { + goto ReadFieldError + } + issetCode = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 254: + if fieldTypeId == thrift.STRING { + if err = p.ReadField254(iprot); err != nil { + goto ReadFieldError + } + issetMsg = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetCode { + fieldId = 253 + goto RequiredFieldNotSetError + } + + if !issetMsg { + fieldId = 254 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadFileOpenResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadFileOpenResponse[fieldId])) +} + +func (p *UploadFileOpenResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewFile() + if err := _field.Read(iprot); err != nil { + return err + } + p.File = _field + return nil +} +func (p *UploadFileOpenResponse) ReadField253(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *UploadFileOpenResponse) ReadField254(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *UploadFileOpenResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *UploadFileOpenResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadFileOpenResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField253(oprot); err != nil { + fieldId = 253 + goto WriteFieldError + } + if err = p.writeField254(oprot); err != nil { + fieldId = 254 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UploadFileOpenResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetFile() { + if err = oprot.WriteFieldBegin("File", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.File.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *UploadFileOpenResponse) writeField253(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I64, 253); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) +} +func (p *UploadFileOpenResponse) writeField254(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) +} +func (p *UploadFileOpenResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *UploadFileOpenResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadFileOpenResponse(%+v)", *p) + +} + +type File struct { + // 文件URI + URI string `thrift:"URI,1" form:"uri" json:"uri"` + // 文件字节数 + Bytes int64 `thrift:"Bytes,2" form:"bytes" json:"bytes"` + // 上传时间戳,单位s + CreatedAt int64 `thrift:"CreatedAt,3" form:"CreatedAt" json:"CreatedAt" query:"CreatedAt"` + // 文件名 + FileName string `thrift:"FileName,4" form:"file_name" json:"file_name"` + URL string `thrift:"URL,5" form:"url" json:"url"` +} + +func NewFile() *File { + return &File{} +} + +func (p *File) InitDefault() { +} + +func (p *File) GetURI() (v string) { + return p.URI +} + +func (p *File) GetBytes() (v int64) { + return p.Bytes +} + +func (p *File) GetCreatedAt() (v int64) { + return p.CreatedAt +} + +func (p *File) GetFileName() (v string) { + return p.FileName +} + +func (p *File) GetURL() (v string) { + return p.URL +} + +var fieldIDToName_File = map[int16]string{ + 1: "URI", + 2: "Bytes", + 3: "CreatedAt", + 4: "FileName", + 5: "URL", +} + +func (p *File) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_File[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *File) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URI = _field + return nil +} +func (p *File) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Bytes = _field + return nil +} +func (p *File) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreatedAt = _field + return nil +} +func (p *File) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.FileName = _field + return nil +} +func (p *File) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} + +func (p *File) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("File"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *File) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("URI", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URI); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *File) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("Bytes", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Bytes); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *File) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("CreatedAt", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreatedAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *File) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("FileName", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.FileName); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *File) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("URL", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *File) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("File(%+v)", *p) + +} + +// resp +type GetBotOnlineInfoResp struct { + Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` + Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` + Data *bot_common.OpenAPIBotInfo `thrift:"data,3,required" form:"data,required" json:"data,required" query:"data,required"` +} + +func NewGetBotOnlineInfoResp() *GetBotOnlineInfoResp { + return &GetBotOnlineInfoResp{} +} + +func (p *GetBotOnlineInfoResp) InitDefault() { +} + +func (p *GetBotOnlineInfoResp) GetCode() (v int32) { + return p.Code +} + +func (p *GetBotOnlineInfoResp) GetMsg() (v string) { + return p.Msg +} + +var GetBotOnlineInfoResp_Data_DEFAULT *bot_common.OpenAPIBotInfo + +func (p *GetBotOnlineInfoResp) GetData() (v *bot_common.OpenAPIBotInfo) { + if !p.IsSetData() { + return GetBotOnlineInfoResp_Data_DEFAULT + } + return p.Data +} + +var fieldIDToName_GetBotOnlineInfoResp = map[int16]string{ + 1: "code", + 2: "msg", + 3: "data", +} + +func (p *GetBotOnlineInfoResp) IsSetData() bool { + return p.Data != nil +} + +func (p *GetBotOnlineInfoResp) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetCode bool = false + var issetMsg bool = false + var issetData bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetCode = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetMsg = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetData = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetCode { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetMsg { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetData { + fieldId = 3 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBotOnlineInfoResp[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetBotOnlineInfoResp[fieldId])) +} + +func (p *GetBotOnlineInfoResp) ReadField1(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *GetBotOnlineInfoResp) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *GetBotOnlineInfoResp) ReadField3(iprot thrift.TProtocol) error { + _field := bot_common.NewOpenAPIBotInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.Data = _field + return nil +} + +func (p *GetBotOnlineInfoResp) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetBotOnlineInfoResp"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetBotOnlineInfoResp) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetBotOnlineInfoResp) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetBotOnlineInfoResp) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Data.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetBotOnlineInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBotOnlineInfoResp(%+v)", *p) + +} + +type BotOpenApiService interface { + OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error) + //openapi + GetBotOnlineInfo(ctx context.Context, request *GetBotOnlineInfoReq) (r *GetBotOnlineInfoResp, err error) + // File related OpenAPI + UploadFileOpen(ctx context.Context, request *UploadFileOpenRequest) (r *UploadFileOpenResponse, err error) +} + +type BotOpenApiServiceClient struct { + c thrift.TClient +} + +func NewBotOpenApiServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *BotOpenApiServiceClient { + return &BotOpenApiServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewBotOpenApiServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BotOpenApiServiceClient { + return &BotOpenApiServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewBotOpenApiServiceClient(c thrift.TClient) *BotOpenApiServiceClient { + return &BotOpenApiServiceClient{ + c: c, + } +} + +func (p *BotOpenApiServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *BotOpenApiServiceClient) OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error) { + var _args BotOpenApiServiceOauthAuthorizationCodeArgs + _args.Request = request + var _result BotOpenApiServiceOauthAuthorizationCodeResult + if err = p.Client_().Call(ctx, "OauthAuthorizationCode", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *BotOpenApiServiceClient) GetBotOnlineInfo(ctx context.Context, request *GetBotOnlineInfoReq) (r *GetBotOnlineInfoResp, err error) { + var _args BotOpenApiServiceGetBotOnlineInfoArgs + _args.Request = request + var _result BotOpenApiServiceGetBotOnlineInfoResult + if err = p.Client_().Call(ctx, "GetBotOnlineInfo", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *BotOpenApiServiceClient) UploadFileOpen(ctx context.Context, request *UploadFileOpenRequest) (r *UploadFileOpenResponse, err error) { + var _args BotOpenApiServiceUploadFileOpenArgs + _args.Request = request + var _result BotOpenApiServiceUploadFileOpenResult + if err = p.Client_().Call(ctx, "UploadFileOpen", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type BotOpenApiServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler BotOpenApiService +} + +func (p *BotOpenApiServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *BotOpenApiServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *BotOpenApiServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewBotOpenApiServiceProcessor(handler BotOpenApiService) *BotOpenApiServiceProcessor { + self := &BotOpenApiServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("OauthAuthorizationCode", &botOpenApiServiceProcessorOauthAuthorizationCode{handler: handler}) + self.AddToProcessorMap("GetBotOnlineInfo", &botOpenApiServiceProcessorGetBotOnlineInfo{handler: handler}) + self.AddToProcessorMap("UploadFileOpen", &botOpenApiServiceProcessorUploadFileOpen{handler: handler}) + return self +} +func (p *BotOpenApiServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type botOpenApiServiceProcessorOauthAuthorizationCode struct { + handler BotOpenApiService +} + +func (p *botOpenApiServiceProcessorOauthAuthorizationCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := BotOpenApiServiceOauthAuthorizationCodeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := BotOpenApiServiceOauthAuthorizationCodeResult{} + var retval *OauthAuthorizationCodeResp + if retval, err2 = p.handler.OauthAuthorizationCode(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OauthAuthorizationCode: "+err2.Error()) + oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type botOpenApiServiceProcessorGetBotOnlineInfo struct { + handler BotOpenApiService +} + +func (p *botOpenApiServiceProcessorGetBotOnlineInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := BotOpenApiServiceGetBotOnlineInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := BotOpenApiServiceGetBotOnlineInfoResult{} + var retval *GetBotOnlineInfoResp + if retval, err2 = p.handler.GetBotOnlineInfo(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetBotOnlineInfo: "+err2.Error()) + oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type botOpenApiServiceProcessorUploadFileOpen struct { + handler BotOpenApiService +} + +func (p *botOpenApiServiceProcessorUploadFileOpen) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := BotOpenApiServiceUploadFileOpenArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("UploadFileOpen", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := BotOpenApiServiceUploadFileOpenResult{} + var retval *UploadFileOpenResponse + if retval, err2 = p.handler.UploadFileOpen(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadFileOpen: "+err2.Error()) + oprot.WriteMessageBegin("UploadFileOpen", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("UploadFileOpen", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type BotOpenApiServiceOauthAuthorizationCodeArgs struct { + Request *OauthAuthorizationCodeReq `thrift:"request,1"` +} + +func NewBotOpenApiServiceOauthAuthorizationCodeArgs() *BotOpenApiServiceOauthAuthorizationCodeArgs { + return &BotOpenApiServiceOauthAuthorizationCodeArgs{} +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) InitDefault() { +} + +var BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT *OauthAuthorizationCodeReq + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) GetRequest() (v *OauthAuthorizationCodeReq) { + if !p.IsSetRequest() { + return BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT + } + return p.Request +} + +var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs = map[int16]string{ + 1: "request", +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewOauthAuthorizationCodeReq() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthAuthorizationCode_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeArgs(%+v)", *p) + +} + +type BotOpenApiServiceOauthAuthorizationCodeResult struct { + Success *OauthAuthorizationCodeResp `thrift:"success,0,optional"` +} + +func NewBotOpenApiServiceOauthAuthorizationCodeResult() *BotOpenApiServiceOauthAuthorizationCodeResult { + return &BotOpenApiServiceOauthAuthorizationCodeResult{} +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) InitDefault() { +} + +var BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT *OauthAuthorizationCodeResp + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) GetSuccess() (v *OauthAuthorizationCodeResp) { + if !p.IsSetSuccess() { + return BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult = map[int16]string{ + 0: "success", +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewOauthAuthorizationCodeResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthAuthorizationCode_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *BotOpenApiServiceOauthAuthorizationCodeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeResult(%+v)", *p) + +} + +type BotOpenApiServiceGetBotOnlineInfoArgs struct { + Request *GetBotOnlineInfoReq `thrift:"request,1"` +} + +func NewBotOpenApiServiceGetBotOnlineInfoArgs() *BotOpenApiServiceGetBotOnlineInfoArgs { + return &BotOpenApiServiceGetBotOnlineInfoArgs{} +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) InitDefault() { +} + +var BotOpenApiServiceGetBotOnlineInfoArgs_Request_DEFAULT *GetBotOnlineInfoReq + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) GetRequest() (v *GetBotOnlineInfoReq) { + if !p.IsSetRequest() { + return BotOpenApiServiceGetBotOnlineInfoArgs_Request_DEFAULT + } + return p.Request +} + +var fieldIDToName_BotOpenApiServiceGetBotOnlineInfoArgs = map[int16]string{ + 1: "request", +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceGetBotOnlineInfoArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetBotOnlineInfoReq() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetBotOnlineInfo_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceGetBotOnlineInfoArgs(%+v)", *p) + +} + +type BotOpenApiServiceGetBotOnlineInfoResult struct { + Success *GetBotOnlineInfoResp `thrift:"success,0,optional"` +} + +func NewBotOpenApiServiceGetBotOnlineInfoResult() *BotOpenApiServiceGetBotOnlineInfoResult { + return &BotOpenApiServiceGetBotOnlineInfoResult{} +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) InitDefault() { +} + +var BotOpenApiServiceGetBotOnlineInfoResult_Success_DEFAULT *GetBotOnlineInfoResp + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) GetSuccess() (v *GetBotOnlineInfoResp) { + if !p.IsSetSuccess() { + return BotOpenApiServiceGetBotOnlineInfoResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_BotOpenApiServiceGetBotOnlineInfoResult = map[int16]string{ + 0: "success", +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceGetBotOnlineInfoResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetBotOnlineInfoResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetBotOnlineInfo_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *BotOpenApiServiceGetBotOnlineInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceGetBotOnlineInfoResult(%+v)", *p) + +} + +type BotOpenApiServiceUploadFileOpenArgs struct { + Request *UploadFileOpenRequest `thrift:"request,1"` +} + +func NewBotOpenApiServiceUploadFileOpenArgs() *BotOpenApiServiceUploadFileOpenArgs { + return &BotOpenApiServiceUploadFileOpenArgs{} +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) InitDefault() { +} + +var BotOpenApiServiceUploadFileOpenArgs_Request_DEFAULT *UploadFileOpenRequest + +func (p *BotOpenApiServiceUploadFileOpenArgs) GetRequest() (v *UploadFileOpenRequest) { + if !p.IsSetRequest() { + return BotOpenApiServiceUploadFileOpenArgs_Request_DEFAULT + } + return p.Request +} + +var fieldIDToName_BotOpenApiServiceUploadFileOpenArgs = map[int16]string{ + 1: "request", +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceUploadFileOpenArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadFileOpenRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadFileOpen_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceUploadFileOpenArgs(%+v)", *p) + +} + +type BotOpenApiServiceUploadFileOpenResult struct { + Success *UploadFileOpenResponse `thrift:"success,0,optional"` +} + +func NewBotOpenApiServiceUploadFileOpenResult() *BotOpenApiServiceUploadFileOpenResult { + return &BotOpenApiServiceUploadFileOpenResult{} +} + +func (p *BotOpenApiServiceUploadFileOpenResult) InitDefault() { +} + +var BotOpenApiServiceUploadFileOpenResult_Success_DEFAULT *UploadFileOpenResponse + +func (p *BotOpenApiServiceUploadFileOpenResult) GetSuccess() (v *UploadFileOpenResponse) { + if !p.IsSetSuccess() { + return BotOpenApiServiceUploadFileOpenResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_BotOpenApiServiceUploadFileOpenResult = map[int16]string{ + 0: "success", +} + +func (p *BotOpenApiServiceUploadFileOpenResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *BotOpenApiServiceUploadFileOpenResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceUploadFileOpenResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadFileOpenResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *BotOpenApiServiceUploadFileOpenResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadFileOpen_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *BotOpenApiServiceUploadFileOpenResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BotOpenApiServiceUploadFileOpenResult(%+v)", *p) + +} diff --git a/backend/api/model/ocean/cloud/developer_api/developer_api.go b/backend/api/model/app/developer_api/developer_api.go similarity index 99% rename from backend/api/model/ocean/cloud/developer_api/developer_api.go rename to backend/api/model/app/developer_api/developer_api.go index 667ea97c..87db210a 100644 --- a/backend/api/model/ocean/cloud/developer_api/developer_api.go +++ b/backend/api/model/app/developer_api/developer_api.go @@ -8,8 +8,8 @@ import ( "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/playground" ) type VisibilityType int64 diff --git a/backend/api/model/intelligence/common/common_struct.go b/backend/api/model/app/intelligence/common/common_struct.go similarity index 100% rename from backend/api/model/intelligence/common/common_struct.go rename to backend/api/model/app/intelligence/common/common_struct.go diff --git a/backend/api/model/intelligence/common/intelligence_common_struct.go b/backend/api/model/app/intelligence/common/intelligence_common_struct.go similarity index 100% rename from backend/api/model/intelligence/common/intelligence_common_struct.go rename to backend/api/model/app/intelligence/common/intelligence_common_struct.go diff --git a/backend/api/model/task_struct/task_struct.go b/backend/api/model/app/intelligence/common/task_struct.go similarity index 99% rename from backend/api/model/task_struct/task_struct.go rename to backend/api/model/app/intelligence/common/task_struct.go index c19c1fd9..c8ed35b6 100644 --- a/backend/api/model/task_struct/task_struct.go +++ b/backend/api/model/app/intelligence/common/task_struct.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package task_struct +package common import ( "fmt" diff --git a/backend/api/model/intelligence/intelligence.go b/backend/api/model/app/intelligence/intelligence.go similarity index 99% rename from backend/api/model/intelligence/intelligence.go rename to backend/api/model/app/intelligence/intelligence.go index 785990bc..2901bb33 100644 --- a/backend/api/model/intelligence/intelligence.go +++ b/backend/api/model/app/intelligence/intelligence.go @@ -1,3 +1,19 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by thriftgo (0.4.1). DO NOT EDIT. package intelligence @@ -6,9 +22,9 @@ import ( "context" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/project" - "github.com/coze-dev/coze-studio/backend/api/model/publish" - "github.com/coze-dev/coze-studio/backend/api/model/task" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task" ) type IntelligenceService interface { diff --git a/backend/api/model/project/project.go b/backend/api/model/app/intelligence/project/project.go similarity index 99% rename from backend/api/model/project/project.go rename to backend/api/model/app/intelligence/project/project.go index b973e3ae..13cd47c2 100644 --- a/backend/api/model/project/project.go +++ b/backend/api/model/app/intelligence/project/project.go @@ -5,8 +5,8 @@ package project import ( "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type DraftProjectCreateRequest struct { diff --git a/backend/api/model/publish/publish.go b/backend/api/model/app/intelligence/publish/publish.go similarity index 99% rename from backend/api/model/publish/publish.go rename to backend/api/model/app/intelligence/publish/publish.go index c9a963e0..a5f451b2 100644 --- a/backend/api/model/publish/publish.go +++ b/backend/api/model/app/intelligence/publish/publish.go @@ -7,8 +7,8 @@ import ( "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type ConnectorClassification int64 diff --git a/backend/api/model/intelligence/search.go b/backend/api/model/app/intelligence/search.go similarity index 99% rename from backend/api/model/intelligence/search.go rename to backend/api/model/app/intelligence/search.go index f69b1e98..de02224d 100644 --- a/backend/api/model/intelligence/search.go +++ b/backend/api/model/app/intelligence/search.go @@ -7,8 +7,8 @@ import ( "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type OrderBy int64 diff --git a/backend/api/model/task/task.go b/backend/api/model/app/intelligence/task/task.go similarity index 97% rename from backend/api/model/task/task.go rename to backend/api/model/app/intelligence/task/task.go index 2899cf8e..6198f554 100644 --- a/backend/api/model/task/task.go +++ b/backend/api/model/app/intelligence/task/task.go @@ -5,8 +5,8 @@ package task import ( "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/task_struct" ) type DraftProjectInnerTaskListRequest struct { @@ -513,7 +513,7 @@ func (p *DraftProjectInnerTaskListResponse) String() string { } type DraftProjectInnerTaskListData struct { - TaskList []*task_struct.ProjectInnerTaskInfo `thrift:"task_list,1" form:"task_list" json:"task_list" query:"task_list"` + TaskList []*common.ProjectInnerTaskInfo `thrift:"task_list,1" form:"task_list" json:"task_list" query:"task_list"` } func NewDraftProjectInnerTaskListData() *DraftProjectInnerTaskListData { @@ -523,7 +523,7 @@ func NewDraftProjectInnerTaskListData() *DraftProjectInnerTaskListData { func (p *DraftProjectInnerTaskListData) InitDefault() { } -func (p *DraftProjectInnerTaskListData) GetTaskList() (v []*task_struct.ProjectInnerTaskInfo) { +func (p *DraftProjectInnerTaskListData) GetTaskList() (v []*common.ProjectInnerTaskInfo) { return p.TaskList } @@ -591,8 +591,8 @@ func (p *DraftProjectInnerTaskListData) ReadField1(iprot thrift.TProtocol) error if err != nil { return err } - _field := make([]*task_struct.ProjectInnerTaskInfo, 0, size) - values := make([]task_struct.ProjectInnerTaskInfo, size) + _field := make([]*common.ProjectInnerTaskInfo, 0, size) + values := make([]common.ProjectInnerTaskInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() diff --git a/backend/api/model/common/common.go b/backend/api/model/common/common.go deleted file mode 100644 index c4925e0b..00000000 --- a/backend/api/model/common/common.go +++ /dev/null @@ -1,765 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package common - -import ( - "database/sql" - "database/sql/driver" - "fmt" - "github.com/apache/thrift/lib/go/thrift" -) - -type ColumnType int64 - -const ( - ColumnType_Unknown ColumnType = 0 - // Text - ColumnType_Text ColumnType = 1 - // number - ColumnType_Number ColumnType = 2 - // time - ColumnType_Date ColumnType = 3 - // float - ColumnType_Float ColumnType = 4 - // bool - ColumnType_Boolean ColumnType = 5 - // picture - ColumnType_Image ColumnType = 6 -) - -func (p ColumnType) String() string { - switch p { - case ColumnType_Unknown: - return "Unknown" - case ColumnType_Text: - return "Text" - case ColumnType_Number: - return "Number" - case ColumnType_Date: - return "Date" - case ColumnType_Float: - return "Float" - case ColumnType_Boolean: - return "Boolean" - case ColumnType_Image: - return "Image" - } - return "" -} - -func ColumnTypeFromString(s string) (ColumnType, error) { - switch s { - case "Unknown": - return ColumnType_Unknown, nil - case "Text": - return ColumnType_Text, nil - case "Number": - return ColumnType_Number, nil - case "Date": - return ColumnType_Date, nil - case "Float": - return ColumnType_Float, nil - case "Boolean": - return ColumnType_Boolean, nil - case "Image": - return ColumnType_Image, nil - } - return ColumnType(0), fmt.Errorf("not a valid ColumnType string") -} - -func ColumnTypePtr(v ColumnType) *ColumnType { return &v } -func (p *ColumnType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = ColumnType(result.Int64) - return -} - -func (p *ColumnType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type DocTableSheet struct { - // Number of sheet - ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"` - // Sheet name - SheetName string `thrift:"sheet_name,2" form:"sheet_name" json:"sheet_name" query:"sheet_name"` - // total number of rows - TotalRow int64 `thrift:"total_row,3" form:"total_row" json:"total_row" query:"total_row"` -} - -func NewDocTableSheet() *DocTableSheet { - return &DocTableSheet{} -} - -func (p *DocTableSheet) InitDefault() { -} - -func (p *DocTableSheet) GetID() (v int64) { - return p.ID -} - -func (p *DocTableSheet) GetSheetName() (v string) { - return p.SheetName -} - -func (p *DocTableSheet) GetTotalRow() (v int64) { - return p.TotalRow -} - -var fieldIDToName_DocTableSheet = map[int16]string{ - 1: "id", - 2: "sheet_name", - 3: "total_row", -} - -func (p *DocTableSheet) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableSheet[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *DocTableSheet) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ID = _field - return nil -} -func (p *DocTableSheet) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.SheetName = _field - return nil -} -func (p *DocTableSheet) ReadField3(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.TotalRow = _field - return nil -} - -func (p *DocTableSheet) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DocTableSheet"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *DocTableSheet) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *DocTableSheet) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sheet_name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.SheetName); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *DocTableSheet) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("total_row", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.TotalRow); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *DocTableSheet) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DocTableSheet(%+v)", *p) - -} - -// Table column information -type DocTableColumn struct { - // Column ID - ID int64 `thrift:"id,1" form:"id" json:"id,string"` - // column_name - ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"` - // Is it a semantically matched column? - IsSemantic bool `thrift:"is_semantic,3" form:"is_semantic" json:"is_semantic" query:"is_semantic"` - // List the serial number originally in excel - Sequence int64 `thrift:"sequence,4" form:"sequence" json:"sequence,string"` - // column type - ColumnType *ColumnType `thrift:"column_type,5,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"` - ContainsEmptyValue *bool `thrift:"contains_empty_value,6,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"` - // describe - Desc *string `thrift:"desc,7,optional" form:"desc" json:"desc,omitempty" query:"desc"` -} - -func NewDocTableColumn() *DocTableColumn { - return &DocTableColumn{} -} - -func (p *DocTableColumn) InitDefault() { -} - -func (p *DocTableColumn) GetID() (v int64) { - return p.ID -} - -func (p *DocTableColumn) GetColumnName() (v string) { - return p.ColumnName -} - -func (p *DocTableColumn) GetIsSemantic() (v bool) { - return p.IsSemantic -} - -func (p *DocTableColumn) GetSequence() (v int64) { - return p.Sequence -} - -var DocTableColumn_ColumnType_DEFAULT ColumnType - -func (p *DocTableColumn) GetColumnType() (v ColumnType) { - if !p.IsSetColumnType() { - return DocTableColumn_ColumnType_DEFAULT - } - return *p.ColumnType -} - -var DocTableColumn_ContainsEmptyValue_DEFAULT bool - -func (p *DocTableColumn) GetContainsEmptyValue() (v bool) { - if !p.IsSetContainsEmptyValue() { - return DocTableColumn_ContainsEmptyValue_DEFAULT - } - return *p.ContainsEmptyValue -} - -var DocTableColumn_Desc_DEFAULT string - -func (p *DocTableColumn) GetDesc() (v string) { - if !p.IsSetDesc() { - return DocTableColumn_Desc_DEFAULT - } - return *p.Desc -} - -var fieldIDToName_DocTableColumn = map[int16]string{ - 1: "id", - 2: "column_name", - 3: "is_semantic", - 4: "sequence", - 5: "column_type", - 6: "contains_empty_value", - 7: "desc", -} - -func (p *DocTableColumn) IsSetColumnType() bool { - return p.ColumnType != nil -} - -func (p *DocTableColumn) IsSetContainsEmptyValue() bool { - return p.ContainsEmptyValue != nil -} - -func (p *DocTableColumn) IsSetDesc() bool { - return p.Desc != nil -} - -func (p *DocTableColumn) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.I32 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRING { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableColumn[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *DocTableColumn) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ID = _field - return nil -} -func (p *DocTableColumn) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ColumnName = _field - return nil -} -func (p *DocTableColumn) ReadField3(iprot thrift.TProtocol) error { - - var _field bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = v - } - p.IsSemantic = _field - return nil -} -func (p *DocTableColumn) ReadField4(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.Sequence = _field - return nil -} -func (p *DocTableColumn) ReadField5(iprot thrift.TProtocol) error { - - var _field *ColumnType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := ColumnType(v) - _field = &tmp - } - p.ColumnType = _field - return nil -} -func (p *DocTableColumn) ReadField6(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.ContainsEmptyValue = _field - return nil -} -func (p *DocTableColumn) ReadField7(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Desc = _field - return nil -} - -func (p *DocTableColumn) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DocTableColumn"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *DocTableColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *DocTableColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("column_name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ColumnName); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *DocTableColumn) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_semantic", thrift.BOOL, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsSemantic); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *DocTableColumn) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sequence", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.Sequence); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *DocTableColumn) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetColumnType() { - if err = oprot.WriteFieldBegin("column_type", thrift.I32, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.ColumnType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *DocTableColumn) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetContainsEmptyValue() { - if err = oprot.WriteFieldBegin("contains_empty_value", thrift.BOOL, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.ContainsEmptyValue); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} -func (p *DocTableColumn) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetDesc() { - if err = oprot.WriteFieldBegin("desc", thrift.STRING, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Desc); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *DocTableColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DocTableColumn(%+v)", *p) - -} diff --git a/backend/api/model/coze/api.go b/backend/api/model/coze/api.go index 67f1b01d..a0e9afdd 100644 --- a/backend/api/model/coze/api.go +++ b/backend/api/model/coze/api.go @@ -1,26 +1,42 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by thriftgo (0.4.1). DO NOT EDIT. package coze import ( "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence" "github.com/coze-dev/coze-studio/backend/api/model/conversation/agentrun" "github.com/coze-dev/coze-studio/backend/api/model/conversation/conversation" "github.com/coze-dev/coze-studio/backend/api/model/conversation/message" - "github.com/coze-dev/coze-studio/backend/api/model/database" + "github.com/coze-dev/coze-studio/backend/api/model/data/database" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable" "github.com/coze-dev/coze-studio/backend/api/model/file/upload" - "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/memory" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" "github.com/coze-dev/coze-studio/backend/api/model/passport" "github.com/coze-dev/coze-studio/backend/api/model/permission/openapiauth" + "github.com/coze-dev/coze-studio/backend/api/model/playground" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop" "github.com/coze-dev/coze-studio/backend/api/model/resource" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" ) type IntelligenceService interface { @@ -154,28 +170,28 @@ func NewOpenAPIAuthServiceClient(c thrift.TClient) *OpenAPIAuthServiceClient { } type MemoryService interface { - memory.MemoryService + variable.MemoryService } type MemoryServiceClient struct { - *memory.MemoryServiceClient + *variable.MemoryServiceClient } func NewMemoryServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MemoryServiceClient { return &MemoryServiceClient{ - MemoryServiceClient: memory.NewMemoryServiceClientFactory(t, f), + MemoryServiceClient: variable.NewMemoryServiceClientFactory(t, f), } } func NewMemoryServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MemoryServiceClient { return &MemoryServiceClient{ - MemoryServiceClient: memory.NewMemoryServiceClientProtocol(t, iprot, oprot), + MemoryServiceClient: variable.NewMemoryServiceClientProtocol(t, iprot, oprot), } } func NewMemoryServiceClient(c thrift.TClient) *MemoryServiceClient { return &MemoryServiceClient{ - MemoryServiceClient: memory.NewMemoryServiceClient(c), + MemoryServiceClient: variable.NewMemoryServiceClient(c), } } @@ -388,28 +404,28 @@ func NewWorkflowServiceClient(c thrift.TClient) *WorkflowServiceClient { } type KnowledgeService interface { - dataset.DatasetService + knowledge.DatasetService } type KnowledgeServiceClient struct { - *dataset.DatasetServiceClient + *knowledge.DatasetServiceClient } func NewKnowledgeServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *KnowledgeServiceClient { return &KnowledgeServiceClient{ - DatasetServiceClient: dataset.NewDatasetServiceClientFactory(t, f), + DatasetServiceClient: knowledge.NewDatasetServiceClientFactory(t, f), } } func NewKnowledgeServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *KnowledgeServiceClient { return &KnowledgeServiceClient{ - DatasetServiceClient: dataset.NewDatasetServiceClientProtocol(t, iprot, oprot), + DatasetServiceClient: knowledge.NewDatasetServiceClientProtocol(t, iprot, oprot), } } func NewKnowledgeServiceClient(c thrift.TClient) *KnowledgeServiceClient { return &KnowledgeServiceClient{ - DatasetServiceClient: dataset.NewDatasetServiceClient(c), + DatasetServiceClient: knowledge.NewDatasetServiceClient(c), } } @@ -511,11 +527,11 @@ func NewOpenAPIAuthServiceProcessor(handler OpenAPIAuthService) *OpenAPIAuthServ } type MemoryServiceProcessor struct { - *memory.MemoryServiceProcessor + *variable.MemoryServiceProcessor } func NewMemoryServiceProcessor(handler MemoryService) *MemoryServiceProcessor { - self := &MemoryServiceProcessor{memory.NewMemoryServiceProcessor(handler)} + self := &MemoryServiceProcessor{variable.NewMemoryServiceProcessor(handler)} return self } @@ -592,11 +608,11 @@ func NewWorkflowServiceProcessor(handler WorkflowService) *WorkflowServiceProces } type KnowledgeServiceProcessor struct { - *dataset.DatasetServiceProcessor + *knowledge.DatasetServiceProcessor } func NewKnowledgeServiceProcessor(handler KnowledgeService) *KnowledgeServiceProcessor { - self := &KnowledgeServiceProcessor{dataset.NewDatasetServiceProcessor(handler)} + self := &KnowledgeServiceProcessor{knowledge.NewDatasetServiceProcessor(handler)} return self } diff --git a/backend/api/model/crossdomain/connector/connector.go b/backend/api/model/crossdomain/connector/connector.go index 7c4b027e..a94f8257 100644 --- a/backend/api/model/crossdomain/connector/connector.go +++ b/backend/api/model/crossdomain/connector/connector.go @@ -16,7 +16,7 @@ package connector -import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" +import "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" type Connector struct { ID int64 `json:"id"` diff --git a/backend/api/model/crossdomain/database/database.go b/backend/api/model/crossdomain/database/database.go index 69f067b3..0033c1c4 100644 --- a/backend/api/model/crossdomain/database/database.go +++ b/backend/api/model/crossdomain/database/database.go @@ -17,8 +17,8 @@ package database import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" ) type ExecuteSQLRequest struct { diff --git a/backend/api/model/crossdomain/plugin/convert.go b/backend/api/model/crossdomain/plugin/convert.go index b0c80271..dff3c994 100644 --- a/backend/api/model/crossdomain/plugin/convert.go +++ b/backend/api/model/crossdomain/plugin/convert.go @@ -21,7 +21,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" ) var httpParamLocations = map[common.ParameterLocation]HTTPParamLocation{ diff --git a/backend/api/model/crossdomain/plugin/plugin.go b/backend/api/model/crossdomain/plugin/plugin.go index efa77d5d..07866138 100644 --- a/backend/api/model/crossdomain/plugin/plugin.go +++ b/backend/api/model/crossdomain/plugin/plugin.go @@ -19,7 +19,7 @@ package plugin import ( "github.com/getkin/kin-openapi/openapi3" - api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" ) type VersionPlugin struct { diff --git a/backend/api/model/crossdomain/plugin/plugin_manifest.go b/backend/api/model/crossdomain/plugin/plugin_manifest.go index 616faeac..7d2894cf 100644 --- a/backend/api/model/crossdomain/plugin/plugin_manifest.go +++ b/backend/api/model/crossdomain/plugin/plugin_manifest.go @@ -22,7 +22,7 @@ import ( "os" "strings" - api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt" "github.com/coze-dev/coze-studio/backend/pkg/errorx" "github.com/coze-dev/coze-studio/backend/types/errno" diff --git a/backend/api/model/crossdomain/plugin/toolinfo.go b/backend/api/model/crossdomain/plugin/toolinfo.go index f78def7c..dbe80250 100644 --- a/backend/api/model/crossdomain/plugin/toolinfo.go +++ b/backend/api/model/crossdomain/plugin/toolinfo.go @@ -22,14 +22,12 @@ import ( "strconv" "strings" - "github.com/getkin/kin-openapi/openapi3" - gonanoid "github.com/matoous/go-nanoid" - - productAPI "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" "github.com/coze-dev/coze-studio/backend/pkg/lang/slices" + "github.com/getkin/kin-openapi/openapi3" + gonanoid "github.com/matoous/go-nanoid" ) type ToolInfo struct { @@ -40,7 +38,7 @@ type ToolInfo struct { Version *string ActivatedStatus *ActivatedStatus - DebugStatus *plugin_develop_common.APIDebugStatus + DebugStatus *common.APIDebugStatus Method *string SubURL *string diff --git a/backend/api/model/crossdomain/singleagent/single_agent.go b/backend/api/model/crossdomain/singleagent/single_agent.go index a58cb12a..9b3088e3 100644 --- a/backend/api/model/crossdomain/singleagent/single_agent.go +++ b/backend/api/model/crossdomain/singleagent/single_agent.go @@ -20,9 +20,9 @@ import ( "github.com/cloudwego/eino/schema" "gorm.io/gorm" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossworkflow" ) diff --git a/backend/api/model/crossdomain/variables/variable_instance.go b/backend/api/model/crossdomain/variables/variable_instance.go index df32738e..d0f8919c 100644 --- a/backend/api/model/crossdomain/variables/variable_instance.go +++ b/backend/api/model/crossdomain/variables/variable_instance.go @@ -17,7 +17,7 @@ package variables import ( - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type UserVariableMeta struct { diff --git a/backend/api/model/database/database.go b/backend/api/model/data/database/database_svc.go similarity index 99% rename from backend/api/model/database/database.go rename to backend/api/model/data/database/database_svc.go index cff55612..34b50cba 100644 --- a/backend/api/model/database/database.go +++ b/backend/api/model/data/database/database_svc.go @@ -6,8 +6,8 @@ import ( "context" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" ) type DatabaseService interface { @@ -41,7 +41,7 @@ type DatabaseService interface { UpdateDatabaseBotSwitch(ctx context.Context, req *table.UpdateDatabaseBotSwitchRequest) (r *table.UpdateDatabaseBotSwitchResponse, err error) - GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *document.GetTableSchemaInfoResponse, err error) + GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *knowledge.GetTableSchemaInfoResponse, err error) ValidateDatabaseTableSchema(ctx context.Context, req *table.ValidateTableSchemaRequest) (r *table.ValidateTableSchemaResponse, err error) @@ -211,7 +211,7 @@ func (p *DatabaseServiceClient) UpdateDatabaseBotSwitch(ctx context.Context, req } return _result.GetSuccess(), nil } -func (p *DatabaseServiceClient) GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *document.GetTableSchemaInfoResponse, err error) { +func (p *DatabaseServiceClient) GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *knowledge.GetTableSchemaInfoResponse, err error) { var _args DatabaseServiceGetDatabaseTableSchemaArgs _args.Req = req var _result DatabaseServiceGetDatabaseTableSchemaResult @@ -1046,7 +1046,7 @@ func (p *databaseServiceProcessorGetDatabaseTableSchema) Process(ctx context.Con iprot.ReadMessageEnd() var err2 error result := DatabaseServiceGetDatabaseTableSchemaResult{} - var retval *document.GetTableSchemaInfoResponse + var retval *knowledge.GetTableSchemaInfoResponse if retval, err2 = p.handler.GetDatabaseTableSchema(ctx, args.Req); err2 != nil { x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDatabaseTableSchema: "+err2.Error()) oprot.WriteMessageBegin("GetDatabaseTableSchema", thrift.EXCEPTION, seqId) @@ -5745,7 +5745,7 @@ func (p *DatabaseServiceGetDatabaseTableSchemaArgs) String() string { } type DatabaseServiceGetDatabaseTableSchemaResult struct { - Success *document.GetTableSchemaInfoResponse `thrift:"success,0,optional"` + Success *knowledge.GetTableSchemaInfoResponse `thrift:"success,0,optional"` } func NewDatabaseServiceGetDatabaseTableSchemaResult() *DatabaseServiceGetDatabaseTableSchemaResult { @@ -5755,9 +5755,9 @@ func NewDatabaseServiceGetDatabaseTableSchemaResult() *DatabaseServiceGetDatabas func (p *DatabaseServiceGetDatabaseTableSchemaResult) InitDefault() { } -var DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT *document.GetTableSchemaInfoResponse +var DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT *knowledge.GetTableSchemaInfoResponse -func (p *DatabaseServiceGetDatabaseTableSchemaResult) GetSuccess() (v *document.GetTableSchemaInfoResponse) { +func (p *DatabaseServiceGetDatabaseTableSchemaResult) GetSuccess() (v *knowledge.GetTableSchemaInfoResponse) { if !p.IsSetSuccess() { return DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT } @@ -5828,7 +5828,7 @@ ReadStructEndError: } func (p *DatabaseServiceGetDatabaseTableSchemaResult) ReadField0(iprot thrift.TProtocol) error { - _field := document.NewGetTableSchemaInfoResponse() + _field := knowledge.NewGetTableSchemaInfoResponse() if err := _field.Read(iprot); err != nil { return err } diff --git a/backend/api/model/table/table.go b/backend/api/model/data/database/table/table.go similarity index 96% rename from backend/api/model/table/table.go rename to backend/api/model/data/database/table/table.go index 1f3888dd..8fc1017d 100644 --- a/backend/api/model/table/table.go +++ b/backend/api/model/data/database/table/table.go @@ -15354,828 +15354,6 @@ func (p *GetNL2SQLResponse) String() string { } -type GetModeConfigRequest struct { - // bot id - BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // line of business id - ConnectorID *int64 `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // line of business user id - ConnectorUID *string `thrift:"connector_uid,3,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewGetModeConfigRequest() *GetModeConfigRequest { - return &GetModeConfigRequest{} -} - -func (p *GetModeConfigRequest) InitDefault() { -} - -func (p *GetModeConfigRequest) GetBotID() (v int64) { - return p.BotID -} - -var GetModeConfigRequest_ConnectorID_DEFAULT int64 - -func (p *GetModeConfigRequest) GetConnectorID() (v int64) { - if !p.IsSetConnectorID() { - return GetModeConfigRequest_ConnectorID_DEFAULT - } - return *p.ConnectorID -} - -var GetModeConfigRequest_ConnectorUID_DEFAULT string - -func (p *GetModeConfigRequest) GetConnectorUID() (v string) { - if !p.IsSetConnectorUID() { - return GetModeConfigRequest_ConnectorUID_DEFAULT - } - return *p.ConnectorUID -} - -var GetModeConfigRequest_Base_DEFAULT *base.Base - -func (p *GetModeConfigRequest) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return GetModeConfigRequest_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_GetModeConfigRequest = map[int16]string{ - 1: "bot_id", - 2: "connector_id", - 3: "connector_uid", - 255: "Base", -} - -func (p *GetModeConfigRequest) IsSetConnectorID() bool { - return p.ConnectorID != nil -} - -func (p *GetModeConfigRequest) IsSetConnectorUID() bool { - return p.ConnectorUID != nil -} - -func (p *GetModeConfigRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *GetModeConfigRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetBotID bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetBotID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetBotID { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetModeConfigRequest[fieldId])) -} - -func (p *GetModeConfigRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.BotID = _field - return nil -} -func (p *GetModeConfigRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.ConnectorID = _field - return nil -} -func (p *GetModeConfigRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ConnectorUID = _field - return nil -} -func (p *GetModeConfigRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *GetModeConfigRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetModeConfigRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetModeConfigRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.BotID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetModeConfigRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorID() { - if err = oprot.WriteFieldBegin("connector_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.ConnectorID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetModeConfigRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorUID() { - if err = oprot.WriteFieldBegin("connector_uid", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ConnectorUID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *GetModeConfigRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetModeConfigRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetModeConfigRequest(%+v)", *p) - -} - -type GetModeConfigResponse struct { - Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - Mode string `thrift:"mode,3" form:"mode" json:"mode" query:"mode"` - BotID int64 `thrift:"bot_id,4" form:"bot_id" json:"bot_id" query:"bot_id"` - MaxTableNum int64 `thrift:"max_table_num,5" form:"max_table_num" json:"max_table_num" query:"max_table_num"` - MaxColumnNum int64 `thrift:"max_column_num,6" form:"max_column_num" json:"max_column_num" query:"max_column_num"` - MaxCapacityKb int64 `thrift:"max_capacity_kb,7" form:"max_capacity_kb" json:"max_capacity_kb" query:"max_capacity_kb"` - MaxRowNum int64 `thrift:"max_row_num,8" form:"max_row_num" json:"max_row_num" query:"max_row_num"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` -} - -func NewGetModeConfigResponse() *GetModeConfigResponse { - return &GetModeConfigResponse{} -} - -func (p *GetModeConfigResponse) InitDefault() { -} - -func (p *GetModeConfigResponse) GetCode() (v int32) { - return p.Code -} - -func (p *GetModeConfigResponse) GetMsg() (v string) { - return p.Msg -} - -func (p *GetModeConfigResponse) GetMode() (v string) { - return p.Mode -} - -func (p *GetModeConfigResponse) GetBotID() (v int64) { - return p.BotID -} - -func (p *GetModeConfigResponse) GetMaxTableNum() (v int64) { - return p.MaxTableNum -} - -func (p *GetModeConfigResponse) GetMaxColumnNum() (v int64) { - return p.MaxColumnNum -} - -func (p *GetModeConfigResponse) GetMaxCapacityKb() (v int64) { - return p.MaxCapacityKb -} - -func (p *GetModeConfigResponse) GetMaxRowNum() (v int64) { - return p.MaxRowNum -} - -var GetModeConfigResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *GetModeConfigResponse) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return GetModeConfigResponse_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_GetModeConfigResponse = map[int16]string{ - 1: "code", - 2: "msg", - 3: "mode", - 4: "bot_id", - 5: "max_table_num", - 6: "max_column_num", - 7: "max_capacity_kb", - 8: "max_row_num", - 255: "BaseResp", -} - -func (p *GetModeConfigResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *GetModeConfigResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.I64 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I64 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.I64 { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *GetModeConfigResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *GetModeConfigResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *GetModeConfigResponse) ReadField3(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Mode = _field - return nil -} -func (p *GetModeConfigResponse) ReadField4(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.BotID = _field - return nil -} -func (p *GetModeConfigResponse) ReadField5(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.MaxTableNum = _field - return nil -} -func (p *GetModeConfigResponse) ReadField6(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.MaxColumnNum = _field - return nil -} -func (p *GetModeConfigResponse) ReadField7(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.MaxCapacityKb = _field - return nil -} -func (p *GetModeConfigResponse) ReadField8(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.MaxRowNum = _field - return nil -} -func (p *GetModeConfigResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *GetModeConfigResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetModeConfigResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetModeConfigResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("mode", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Mode); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.BotID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("max_table_num", thrift.I64, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.MaxTableNum); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("max_column_num", thrift.I64, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.MaxColumnNum); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("max_capacity_kb", thrift.I64, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.MaxCapacityKb); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("max_row_num", thrift.I64, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.MaxRowNum); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) -} -func (p *GetModeConfigResponse) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetModeConfigResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetModeConfigResponse(%+v)", *p) - -} - type ResetBotTableRequest struct { CreatorID *int64 `thrift:"creator_id,1,optional" form:"creator_id" json:"creator_id,string,omitempty" query:"creator_id"` BotID *int64 `thrift:"bot_id,2,optional" form:"bot_id" json:"bot_id,string,omitempty" query:"bot_id"` @@ -30217,238 +29395,6 @@ func (p *GetTableSchemaRequest) String() string { } -type DocTableSheet struct { - // Number of sheet - ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"` - // Sheet name - SheetName string `thrift:"sheet_name,2" form:"sheet_name" json:"sheet_name" query:"sheet_name"` - // total number of rows - TotalRow int64 `thrift:"total_row,3" form:"total_row" json:"total_row" query:"total_row"` -} - -func NewDocTableSheet() *DocTableSheet { - return &DocTableSheet{} -} - -func (p *DocTableSheet) InitDefault() { -} - -func (p *DocTableSheet) GetID() (v int64) { - return p.ID -} - -func (p *DocTableSheet) GetSheetName() (v string) { - return p.SheetName -} - -func (p *DocTableSheet) GetTotalRow() (v int64) { - return p.TotalRow -} - -var fieldIDToName_DocTableSheet = map[int16]string{ - 1: "id", - 2: "sheet_name", - 3: "total_row", -} - -func (p *DocTableSheet) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableSheet[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *DocTableSheet) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ID = _field - return nil -} -func (p *DocTableSheet) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.SheetName = _field - return nil -} -func (p *DocTableSheet) ReadField3(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.TotalRow = _field - return nil -} - -func (p *DocTableSheet) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DocTableSheet"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *DocTableSheet) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *DocTableSheet) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sheet_name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.SheetName); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *DocTableSheet) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("total_row", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.TotalRow); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *DocTableSheet) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DocTableSheet(%+v)", *p) - -} - type TableColumn struct { // Column ID ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` diff --git a/backend/api/model/flow/dataengine/dataset/common.go b/backend/api/model/data/knowledge/common.go similarity index 79% rename from backend/api/model/flow/dataengine/dataset/common.go rename to backend/api/model/data/knowledge/common.go index 32589ad6..7c88ee6b 100644 --- a/backend/api/model/flow/dataengine/dataset/common.go +++ b/backend/api/model/data/knowledge/common.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "database/sql" @@ -503,6 +503,79 @@ func (p *ReviewStatus) Value() (driver.Value, error) { return int64(*p), nil } +type ColumnType int64 + +const ( + ColumnType_Unknown ColumnType = 0 + // Text + ColumnType_Text ColumnType = 1 + // number + ColumnType_Number ColumnType = 2 + // time + ColumnType_Date ColumnType = 3 + // float + ColumnType_Float ColumnType = 4 + // bool + ColumnType_Boolean ColumnType = 5 + // picture + ColumnType_Image ColumnType = 6 +) + +func (p ColumnType) String() string { + switch p { + case ColumnType_Unknown: + return "Unknown" + case ColumnType_Text: + return "Text" + case ColumnType_Number: + return "Number" + case ColumnType_Date: + return "Date" + case ColumnType_Float: + return "Float" + case ColumnType_Boolean: + return "Boolean" + case ColumnType_Image: + return "Image" + } + return "" +} + +func ColumnTypeFromString(s string) (ColumnType, error) { + switch s { + case "Unknown": + return ColumnType_Unknown, nil + case "Text": + return ColumnType_Text, nil + case "Number": + return ColumnType_Number, nil + case "Date": + return ColumnType_Date, nil + case "Float": + return ColumnType_Float, nil + case "Boolean": + return ColumnType_Boolean, nil + case "Image": + return ColumnType_Image, nil + } + return ColumnType(0), fmt.Errorf("not a valid ColumnType string") +} + +func ColumnTypePtr(v ColumnType) *ColumnType { return &v } +func (p *ColumnType) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = ColumnType(result.Int64) + return +} + +func (p *ColumnType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + type ChunkStrategy struct { // A separator, such as a period Separator string `thrift:"separator,1" form:"separator" json:"separator" query:"separator"` @@ -2011,3 +2084,453 @@ func (p *SinkStrategy) String() string { return fmt.Sprintf("SinkStrategy(%+v)", *p) } + +// Table column information +type DocTableColumn struct { + // Column ID + ID int64 `thrift:"id,1" form:"id" json:"id,string"` + // column_name + ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"` + // Is it a semantically matched column? + IsSemantic bool `thrift:"is_semantic,3" form:"is_semantic" json:"is_semantic" query:"is_semantic"` + // List the serial number originally in excel + Sequence int64 `thrift:"sequence,4" form:"sequence" json:"sequence,string"` + // column type + ColumnType *ColumnType `thrift:"column_type,5,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"` + ContainsEmptyValue *bool `thrift:"contains_empty_value,6,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"` + // describe + Desc *string `thrift:"desc,7,optional" form:"desc" json:"desc,omitempty" query:"desc"` +} + +func NewDocTableColumn() *DocTableColumn { + return &DocTableColumn{} +} + +func (p *DocTableColumn) InitDefault() { +} + +func (p *DocTableColumn) GetID() (v int64) { + return p.ID +} + +func (p *DocTableColumn) GetColumnName() (v string) { + return p.ColumnName +} + +func (p *DocTableColumn) GetIsSemantic() (v bool) { + return p.IsSemantic +} + +func (p *DocTableColumn) GetSequence() (v int64) { + return p.Sequence +} + +var DocTableColumn_ColumnType_DEFAULT ColumnType + +func (p *DocTableColumn) GetColumnType() (v ColumnType) { + if !p.IsSetColumnType() { + return DocTableColumn_ColumnType_DEFAULT + } + return *p.ColumnType +} + +var DocTableColumn_ContainsEmptyValue_DEFAULT bool + +func (p *DocTableColumn) GetContainsEmptyValue() (v bool) { + if !p.IsSetContainsEmptyValue() { + return DocTableColumn_ContainsEmptyValue_DEFAULT + } + return *p.ContainsEmptyValue +} + +var DocTableColumn_Desc_DEFAULT string + +func (p *DocTableColumn) GetDesc() (v string) { + if !p.IsSetDesc() { + return DocTableColumn_Desc_DEFAULT + } + return *p.Desc +} + +var fieldIDToName_DocTableColumn = map[int16]string{ + 1: "id", + 2: "column_name", + 3: "is_semantic", + 4: "sequence", + 5: "column_type", + 6: "contains_empty_value", + 7: "desc", +} + +func (p *DocTableColumn) IsSetColumnType() bool { + return p.ColumnType != nil +} + +func (p *DocTableColumn) IsSetContainsEmptyValue() bool { + return p.ContainsEmptyValue != nil +} + +func (p *DocTableColumn) IsSetDesc() bool { + return p.Desc != nil +} + +func (p *DocTableColumn) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I32 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableColumn[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DocTableColumn) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ID = _field + return nil +} +func (p *DocTableColumn) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ColumnName = _field + return nil +} +func (p *DocTableColumn) ReadField3(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.IsSemantic = _field + return nil +} +func (p *DocTableColumn) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Sequence = _field + return nil +} +func (p *DocTableColumn) ReadField5(iprot thrift.TProtocol) error { + + var _field *ColumnType + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := ColumnType(v) + _field = &tmp + } + p.ColumnType = _field + return nil +} +func (p *DocTableColumn) ReadField6(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.ContainsEmptyValue = _field + return nil +} +func (p *DocTableColumn) ReadField7(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Desc = _field + return nil +} + +func (p *DocTableColumn) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DocTableColumn"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DocTableColumn) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *DocTableColumn) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("column_name", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ColumnName); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *DocTableColumn) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("is_semantic", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.IsSemantic); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *DocTableColumn) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("sequence", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Sequence); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *DocTableColumn) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetColumnType() { + if err = oprot.WriteFieldBegin("column_type", thrift.I32, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.ColumnType)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *DocTableColumn) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetContainsEmptyValue() { + if err = oprot.WriteFieldBegin("contains_empty_value", thrift.BOOL, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.ContainsEmptyValue); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} +func (p *DocTableColumn) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetDesc() { + if err = oprot.WriteFieldBegin("desc", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Desc); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *DocTableColumn) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DocTableColumn(%+v)", *p) + +} diff --git a/backend/api/model/flow/dataengine/dataset/document.go b/backend/api/model/data/knowledge/document.go similarity index 90% rename from backend/api/model/flow/dataengine/dataset/document.go rename to backend/api/model/data/knowledge/document.go index d1279a69..3a5634da 100644 --- a/backend/api/model/flow/dataengine/dataset/document.go +++ b/backend/api/model/data/knowledge/document.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "database/sql" @@ -10,79 +10,6 @@ import ( "github.com/coze-dev/coze-studio/backend/api/model/base" ) -type ColumnType int64 - -const ( - ColumnType_Unknown ColumnType = 0 - // Text - ColumnType_Text ColumnType = 1 - // number - ColumnType_Number ColumnType = 2 - // time - ColumnType_Date ColumnType = 3 - // float - ColumnType_Float ColumnType = 4 - // bool - ColumnType_Boolean ColumnType = 5 - // picture - ColumnType_Image ColumnType = 6 -) - -func (p ColumnType) String() string { - switch p { - case ColumnType_Unknown: - return "Unknown" - case ColumnType_Text: - return "Text" - case ColumnType_Number: - return "Number" - case ColumnType_Date: - return "Date" - case ColumnType_Float: - return "Float" - case ColumnType_Boolean: - return "Boolean" - case ColumnType_Image: - return "Image" - } - return "" -} - -func ColumnTypeFromString(s string) (ColumnType, error) { - switch s { - case "Unknown": - return ColumnType_Unknown, nil - case "Text": - return ColumnType_Text, nil - case "Number": - return ColumnType_Number, nil - case "Date": - return ColumnType_Date, nil - case "Float": - return ColumnType_Float, nil - case "Boolean": - return ColumnType_Boolean, nil - case "Image": - return ColumnType_Image, nil - } - return ColumnType(0), fmt.Errorf("not a valid ColumnType string") -} - -func ColumnTypePtr(v ColumnType) *ColumnType { return &v } -func (p *ColumnType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = ColumnType(result.Int64) - return -} - -func (p *ColumnType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - type TableDataType int64 const ( @@ -12805,3 +12732,1300 @@ func (p *ExtractPhotoCaptionResponse) String() string { return fmt.Sprintf("ExtractPhotoCaptionResponse(%+v)", *p) } + +type GetDocumentTableInfoRequest struct { + // If the table is uploaded for the first local file, pass the value + TosURI *string `thrift:"tos_uri,2,optional" form:"tos_uri" json:"tos_uri,omitempty" query:"tos_uri"` + // If it is a document with an existing table, pass the value + DocumentID *int64 `thrift:"document_id,3,optional" form:"document_id" json:"document_id,string,omitempty"` + // Creator [http interface does not need to be passed] + CreatorID int64 `thrift:"creator_id,4" form:"creator_id" json:"creator_id" query:"creator_id"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewGetDocumentTableInfoRequest() *GetDocumentTableInfoRequest { + return &GetDocumentTableInfoRequest{} +} + +func (p *GetDocumentTableInfoRequest) InitDefault() { +} + +var GetDocumentTableInfoRequest_TosURI_DEFAULT string + +func (p *GetDocumentTableInfoRequest) GetTosURI() (v string) { + if !p.IsSetTosURI() { + return GetDocumentTableInfoRequest_TosURI_DEFAULT + } + return *p.TosURI +} + +var GetDocumentTableInfoRequest_DocumentID_DEFAULT int64 + +func (p *GetDocumentTableInfoRequest) GetDocumentID() (v int64) { + if !p.IsSetDocumentID() { + return GetDocumentTableInfoRequest_DocumentID_DEFAULT + } + return *p.DocumentID +} + +func (p *GetDocumentTableInfoRequest) GetCreatorID() (v int64) { + return p.CreatorID +} + +var GetDocumentTableInfoRequest_Base_DEFAULT *base.Base + +func (p *GetDocumentTableInfoRequest) GetBase() (v *base.Base) { + if !p.IsSetBase() { + return GetDocumentTableInfoRequest_Base_DEFAULT + } + return p.Base +} + +var fieldIDToName_GetDocumentTableInfoRequest = map[int16]string{ + 2: "tos_uri", + 3: "document_id", + 4: "creator_id", + 255: "Base", +} + +func (p *GetDocumentTableInfoRequest) IsSetTosURI() bool { + return p.TosURI != nil +} + +func (p *GetDocumentTableInfoRequest) IsSetDocumentID() bool { + return p.DocumentID != nil +} + +func (p *GetDocumentTableInfoRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetDocumentTableInfoRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDocumentTableInfoRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetDocumentTableInfoRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.TosURI = _field + return nil +} +func (p *GetDocumentTableInfoRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.DocumentID = _field + return nil +} +func (p *GetDocumentTableInfoRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreatorID = _field + return nil +} +func (p *GetDocumentTableInfoRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *GetDocumentTableInfoRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDocumentTableInfoRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetDocumentTableInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTosURI() { + if err = oprot.WriteFieldBegin("tos_uri", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.TosURI); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetDocumentTableInfoRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetDocumentID() { + if err = oprot.WriteFieldBegin("document_id", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.DocumentID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *GetDocumentTableInfoRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("creator_id", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreatorID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *GetDocumentTableInfoRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *GetDocumentTableInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDocumentTableInfoRequest(%+v)", *p) + +} + +type GetDocumentTableInfoResponse struct { + Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + SheetList []*DocTableSheet `thrift:"sheet_list,3" form:"sheet_list" json:"sheet_list" query:"sheet_list"` + // key: sheet_id -> list + TableMeta map[string][]*DocTableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta"` + // key: sheet_id -> list_preview_data + PreviewData map[string][]map[string]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"-" json:"-" query:"-"` +} + +func NewGetDocumentTableInfoResponse() *GetDocumentTableInfoResponse { + return &GetDocumentTableInfoResponse{} +} + +func (p *GetDocumentTableInfoResponse) InitDefault() { +} + +func (p *GetDocumentTableInfoResponse) GetCode() (v int32) { + return p.Code +} + +func (p *GetDocumentTableInfoResponse) GetMsg() (v string) { + return p.Msg +} + +func (p *GetDocumentTableInfoResponse) GetSheetList() (v []*DocTableSheet) { + return p.SheetList +} + +func (p *GetDocumentTableInfoResponse) GetTableMeta() (v map[string][]*DocTableColumn) { + return p.TableMeta +} + +func (p *GetDocumentTableInfoResponse) GetPreviewData() (v map[string][]map[string]string) { + return p.PreviewData +} + +var GetDocumentTableInfoResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *GetDocumentTableInfoResponse) GetBaseResp() (v *base.BaseResp) { + if !p.IsSetBaseResp() { + return GetDocumentTableInfoResponse_BaseResp_DEFAULT + } + return p.BaseResp +} + +var fieldIDToName_GetDocumentTableInfoResponse = map[int16]string{ + 1: "code", + 2: "msg", + 3: "sheet_list", + 4: "table_meta", + 5: "preview_data", + 255: "BaseResp", +} + +func (p *GetDocumentTableInfoResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *GetDocumentTableInfoResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetBaseResp bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.MAP { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.MAP { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + issetBaseResp = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetBaseResp { + fieldId = 255 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDocumentTableInfoResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetDocumentTableInfoResponse[fieldId])) +} + +func (p *GetDocumentTableInfoResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *GetDocumentTableInfoResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *GetDocumentTableInfoResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*DocTableSheet, 0, size) + values := make([]DocTableSheet, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SheetList = _field + return nil +} +func (p *GetDocumentTableInfoResponse) ReadField4(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string][]*DocTableColumn, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _val := make([]*DocTableColumn, 0, size) + values := make([]DocTableColumn, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _val = append(_val, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.TableMeta = _field + return nil +} +func (p *GetDocumentTableInfoResponse) ReadField5(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string][]map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _val := make([]map[string]string, 0, size) + for i := 0; i < size; i++ { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _elem := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key1 string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key1 = v + } + + var _val1 string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val1 = v + } + + _elem[_key1] = _val1 + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + + _val = append(_val, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.PreviewData = _field + return nil +} +func (p *GetDocumentTableInfoResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *GetDocumentTableInfoResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDocumentTableInfoResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetDocumentTableInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetDocumentTableInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetDocumentTableInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("sheet_list", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SheetList)); err != nil { + return err + } + for _, v := range p.SheetList { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *GetDocumentTableInfoResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("table_meta", thrift.MAP, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.TableMeta)); err != nil { + return err + } + for k, v := range p.TableMeta { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return err + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *GetDocumentTableInfoResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("preview_data", thrift.MAP, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.PreviewData)); err != nil { + return err + } + for k, v := range p.PreviewData { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteListBegin(thrift.MAP, len(v)); err != nil { + return err + } + for _, v := range v { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil { + return err + } + for k, v := range v { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *GetDocumentTableInfoResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *GetDocumentTableInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDocumentTableInfoResponse(%+v)", *p) + +} + +type GetTableSchemaInfoResponse struct { + Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + SheetList []*DocTableSheet `thrift:"sheet_list,3" form:"sheet_list" json:"sheet_list" query:"sheet_list"` + // The schema of the selected sheet, not selected to return the first sheet by default + TableMeta []*DocTableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta" query:"table_meta"` + // The knowledge table will return + PreviewData []map[int64]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data" query:"preview_data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"-" json:"-" query:"-"` +} + +func NewGetTableSchemaInfoResponse() *GetTableSchemaInfoResponse { + return &GetTableSchemaInfoResponse{} +} + +func (p *GetTableSchemaInfoResponse) InitDefault() { +} + +func (p *GetTableSchemaInfoResponse) GetCode() (v int32) { + return p.Code +} + +func (p *GetTableSchemaInfoResponse) GetMsg() (v string) { + return p.Msg +} + +func (p *GetTableSchemaInfoResponse) GetSheetList() (v []*DocTableSheet) { + return p.SheetList +} + +func (p *GetTableSchemaInfoResponse) GetTableMeta() (v []*DocTableColumn) { + return p.TableMeta +} + +func (p *GetTableSchemaInfoResponse) GetPreviewData() (v []map[int64]string) { + return p.PreviewData +} + +var GetTableSchemaInfoResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *GetTableSchemaInfoResponse) GetBaseResp() (v *base.BaseResp) { + if !p.IsSetBaseResp() { + return GetTableSchemaInfoResponse_BaseResp_DEFAULT + } + return p.BaseResp +} + +var fieldIDToName_GetTableSchemaInfoResponse = map[int16]string{ + 1: "code", + 2: "msg", + 3: "sheet_list", + 4: "table_meta", + 5: "preview_data", + 255: "BaseResp", +} + +func (p *GetTableSchemaInfoResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *GetTableSchemaInfoResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTableSchemaInfoResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetTableSchemaInfoResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *GetTableSchemaInfoResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *GetTableSchemaInfoResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*DocTableSheet, 0, size) + values := make([]DocTableSheet, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SheetList = _field + return nil +} +func (p *GetTableSchemaInfoResponse) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*DocTableColumn, 0, size) + values := make([]DocTableColumn, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.TableMeta = _field + return nil +} +func (p *GetTableSchemaInfoResponse) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]map[int64]string, 0, size) + for i := 0; i < size; i++ { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _elem := make(map[int64]string, size) + for i := 0; i < size; i++ { + var _key int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _elem[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.PreviewData = _field + return nil +} +func (p *GetTableSchemaInfoResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *GetTableSchemaInfoResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetTableSchemaInfoResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetTableSchemaInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetTableSchemaInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetTableSchemaInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("sheet_list", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SheetList)); err != nil { + return err + } + for _, v := range p.SheetList { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *GetTableSchemaInfoResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("table_meta", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableMeta)); err != nil { + return err + } + for _, v := range p.TableMeta { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *GetTableSchemaInfoResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("preview_data", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.MAP, len(p.PreviewData)); err != nil { + return err + } + for _, v := range p.PreviewData { + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRING, len(v)); err != nil { + return err + } + for k, v := range v { + if err := oprot.WriteI64(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *GetTableSchemaInfoResponse) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBaseResp() { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *GetTableSchemaInfoResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTableSchemaInfoResponse(%+v)", *p) + +} diff --git a/backend/api/model/flow/dataengine/dataset/dataset.go b/backend/api/model/data/knowledge/knowledge.go similarity index 87% rename from backend/api/model/flow/dataengine/dataset/dataset.go rename to backend/api/model/data/knowledge/knowledge.go index 6ff350d3..90386d8b 100644 --- a/backend/api/model/flow/dataengine/dataset/dataset.go +++ b/backend/api/model/data/knowledge/knowledge.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "database/sql" @@ -5958,3 +5958,825 @@ func (p *GetIconResponse) String() string { return fmt.Sprintf("GetIconResponse(%+v)", *p) } + +type GetModeConfigRequest struct { + // bot id + BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` + // line of business id + ConnectorID *int64 `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` + // line of business user id + ConnectorUID *string `thrift:"connector_uid,3,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewGetModeConfigRequest() *GetModeConfigRequest { + return &GetModeConfigRequest{} +} + +func (p *GetModeConfigRequest) InitDefault() { +} + +func (p *GetModeConfigRequest) GetBotID() (v int64) { + return p.BotID +} + +var GetModeConfigRequest_ConnectorID_DEFAULT int64 + +func (p *GetModeConfigRequest) GetConnectorID() (v int64) { + if !p.IsSetConnectorID() { + return GetModeConfigRequest_ConnectorID_DEFAULT + } + return *p.ConnectorID +} + +var GetModeConfigRequest_ConnectorUID_DEFAULT string + +func (p *GetModeConfigRequest) GetConnectorUID() (v string) { + if !p.IsSetConnectorUID() { + return GetModeConfigRequest_ConnectorUID_DEFAULT + } + return *p.ConnectorUID +} + +var GetModeConfigRequest_Base_DEFAULT *base.Base + +func (p *GetModeConfigRequest) GetBase() (v *base.Base) { + if !p.IsSetBase() { + return GetModeConfigRequest_Base_DEFAULT + } + return p.Base +} + +var fieldIDToName_GetModeConfigRequest = map[int16]string{ + 1: "bot_id", + 2: "connector_id", + 3: "connector_uid", + 255: "Base", +} + +func (p *GetModeConfigRequest) IsSetConnectorID() bool { + return p.ConnectorID != nil +} + +func (p *GetModeConfigRequest) IsSetConnectorUID() bool { + return p.ConnectorUID != nil +} + +func (p *GetModeConfigRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetModeConfigRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetBotID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetBotID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetBotID { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetModeConfigRequest[fieldId])) +} + +func (p *GetModeConfigRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.BotID = _field + return nil +} +func (p *GetModeConfigRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.ConnectorID = _field + return nil +} +func (p *GetModeConfigRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ConnectorUID = _field + return nil +} +func (p *GetModeConfigRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *GetModeConfigRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetModeConfigRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetModeConfigRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.BotID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetModeConfigRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetConnectorID() { + if err = oprot.WriteFieldBegin("connector_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.ConnectorID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetModeConfigRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetConnectorUID() { + if err = oprot.WriteFieldBegin("connector_uid", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ConnectorUID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *GetModeConfigRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *GetModeConfigRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetModeConfigRequest(%+v)", *p) + +} + +type GetModeConfigResponse struct { + Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + Mode string `thrift:"mode,3" form:"mode" json:"mode" query:"mode"` + BotID int64 `thrift:"bot_id,4" form:"bot_id" json:"bot_id" query:"bot_id"` + MaxTableNum int64 `thrift:"max_table_num,5" form:"max_table_num" json:"max_table_num" query:"max_table_num"` + MaxColumnNum int64 `thrift:"max_column_num,6" form:"max_column_num" json:"max_column_num" query:"max_column_num"` + MaxCapacityKb int64 `thrift:"max_capacity_kb,7" form:"max_capacity_kb" json:"max_capacity_kb" query:"max_capacity_kb"` + MaxRowNum int64 `thrift:"max_row_num,8" form:"max_row_num" json:"max_row_num" query:"max_row_num"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` +} + +func NewGetModeConfigResponse() *GetModeConfigResponse { + return &GetModeConfigResponse{} +} + +func (p *GetModeConfigResponse) InitDefault() { +} + +func (p *GetModeConfigResponse) GetCode() (v int32) { + return p.Code +} + +func (p *GetModeConfigResponse) GetMsg() (v string) { + return p.Msg +} + +func (p *GetModeConfigResponse) GetMode() (v string) { + return p.Mode +} + +func (p *GetModeConfigResponse) GetBotID() (v int64) { + return p.BotID +} + +func (p *GetModeConfigResponse) GetMaxTableNum() (v int64) { + return p.MaxTableNum +} + +func (p *GetModeConfigResponse) GetMaxColumnNum() (v int64) { + return p.MaxColumnNum +} + +func (p *GetModeConfigResponse) GetMaxCapacityKb() (v int64) { + return p.MaxCapacityKb +} + +func (p *GetModeConfigResponse) GetMaxRowNum() (v int64) { + return p.MaxRowNum +} + +var GetModeConfigResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *GetModeConfigResponse) GetBaseResp() (v *base.BaseResp) { + if !p.IsSetBaseResp() { + return GetModeConfigResponse_BaseResp_DEFAULT + } + return p.BaseResp +} + +var fieldIDToName_GetModeConfigResponse = map[int16]string{ + 1: "code", + 2: "msg", + 3: "mode", + 4: "bot_id", + 5: "max_table_num", + 6: "max_column_num", + 7: "max_capacity_kb", + 8: "max_row_num", + 255: "BaseResp", +} + +func (p *GetModeConfigResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *GetModeConfigResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetModeConfigResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *GetModeConfigResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *GetModeConfigResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Mode = _field + return nil +} +func (p *GetModeConfigResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.BotID = _field + return nil +} +func (p *GetModeConfigResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxTableNum = _field + return nil +} +func (p *GetModeConfigResponse) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxColumnNum = _field + return nil +} +func (p *GetModeConfigResponse) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxCapacityKb = _field + return nil +} +func (p *GetModeConfigResponse) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxRowNum = _field + return nil +} +func (p *GetModeConfigResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *GetModeConfigResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetModeConfigResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetModeConfigResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("mode", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Mode); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.BotID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_table_num", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxTableNum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_column_num", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxColumnNum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_capacity_kb", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxCapacityKb); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_row_num", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxRowNum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} +func (p *GetModeConfigResponse) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBaseResp() { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *GetModeConfigResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetModeConfigResponse(%+v)", *p) + +} diff --git a/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go b/backend/api/model/data/knowledge/knowledge_svc.go similarity index 92% rename from backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go rename to backend/api/model/data/knowledge/knowledge_svc.go index 7b23e295..b8a8555b 100644 --- a/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go +++ b/backend/api/model/data/knowledge/knowledge_svc.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "context" @@ -21,6 +21,8 @@ type DatasetService interface { DeleteDataset(ctx context.Context, req *DeleteDatasetRequest) (r *DeleteDatasetResponse, err error) UpdateDataset(ctx context.Context, req *UpdateDatasetRequest) (r *UpdateDatasetResponse, err error) + + GetModeConfig(ctx context.Context, req *GetModeConfigRequest) (r *GetModeConfigResponse, err error) // Document related CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error) @@ -45,6 +47,8 @@ type DatasetService interface { GetTableSchema(ctx context.Context, req *GetTableSchemaRequest) (r *GetTableSchemaResponse, err error) ValidateTableSchema(ctx context.Context, req *ValidateTableSchemaRequest) (r *ValidateTableSchemaResponse, err error) + + GetDocumentTableInfo(ctx context.Context, req *GetDocumentTableInfoRequest) (r *GetDocumentTableInfoResponse, err error) // Slice related DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error) @@ -141,6 +145,15 @@ func (p *DatasetServiceClient) UpdateDataset(ctx context.Context, req *UpdateDat } return _result.GetSuccess(), nil } +func (p *DatasetServiceClient) GetModeConfig(ctx context.Context, req *GetModeConfigRequest) (r *GetModeConfigResponse, err error) { + var _args DatasetServiceGetModeConfigArgs + _args.Req = req + var _result DatasetServiceGetModeConfigResult + if err = p.Client_().Call(ctx, "GetModeConfig", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} func (p *DatasetServiceClient) CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error) { var _args DatasetServiceCreateDocumentArgs _args.Req = req @@ -249,6 +262,15 @@ func (p *DatasetServiceClient) ValidateTableSchema(ctx context.Context, req *Val } return _result.GetSuccess(), nil } +func (p *DatasetServiceClient) GetDocumentTableInfo(ctx context.Context, req *GetDocumentTableInfoRequest) (r *GetDocumentTableInfoResponse, err error) { + var _args DatasetServiceGetDocumentTableInfoArgs + _args.Req = req + var _result DatasetServiceGetDocumentTableInfoResult + if err = p.Client_().Call(ctx, "GetDocumentTableInfo", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} func (p *DatasetServiceClient) DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error) { var _args DatasetServiceDeleteSliceArgs _args.Req = req @@ -339,6 +361,7 @@ func NewDatasetServiceProcessor(handler DatasetService) *DatasetServiceProcessor self.AddToProcessorMap("ListDataset", &datasetServiceProcessorListDataset{handler: handler}) self.AddToProcessorMap("DeleteDataset", &datasetServiceProcessorDeleteDataset{handler: handler}) self.AddToProcessorMap("UpdateDataset", &datasetServiceProcessorUpdateDataset{handler: handler}) + self.AddToProcessorMap("GetModeConfig", &datasetServiceProcessorGetModeConfig{handler: handler}) self.AddToProcessorMap("CreateDocument", &datasetServiceProcessorCreateDocument{handler: handler}) self.AddToProcessorMap("ListDocument", &datasetServiceProcessorListDocument{handler: handler}) self.AddToProcessorMap("DeleteDocument", &datasetServiceProcessorDeleteDocument{handler: handler}) @@ -351,6 +374,7 @@ func NewDatasetServiceProcessor(handler DatasetService) *DatasetServiceProcessor self.AddToProcessorMap("ExtractPhotoCaption", &datasetServiceProcessorExtractPhotoCaption{handler: handler}) self.AddToProcessorMap("GetTableSchema", &datasetServiceProcessorGetTableSchema{handler: handler}) self.AddToProcessorMap("ValidateTableSchema", &datasetServiceProcessorValidateTableSchema{handler: handler}) + self.AddToProcessorMap("GetDocumentTableInfo", &datasetServiceProcessorGetDocumentTableInfo{handler: handler}) self.AddToProcessorMap("DeleteSlice", &datasetServiceProcessorDeleteSlice{handler: handler}) self.AddToProcessorMap("CreateSlice", &datasetServiceProcessorCreateSlice{handler: handler}) self.AddToProcessorMap("UpdateSlice", &datasetServiceProcessorUpdateSlice{handler: handler}) @@ -666,6 +690,54 @@ func (p *datasetServiceProcessorUpdateDataset) Process(ctx context.Context, seqI return true, err } +type datasetServiceProcessorGetModeConfig struct { + handler DatasetService +} + +func (p *datasetServiceProcessorGetModeConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DatasetServiceGetModeConfigArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := DatasetServiceGetModeConfigResult{} + var retval *GetModeConfigResponse + if retval, err2 = p.handler.GetModeConfig(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetModeConfig: "+err2.Error()) + oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetModeConfig", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type datasetServiceProcessorCreateDocument struct { handler DatasetService } @@ -1242,6 +1314,54 @@ func (p *datasetServiceProcessorValidateTableSchema) Process(ctx context.Context return true, err } +type datasetServiceProcessorGetDocumentTableInfo struct { + handler DatasetService +} + +func (p *datasetServiceProcessorGetDocumentTableInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := DatasetServiceGetDocumentTableInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := DatasetServiceGetDocumentTableInfoResult{} + var retval *GetDocumentTableInfoResponse + if retval, err2 = p.handler.GetDocumentTableInfo(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDocumentTableInfo: "+err2.Error()) + oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type datasetServiceProcessorDeleteSlice struct { handler DatasetService } @@ -3330,6 +3450,298 @@ func (p *DatasetServiceUpdateDatasetResult) String() string { } +type DatasetServiceGetModeConfigArgs struct { + Req *GetModeConfigRequest `thrift:"req,1"` +} + +func NewDatasetServiceGetModeConfigArgs() *DatasetServiceGetModeConfigArgs { + return &DatasetServiceGetModeConfigArgs{} +} + +func (p *DatasetServiceGetModeConfigArgs) InitDefault() { +} + +var DatasetServiceGetModeConfigArgs_Req_DEFAULT *GetModeConfigRequest + +func (p *DatasetServiceGetModeConfigArgs) GetReq() (v *GetModeConfigRequest) { + if !p.IsSetReq() { + return DatasetServiceGetModeConfigArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_DatasetServiceGetModeConfigArgs = map[int16]string{ + 1: "req", +} + +func (p *DatasetServiceGetModeConfigArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *DatasetServiceGetModeConfigArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetModeConfigArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetModeConfigRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *DatasetServiceGetModeConfigArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetModeConfig_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DatasetServiceGetModeConfigArgs(%+v)", *p) + +} + +type DatasetServiceGetModeConfigResult struct { + Success *GetModeConfigResponse `thrift:"success,0,optional"` +} + +func NewDatasetServiceGetModeConfigResult() *DatasetServiceGetModeConfigResult { + return &DatasetServiceGetModeConfigResult{} +} + +func (p *DatasetServiceGetModeConfigResult) InitDefault() { +} + +var DatasetServiceGetModeConfigResult_Success_DEFAULT *GetModeConfigResponse + +func (p *DatasetServiceGetModeConfigResult) GetSuccess() (v *GetModeConfigResponse) { + if !p.IsSetSuccess() { + return DatasetServiceGetModeConfigResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_DatasetServiceGetModeConfigResult = map[int16]string{ + 0: "success", +} + +func (p *DatasetServiceGetModeConfigResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *DatasetServiceGetModeConfigResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetModeConfigResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetModeConfigResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *DatasetServiceGetModeConfigResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetModeConfig_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *DatasetServiceGetModeConfigResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DatasetServiceGetModeConfigResult(%+v)", *p) + +} + type DatasetServiceCreateDocumentArgs struct { Req *CreateDocumentRequest `thrift:"req,1"` } @@ -6834,6 +7246,298 @@ func (p *DatasetServiceValidateTableSchemaResult) String() string { } +type DatasetServiceGetDocumentTableInfoArgs struct { + Req *GetDocumentTableInfoRequest `thrift:"req,1"` +} + +func NewDatasetServiceGetDocumentTableInfoArgs() *DatasetServiceGetDocumentTableInfoArgs { + return &DatasetServiceGetDocumentTableInfoArgs{} +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) InitDefault() { +} + +var DatasetServiceGetDocumentTableInfoArgs_Req_DEFAULT *GetDocumentTableInfoRequest + +func (p *DatasetServiceGetDocumentTableInfoArgs) GetReq() (v *GetDocumentTableInfoRequest) { + if !p.IsSetReq() { + return DatasetServiceGetDocumentTableInfoArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_DatasetServiceGetDocumentTableInfoArgs = map[int16]string{ + 1: "req", +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetDocumentTableInfoArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDocumentTableInfoRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDocumentTableInfo_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DatasetServiceGetDocumentTableInfoArgs(%+v)", *p) + +} + +type DatasetServiceGetDocumentTableInfoResult struct { + Success *GetDocumentTableInfoResponse `thrift:"success,0,optional"` +} + +func NewDatasetServiceGetDocumentTableInfoResult() *DatasetServiceGetDocumentTableInfoResult { + return &DatasetServiceGetDocumentTableInfoResult{} +} + +func (p *DatasetServiceGetDocumentTableInfoResult) InitDefault() { +} + +var DatasetServiceGetDocumentTableInfoResult_Success_DEFAULT *GetDocumentTableInfoResponse + +func (p *DatasetServiceGetDocumentTableInfoResult) GetSuccess() (v *GetDocumentTableInfoResponse) { + if !p.IsSetSuccess() { + return DatasetServiceGetDocumentTableInfoResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_DatasetServiceGetDocumentTableInfoResult = map[int16]string{ + 0: "success", +} + +func (p *DatasetServiceGetDocumentTableInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *DatasetServiceGetDocumentTableInfoResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetDocumentTableInfoResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDocumentTableInfoResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *DatasetServiceGetDocumentTableInfoResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDocumentTableInfo_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *DatasetServiceGetDocumentTableInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DatasetServiceGetDocumentTableInfoResult(%+v)", *p) + +} + type DatasetServiceDeleteSliceArgs struct { Req *DeleteSliceRequest `thrift:"req,1"` } diff --git a/backend/api/model/flow/dataengine/dataset/review.go b/backend/api/model/data/knowledge/review.go similarity index 99% rename from backend/api/model/flow/dataengine/dataset/review.go rename to backend/api/model/data/knowledge/review.go index 59b2c849..aabad7b8 100644 --- a/backend/api/model/flow/dataengine/dataset/review.go +++ b/backend/api/model/data/knowledge/review.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "fmt" diff --git a/backend/api/model/flow/dataengine/dataset/slice.go b/backend/api/model/data/knowledge/slice.go similarity index 99% rename from backend/api/model/flow/dataengine/dataset/slice.go rename to backend/api/model/data/knowledge/slice.go index 2329b933..82544984 100644 --- a/backend/api/model/flow/dataengine/dataset/slice.go +++ b/backend/api/model/data/knowledge/slice.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package dataset +package knowledge import ( "database/sql" diff --git a/backend/api/model/kvmemory/kvmemory.go b/backend/api/model/data/variable/kvmemory/kvmemory.go similarity index 99% rename from backend/api/model/kvmemory/kvmemory.go rename to backend/api/model/data/variable/kvmemory/kvmemory.go index a43ad0ce..fc60c366 100644 --- a/backend/api/model/kvmemory/kvmemory.go +++ b/backend/api/model/data/variable/kvmemory/kvmemory.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type KVItem struct { diff --git a/backend/api/model/project_memory/project_memory.go b/backend/api/model/data/variable/project_memory/project_memory.go similarity index 100% rename from backend/api/model/project_memory/project_memory.go rename to backend/api/model/data/variable/project_memory/project_memory.go diff --git a/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go b/backend/api/model/data/variable/variable_svc.go similarity index 78% rename from backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go rename to backend/api/model/data/variable/variable_svc.go index 55f91bbb..2c741d6e 100644 --- a/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go +++ b/backend/api/model/data/variable/variable_svc.go @@ -1,15 +1,13 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package memory +package variable import ( "context" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type MemoryService interface { @@ -27,10 +25,6 @@ type MemoryService interface { GetSysVariableConf(ctx context.Context, req *kvmemory.GetSysVariableConfRequest) (r *kvmemory.GetSysVariableConfResponse, err error) SetKvMemory(ctx context.Context, req *kvmemory.SetKvMemoryReq) (r *kvmemory.SetKvMemoryResp, err error) - // --- - GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (r *table.GetModeConfigResponse, err error) - - GetDocumentTableInfo(ctx context.Context, req *document.GetDocumentTableInfoRequest) (r *document.GetDocumentTableInfoResponse, err error) } type MemoryServiceClient struct { @@ -122,24 +116,6 @@ func (p *MemoryServiceClient) SetKvMemory(ctx context.Context, req *kvmemory.Set } return _result.GetSuccess(), nil } -func (p *MemoryServiceClient) GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (r *table.GetModeConfigResponse, err error) { - var _args MemoryServiceGetModeConfigArgs - _args.Req = req - var _result MemoryServiceGetModeConfigResult - if err = p.Client_().Call(ctx, "GetModeConfig", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *MemoryServiceClient) GetDocumentTableInfo(ctx context.Context, req *document.GetDocumentTableInfoRequest) (r *document.GetDocumentTableInfoResponse, err error) { - var _args MemoryServiceGetDocumentTableInfoArgs - _args.Req = req - var _result MemoryServiceGetDocumentTableInfoResult - if err = p.Client_().Call(ctx, "GetDocumentTableInfo", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} type MemoryServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction @@ -168,8 +144,6 @@ func NewMemoryServiceProcessor(handler MemoryService) *MemoryServiceProcessor { self.AddToProcessorMap("GetPlayGroundMemory", &memoryServiceProcessorGetPlayGroundMemory{handler: handler}) self.AddToProcessorMap("GetSysVariableConf", &memoryServiceProcessorGetSysVariableConf{handler: handler}) self.AddToProcessorMap("SetKvMemory", &memoryServiceProcessorSetKvMemory{handler: handler}) - self.AddToProcessorMap("GetModeConfig", &memoryServiceProcessorGetModeConfig{handler: handler}) - self.AddToProcessorMap("GetDocumentTableInfo", &memoryServiceProcessorGetDocumentTableInfo{handler: handler}) return self } func (p *MemoryServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -526,102 +500,6 @@ func (p *memoryServiceProcessorSetKvMemory) Process(ctx context.Context, seqId i return true, err } -type memoryServiceProcessorGetModeConfig struct { - handler MemoryService -} - -func (p *memoryServiceProcessorGetModeConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := MemoryServiceGetModeConfigArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := MemoryServiceGetModeConfigResult{} - var retval *table.GetModeConfigResponse - if retval, err2 = p.handler.GetModeConfig(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetModeConfig: "+err2.Error()) - oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetModeConfig", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type memoryServiceProcessorGetDocumentTableInfo struct { - handler MemoryService -} - -func (p *memoryServiceProcessorGetDocumentTableInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := MemoryServiceGetDocumentTableInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := MemoryServiceGetDocumentTableInfoResult{} - var retval *document.GetDocumentTableInfoResponse - if retval, err2 = p.handler.GetDocumentTableInfo(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDocumentTableInfo: "+err2.Error()) - oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - type MemoryServiceGetProjectVariableListArgs struct { Req *project_memory.GetProjectVariableListReq `thrift:"req,1"` } @@ -2665,587 +2543,3 @@ func (p *MemoryServiceSetKvMemoryResult) String() string { return fmt.Sprintf("MemoryServiceSetKvMemoryResult(%+v)", *p) } - -type MemoryServiceGetModeConfigArgs struct { - Req *table.GetModeConfigRequest `thrift:"req,1"` -} - -func NewMemoryServiceGetModeConfigArgs() *MemoryServiceGetModeConfigArgs { - return &MemoryServiceGetModeConfigArgs{} -} - -func (p *MemoryServiceGetModeConfigArgs) InitDefault() { -} - -var MemoryServiceGetModeConfigArgs_Req_DEFAULT *table.GetModeConfigRequest - -func (p *MemoryServiceGetModeConfigArgs) GetReq() (v *table.GetModeConfigRequest) { - if !p.IsSetReq() { - return MemoryServiceGetModeConfigArgs_Req_DEFAULT - } - return p.Req -} - -var fieldIDToName_MemoryServiceGetModeConfigArgs = map[int16]string{ - 1: "req", -} - -func (p *MemoryServiceGetModeConfigArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *MemoryServiceGetModeConfigArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetModeConfigArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigArgs) ReadField1(iprot thrift.TProtocol) error { - _field := table.NewGetModeConfigRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *MemoryServiceGetModeConfigArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetModeConfig_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("MemoryServiceGetModeConfigArgs(%+v)", *p) - -} - -type MemoryServiceGetModeConfigResult struct { - Success *table.GetModeConfigResponse `thrift:"success,0,optional"` -} - -func NewMemoryServiceGetModeConfigResult() *MemoryServiceGetModeConfigResult { - return &MemoryServiceGetModeConfigResult{} -} - -func (p *MemoryServiceGetModeConfigResult) InitDefault() { -} - -var MemoryServiceGetModeConfigResult_Success_DEFAULT *table.GetModeConfigResponse - -func (p *MemoryServiceGetModeConfigResult) GetSuccess() (v *table.GetModeConfigResponse) { - if !p.IsSetSuccess() { - return MemoryServiceGetModeConfigResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_MemoryServiceGetModeConfigResult = map[int16]string{ - 0: "success", -} - -func (p *MemoryServiceGetModeConfigResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *MemoryServiceGetModeConfigResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetModeConfigResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigResult) ReadField0(iprot thrift.TProtocol) error { - _field := table.NewGetModeConfigResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *MemoryServiceGetModeConfigResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetModeConfig_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *MemoryServiceGetModeConfigResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("MemoryServiceGetModeConfigResult(%+v)", *p) - -} - -type MemoryServiceGetDocumentTableInfoArgs struct { - Req *document.GetDocumentTableInfoRequest `thrift:"req,1"` -} - -func NewMemoryServiceGetDocumentTableInfoArgs() *MemoryServiceGetDocumentTableInfoArgs { - return &MemoryServiceGetDocumentTableInfoArgs{} -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) InitDefault() { -} - -var MemoryServiceGetDocumentTableInfoArgs_Req_DEFAULT *document.GetDocumentTableInfoRequest - -func (p *MemoryServiceGetDocumentTableInfoArgs) GetReq() (v *document.GetDocumentTableInfoRequest) { - if !p.IsSetReq() { - return MemoryServiceGetDocumentTableInfoArgs_Req_DEFAULT - } - return p.Req -} - -var fieldIDToName_MemoryServiceGetDocumentTableInfoArgs = map[int16]string{ - 1: "req", -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetDocumentTableInfoArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) ReadField1(iprot thrift.TProtocol) error { - _field := document.NewGetDocumentTableInfoRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDocumentTableInfo_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("MemoryServiceGetDocumentTableInfoArgs(%+v)", *p) - -} - -type MemoryServiceGetDocumentTableInfoResult struct { - Success *document.GetDocumentTableInfoResponse `thrift:"success,0,optional"` -} - -func NewMemoryServiceGetDocumentTableInfoResult() *MemoryServiceGetDocumentTableInfoResult { - return &MemoryServiceGetDocumentTableInfoResult{} -} - -func (p *MemoryServiceGetDocumentTableInfoResult) InitDefault() { -} - -var MemoryServiceGetDocumentTableInfoResult_Success_DEFAULT *document.GetDocumentTableInfoResponse - -func (p *MemoryServiceGetDocumentTableInfoResult) GetSuccess() (v *document.GetDocumentTableInfoResponse) { - if !p.IsSetSuccess() { - return MemoryServiceGetDocumentTableInfoResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_MemoryServiceGetDocumentTableInfoResult = map[int16]string{ - 0: "success", -} - -func (p *MemoryServiceGetDocumentTableInfoResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *MemoryServiceGetDocumentTableInfoResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetDocumentTableInfoResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoResult) ReadField0(iprot thrift.TProtocol) error { - _field := document.NewGetDocumentTableInfoResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *MemoryServiceGetDocumentTableInfoResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDocumentTableInfo_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *MemoryServiceGetDocumentTableInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("MemoryServiceGetDocumentTableInfoResult(%+v)", *p) - -} diff --git a/backend/api/model/developer/connector/connector.go b/backend/api/model/developer/connector/connector.go deleted file mode 100644 index 3587e590..00000000 --- a/backend/api/model/developer/connector/connector.go +++ /dev/null @@ -1,4068 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package connector - -import ( - "context" - "database/sql" - "database/sql/driver" - "fmt" - "github.com/apache/thrift/lib/go/thrift" -) - -type ConfigStatus int64 - -const ( - // Configured - ConfigStatus_Configured ConfigStatus = 1 - // Not configured - ConfigStatus_NotConfigured ConfigStatus = 2 - // Token changes - ConfigStatus_Disconnected ConfigStatus = 3 - // Configuring, authorizing - ConfigStatus_Configuring ConfigStatus = 4 - // Need to reconfigure https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG - ConfigStatus_NeedReconfiguring ConfigStatus = 5 -) - -func (p ConfigStatus) String() string { - switch p { - case ConfigStatus_Configured: - return "Configured" - case ConfigStatus_NotConfigured: - return "NotConfigured" - case ConfigStatus_Disconnected: - return "Disconnected" - case ConfigStatus_Configuring: - return "Configuring" - case ConfigStatus_NeedReconfiguring: - return "NeedReconfiguring" - } - return "" -} - -func ConfigStatusFromString(s string) (ConfigStatus, error) { - switch s { - case "Configured": - return ConfigStatus_Configured, nil - case "NotConfigured": - return ConfigStatus_NotConfigured, nil - case "Disconnected": - return ConfigStatus_Disconnected, nil - case "Configuring": - return ConfigStatus_Configuring, nil - case "NeedReconfiguring": - return ConfigStatus_NeedReconfiguring, nil - } - return ConfigStatus(0), fmt.Errorf("not a valid ConfigStatus string") -} - -func ConfigStatusPtr(v ConfigStatus) *ConfigStatus { return &v } -func (p *ConfigStatus) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = ConfigStatus(result.Int64) - return -} - -func (p *ConfigStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type BindType int64 - -const ( - // No binding required - BindType_NoBindRequired BindType = 1 - // Auth binding - BindType_AuthBind BindType = 2 - // Kv binding = - BindType_KvBind BindType = 3 - // Kv and Auth authorization - BindType_KvAuthBind BindType = 4 - // API channel binding - BindType_ApiBind BindType = 5 - BindType_WebSDKBind BindType = 6 - BindType_StoreBind BindType = 7 - // One button each for authorization and configuration - BindType_AuthAndConfig BindType = 8 -) - -func (p BindType) String() string { - switch p { - case BindType_NoBindRequired: - return "NoBindRequired" - case BindType_AuthBind: - return "AuthBind" - case BindType_KvBind: - return "KvBind" - case BindType_KvAuthBind: - return "KvAuthBind" - case BindType_ApiBind: - return "ApiBind" - case BindType_WebSDKBind: - return "WebSDKBind" - case BindType_StoreBind: - return "StoreBind" - case BindType_AuthAndConfig: - return "AuthAndConfig" - } - return "" -} - -func BindTypeFromString(s string) (BindType, error) { - switch s { - case "NoBindRequired": - return BindType_NoBindRequired, nil - case "AuthBind": - return BindType_AuthBind, nil - case "KvBind": - return BindType_KvBind, nil - case "KvAuthBind": - return BindType_KvAuthBind, nil - case "ApiBind": - return BindType_ApiBind, nil - case "WebSDKBind": - return BindType_WebSDKBind, nil - case "StoreBind": - return BindType_StoreBind, nil - case "AuthAndConfig": - return BindType_AuthAndConfig, nil - } - return BindType(0), fmt.Errorf("not a valid BindType string") -} - -func BindTypePtr(v BindType) *BindType { return &v } -func (p *BindType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = BindType(result.Int64) - return -} - -func (p *BindType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type AllowPublishStatus int64 - -const ( - AllowPublishStatus_Allowed AllowPublishStatus = 0 - AllowPublishStatus_Forbid AllowPublishStatus = 1 -) - -func (p AllowPublishStatus) String() string { - switch p { - case AllowPublishStatus_Allowed: - return "Allowed" - case AllowPublishStatus_Forbid: - return "Forbid" - } - return "" -} - -func AllowPublishStatusFromString(s string) (AllowPublishStatus, error) { - switch s { - case "Allowed": - return AllowPublishStatus_Allowed, nil - case "Forbid": - return AllowPublishStatus_Forbid, nil - } - return AllowPublishStatus(0), fmt.Errorf("not a valid AllowPublishStatus string") -} - -func AllowPublishStatusPtr(v AllowPublishStatus) *AllowPublishStatus { return &v } -func (p *AllowPublishStatus) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = AllowPublishStatus(result.Int64) - return -} - -func (p *AllowPublishStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type BotConnectorStatus int64 - -const ( - // Normal - BotConnectorStatus_Normal BotConnectorStatus = 0 - // Under review. - BotConnectorStatus_InReview BotConnectorStatus = 1 - // offline - BotConnectorStatus_Offline BotConnectorStatus = 2 -) - -func (p BotConnectorStatus) String() string { - switch p { - case BotConnectorStatus_Normal: - return "Normal" - case BotConnectorStatus_InReview: - return "InReview" - case BotConnectorStatus_Offline: - return "Offline" - } - return "" -} - -func BotConnectorStatusFromString(s string) (BotConnectorStatus, error) { - switch s { - case "Normal": - return BotConnectorStatus_Normal, nil - case "InReview": - return BotConnectorStatus_InReview, nil - case "Offline": - return BotConnectorStatus_Offline, nil - } - return BotConnectorStatus(0), fmt.Errorf("not a valid BotConnectorStatus string") -} - -func BotConnectorStatusPtr(v BotConnectorStatus) *BotConnectorStatus { return &v } -func (p *BotConnectorStatus) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = BotConnectorStatus(result.Int64) - return -} - -func (p *BotConnectorStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type UserAuthStatus int64 - -const ( - // Authorized - UserAuthStatus_Authorized UserAuthStatus = 1 - // unauthorized - UserAuthStatus_UnAuthorized UserAuthStatus = 2 - // Authorizing - UserAuthStatus_Authorizing UserAuthStatus = 3 -) - -func (p UserAuthStatus) String() string { - switch p { - case UserAuthStatus_Authorized: - return "Authorized" - case UserAuthStatus_UnAuthorized: - return "UnAuthorized" - case UserAuthStatus_Authorizing: - return "Authorizing" - } - return "" -} - -func UserAuthStatusFromString(s string) (UserAuthStatus, error) { - switch s { - case "Authorized": - return UserAuthStatus_Authorized, nil - case "UnAuthorized": - return UserAuthStatus_UnAuthorized, nil - case "Authorizing": - return UserAuthStatus_Authorizing, nil - } - return UserAuthStatus(0), fmt.Errorf("not a valid UserAuthStatus string") -} - -func UserAuthStatusPtr(v UserAuthStatus) *UserAuthStatus { return &v } -func (p *UserAuthStatus) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = UserAuthStatus(result.Int64) - return -} - -func (p *UserAuthStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type AuthLoginInfo struct { - AppID string `thrift:"app_id,1" form:"app_id" json:"app_id" query:"app_id"` - ResponseType string `thrift:"response_type,2" form:"response_type" json:"response_type" query:"response_type"` - AuthorizeURL string `thrift:"authorize_url,3" form:"authorize_url" json:"authorize_url" query:"authorize_url"` - Scope string `thrift:"scope,4" form:"scope" json:"scope" query:"scope"` - ClientID string `thrift:"client_id,5" form:"client_id" json:"client_id" query:"client_id"` - Duration string `thrift:"duration,6" form:"duration" json:"duration" query:"duration"` - Aid string `thrift:"aid,7" form:"aid" json:"aid" query:"aid"` - ClientKey string `thrift:"client_key,8" form:"client_key" json:"client_key" query:"client_key"` -} - -func NewAuthLoginInfo() *AuthLoginInfo { - return &AuthLoginInfo{} -} - -func (p *AuthLoginInfo) InitDefault() { -} - -func (p *AuthLoginInfo) GetAppID() (v string) { - return p.AppID -} - -func (p *AuthLoginInfo) GetResponseType() (v string) { - return p.ResponseType -} - -func (p *AuthLoginInfo) GetAuthorizeURL() (v string) { - return p.AuthorizeURL -} - -func (p *AuthLoginInfo) GetScope() (v string) { - return p.Scope -} - -func (p *AuthLoginInfo) GetClientID() (v string) { - return p.ClientID -} - -func (p *AuthLoginInfo) GetDuration() (v string) { - return p.Duration -} - -func (p *AuthLoginInfo) GetAid() (v string) { - return p.Aid -} - -func (p *AuthLoginInfo) GetClientKey() (v string) { - return p.ClientKey -} - -var fieldIDToName_AuthLoginInfo = map[int16]string{ - 1: "app_id", - 2: "response_type", - 3: "authorize_url", - 4: "scope", - 5: "client_id", - 6: "duration", - 7: "aid", - 8: "client_key", -} - -func (p *AuthLoginInfo) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRING { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.STRING { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRING { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.STRING { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AuthLoginInfo[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *AuthLoginInfo) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.AppID = _field - return nil -} -func (p *AuthLoginInfo) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ResponseType = _field - return nil -} -func (p *AuthLoginInfo) ReadField3(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.AuthorizeURL = _field - return nil -} -func (p *AuthLoginInfo) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Scope = _field - return nil -} -func (p *AuthLoginInfo) ReadField5(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ClientID = _field - return nil -} -func (p *AuthLoginInfo) ReadField6(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Duration = _field - return nil -} -func (p *AuthLoginInfo) ReadField7(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Aid = _field - return nil -} -func (p *AuthLoginInfo) ReadField8(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ClientKey = _field - return nil -} - -func (p *AuthLoginInfo) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AuthLoginInfo"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *AuthLoginInfo) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("app_id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.AppID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("response_type", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ResponseType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("authorize_url", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.AuthorizeURL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("scope", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Scope); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("client_id", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ClientID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("duration", thrift.STRING, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Duration); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("aid", thrift.STRING, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Aid); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} -func (p *AuthLoginInfo) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("client_key", thrift.STRING, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ClientKey); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) -} - -func (p *AuthLoginInfo) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuthLoginInfo(%+v)", *p) - -} - -type PublishConnectorListRequest struct { - SpaceID string `thrift:"space_id,1,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` - BotID string `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - CommitVersion *string `thrift:"commit_version,3,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` -} - -func NewPublishConnectorListRequest() *PublishConnectorListRequest { - return &PublishConnectorListRequest{} -} - -func (p *PublishConnectorListRequest) InitDefault() { -} - -func (p *PublishConnectorListRequest) GetSpaceID() (v string) { - return p.SpaceID -} - -func (p *PublishConnectorListRequest) GetBotID() (v string) { - return p.BotID -} - -var PublishConnectorListRequest_CommitVersion_DEFAULT string - -func (p *PublishConnectorListRequest) GetCommitVersion() (v string) { - if !p.IsSetCommitVersion() { - return PublishConnectorListRequest_CommitVersion_DEFAULT - } - return *p.CommitVersion -} - -var fieldIDToName_PublishConnectorListRequest = map[int16]string{ - 1: "space_id", - 2: "bot_id", - 3: "commit_version", -} - -func (p *PublishConnectorListRequest) IsSetCommitVersion() bool { - return p.CommitVersion != nil -} - -func (p *PublishConnectorListRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetSpaceID bool = false - var issetBotID bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetSpaceID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetBotID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetSpaceID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetBotID { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PublishConnectorListRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PublishConnectorListRequest[fieldId])) -} - -func (p *PublishConnectorListRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.SpaceID = _field - return nil -} -func (p *PublishConnectorListRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.BotID = _field - return nil -} -func (p *PublishConnectorListRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.CommitVersion = _field - return nil -} - -func (p *PublishConnectorListRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishConnectorListRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PublishConnectorListRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("space_id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.SpaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *PublishConnectorListRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bot_id", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.BotID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *PublishConnectorListRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCommitVersion() { - if err = oprot.WriteFieldBegin("commit_version", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.CommitVersion); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *PublishConnectorListRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PublishConnectorListRequest(%+v)", *p) - -} - -type PublishConnectorInfo struct { - // Publishing Platform connector_id - ID string `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - // publishing platform name - Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - // publishing platform icon - Icon string `thrift:"icon,3,required" form:"icon,required" json:"icon,required" query:"icon,required"` - // Publish Platform Description - Desc string `thrift:"desc,4,required" form:"desc,required" json:"desc,required" query:"desc,required"` - // share link - ShareLink string `thrift:"share_link,5,required" form:"share_link,required" json:"share_link,required" query:"share_link,required"` - // Configuration Status 1: Bound 2: Unbound - ConfigStatus ConfigStatus `thrift:"config_status,6,required" form:"config_status,required" json:"config_status,required" query:"config_status,required"` - // Last Post - LastPublishTime int64 `thrift:"last_publish_time,7,required" form:"last_publish_time,required" json:"last_publish_time,required" query:"last_publish_time,required"` - // Binding type 1: No binding required 2: Auth 3: kv value - BindType BindType `thrift:"bind_type,8,required" form:"bind_type,required" json:"bind_type,required" query:"bind_type,required"` - // Binding information key field name value is value - BindInfo map[string]string `thrift:"bind_info,9,required" form:"bind_info,required" json:"bind_info,required" query:"bind_info,required"` - // Bind id information for unbinding and use - BindID *string `thrift:"bind_id,10,optional" form:"bind_id" json:"bind_id,omitempty" query:"bind_id"` - // user authorization login information - AuthLoginInfo *AuthLoginInfo `thrift:"auth_login_info,11,optional" form:"auth_login_info" json:"auth_login_info,omitempty" query:"auth_login_info"` - // Is it the last release? - IsLastPublished *bool `thrift:"is_last_published,12,optional" form:"is_last_published" json:"is_last_published,omitempty" query:"is_last_published"` - // bot channel status - ConnectorStatus *BotConnectorStatus `thrift:"connector_status,13,optional" form:"connector_status" json:"connector_status,omitempty" query:"connector_status"` - // Privacy Policy - PrivacyPolicy *string `thrift:"privacy_policy,14,optional" form:"privacy_policy" json:"privacy_policy,omitempty" query:"privacy_policy"` - // User Agreement - UserAgreement *string `thrift:"user_agreement,15,optional" form:"user_agreement" json:"user_agreement,omitempty" query:"user_agreement"` - // Is the channel allowed to publish? - AllowPunish *AllowPublishStatus `thrift:"allow_punish,16,optional" form:"allow_punish" json:"allow_punish,omitempty" query:"allow_punish"` - // Reason for not allowing posting - NotAllowReason *string `thrift:"not_allow_reason,17,optional" form:"not_allow_reason" json:"not_allow_reason,omitempty" query:"not_allow_reason"` - // Configuration status toast - ConfigStatusToast *string `thrift:"config_status_toast,18,optional" form:"config_status_toast" json:"config_status_toast,omitempty" query:"config_status_toast"` - // Brand ID - BrandID *int64 `thrift:"brand_id,19,optional" form:"brand_id" json:"brand_id,omitempty" query:"brand_id"` - // Support commercialization - SupportMonetization *bool `thrift:"support_monetization,20,optional" form:"support_monetization" json:"support_monetization,omitempty" query:"support_monetization"` - // 1: Authorized, 2: Unauthorized. Currently, this field is only available bind_type == 8 https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG - AuthStatus *UserAuthStatus `thrift:"auth_status,21,optional" form:"auth_status" json:"auth_status,omitempty" query:"auth_status"` - // URL of the complete info button - ToCompleteInfoURL *string `thrift:"to_complete_info_url,22,optional" form:"to_complete_info_url" json:"to_complete_info_url,omitempty" query:"to_complete_info_url"` -} - -func NewPublishConnectorInfo() *PublishConnectorInfo { - return &PublishConnectorInfo{} -} - -func (p *PublishConnectorInfo) InitDefault() { -} - -func (p *PublishConnectorInfo) GetID() (v string) { - return p.ID -} - -func (p *PublishConnectorInfo) GetName() (v string) { - return p.Name -} - -func (p *PublishConnectorInfo) GetIcon() (v string) { - return p.Icon -} - -func (p *PublishConnectorInfo) GetDesc() (v string) { - return p.Desc -} - -func (p *PublishConnectorInfo) GetShareLink() (v string) { - return p.ShareLink -} - -func (p *PublishConnectorInfo) GetConfigStatus() (v ConfigStatus) { - return p.ConfigStatus -} - -func (p *PublishConnectorInfo) GetLastPublishTime() (v int64) { - return p.LastPublishTime -} - -func (p *PublishConnectorInfo) GetBindType() (v BindType) { - return p.BindType -} - -func (p *PublishConnectorInfo) GetBindInfo() (v map[string]string) { - return p.BindInfo -} - -var PublishConnectorInfo_BindID_DEFAULT string - -func (p *PublishConnectorInfo) GetBindID() (v string) { - if !p.IsSetBindID() { - return PublishConnectorInfo_BindID_DEFAULT - } - return *p.BindID -} - -var PublishConnectorInfo_AuthLoginInfo_DEFAULT *AuthLoginInfo - -func (p *PublishConnectorInfo) GetAuthLoginInfo() (v *AuthLoginInfo) { - if !p.IsSetAuthLoginInfo() { - return PublishConnectorInfo_AuthLoginInfo_DEFAULT - } - return p.AuthLoginInfo -} - -var PublishConnectorInfo_IsLastPublished_DEFAULT bool - -func (p *PublishConnectorInfo) GetIsLastPublished() (v bool) { - if !p.IsSetIsLastPublished() { - return PublishConnectorInfo_IsLastPublished_DEFAULT - } - return *p.IsLastPublished -} - -var PublishConnectorInfo_ConnectorStatus_DEFAULT BotConnectorStatus - -func (p *PublishConnectorInfo) GetConnectorStatus() (v BotConnectorStatus) { - if !p.IsSetConnectorStatus() { - return PublishConnectorInfo_ConnectorStatus_DEFAULT - } - return *p.ConnectorStatus -} - -var PublishConnectorInfo_PrivacyPolicy_DEFAULT string - -func (p *PublishConnectorInfo) GetPrivacyPolicy() (v string) { - if !p.IsSetPrivacyPolicy() { - return PublishConnectorInfo_PrivacyPolicy_DEFAULT - } - return *p.PrivacyPolicy -} - -var PublishConnectorInfo_UserAgreement_DEFAULT string - -func (p *PublishConnectorInfo) GetUserAgreement() (v string) { - if !p.IsSetUserAgreement() { - return PublishConnectorInfo_UserAgreement_DEFAULT - } - return *p.UserAgreement -} - -var PublishConnectorInfo_AllowPunish_DEFAULT AllowPublishStatus - -func (p *PublishConnectorInfo) GetAllowPunish() (v AllowPublishStatus) { - if !p.IsSetAllowPunish() { - return PublishConnectorInfo_AllowPunish_DEFAULT - } - return *p.AllowPunish -} - -var PublishConnectorInfo_NotAllowReason_DEFAULT string - -func (p *PublishConnectorInfo) GetNotAllowReason() (v string) { - if !p.IsSetNotAllowReason() { - return PublishConnectorInfo_NotAllowReason_DEFAULT - } - return *p.NotAllowReason -} - -var PublishConnectorInfo_ConfigStatusToast_DEFAULT string - -func (p *PublishConnectorInfo) GetConfigStatusToast() (v string) { - if !p.IsSetConfigStatusToast() { - return PublishConnectorInfo_ConfigStatusToast_DEFAULT - } - return *p.ConfigStatusToast -} - -var PublishConnectorInfo_BrandID_DEFAULT int64 - -func (p *PublishConnectorInfo) GetBrandID() (v int64) { - if !p.IsSetBrandID() { - return PublishConnectorInfo_BrandID_DEFAULT - } - return *p.BrandID -} - -var PublishConnectorInfo_SupportMonetization_DEFAULT bool - -func (p *PublishConnectorInfo) GetSupportMonetization() (v bool) { - if !p.IsSetSupportMonetization() { - return PublishConnectorInfo_SupportMonetization_DEFAULT - } - return *p.SupportMonetization -} - -var PublishConnectorInfo_AuthStatus_DEFAULT UserAuthStatus - -func (p *PublishConnectorInfo) GetAuthStatus() (v UserAuthStatus) { - if !p.IsSetAuthStatus() { - return PublishConnectorInfo_AuthStatus_DEFAULT - } - return *p.AuthStatus -} - -var PublishConnectorInfo_ToCompleteInfoURL_DEFAULT string - -func (p *PublishConnectorInfo) GetToCompleteInfoURL() (v string) { - if !p.IsSetToCompleteInfoURL() { - return PublishConnectorInfo_ToCompleteInfoURL_DEFAULT - } - return *p.ToCompleteInfoURL -} - -var fieldIDToName_PublishConnectorInfo = map[int16]string{ - 1: "id", - 2: "name", - 3: "icon", - 4: "desc", - 5: "share_link", - 6: "config_status", - 7: "last_publish_time", - 8: "bind_type", - 9: "bind_info", - 10: "bind_id", - 11: "auth_login_info", - 12: "is_last_published", - 13: "connector_status", - 14: "privacy_policy", - 15: "user_agreement", - 16: "allow_punish", - 17: "not_allow_reason", - 18: "config_status_toast", - 19: "brand_id", - 20: "support_monetization", - 21: "auth_status", - 22: "to_complete_info_url", -} - -func (p *PublishConnectorInfo) IsSetBindID() bool { - return p.BindID != nil -} - -func (p *PublishConnectorInfo) IsSetAuthLoginInfo() bool { - return p.AuthLoginInfo != nil -} - -func (p *PublishConnectorInfo) IsSetIsLastPublished() bool { - return p.IsLastPublished != nil -} - -func (p *PublishConnectorInfo) IsSetConnectorStatus() bool { - return p.ConnectorStatus != nil -} - -func (p *PublishConnectorInfo) IsSetPrivacyPolicy() bool { - return p.PrivacyPolicy != nil -} - -func (p *PublishConnectorInfo) IsSetUserAgreement() bool { - return p.UserAgreement != nil -} - -func (p *PublishConnectorInfo) IsSetAllowPunish() bool { - return p.AllowPunish != nil -} - -func (p *PublishConnectorInfo) IsSetNotAllowReason() bool { - return p.NotAllowReason != nil -} - -func (p *PublishConnectorInfo) IsSetConfigStatusToast() bool { - return p.ConfigStatusToast != nil -} - -func (p *PublishConnectorInfo) IsSetBrandID() bool { - return p.BrandID != nil -} - -func (p *PublishConnectorInfo) IsSetSupportMonetization() bool { - return p.SupportMonetization != nil -} - -func (p *PublishConnectorInfo) IsSetAuthStatus() bool { - return p.AuthStatus != nil -} - -func (p *PublishConnectorInfo) IsSetToCompleteInfoURL() bool { - return p.ToCompleteInfoURL != nil -} - -func (p *PublishConnectorInfo) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetID bool = false - var issetName bool = false - var issetIcon bool = false - var issetDesc bool = false - var issetShareLink bool = false - var issetConfigStatus bool = false - var issetLastPublishTime bool = false - var issetBindType bool = false - var issetBindInfo bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetName = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetIcon = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetDesc = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRING { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetShareLink = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I32 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetConfigStatus = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - issetLastPublishTime = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.I32 { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - issetBindType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 9: - if fieldTypeId == thrift.MAP { - if err = p.ReadField9(iprot); err != nil { - goto ReadFieldError - } - issetBindInfo = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.STRING { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 12: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField12(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 13: - if fieldTypeId == thrift.I32 { - if err = p.ReadField13(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 14: - if fieldTypeId == thrift.STRING { - if err = p.ReadField14(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 15: - if fieldTypeId == thrift.STRING { - if err = p.ReadField15(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 16: - if fieldTypeId == thrift.I32 { - if err = p.ReadField16(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 17: - if fieldTypeId == thrift.STRING { - if err = p.ReadField17(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 18: - if fieldTypeId == thrift.STRING { - if err = p.ReadField18(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 19: - if fieldTypeId == thrift.I64 { - if err = p.ReadField19(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 20: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField20(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 21: - if fieldTypeId == thrift.I32 { - if err = p.ReadField21(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 22: - if fieldTypeId == thrift.STRING { - if err = p.ReadField22(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetName { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetIcon { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetDesc { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetShareLink { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetConfigStatus { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetLastPublishTime { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetBindType { - fieldId = 8 - goto RequiredFieldNotSetError - } - - if !issetBindInfo { - fieldId = 9 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PublishConnectorInfo[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PublishConnectorInfo[fieldId])) -} - -func (p *PublishConnectorInfo) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ID = _field - return nil -} -func (p *PublishConnectorInfo) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Name = _field - return nil -} -func (p *PublishConnectorInfo) ReadField3(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Icon = _field - return nil -} -func (p *PublishConnectorInfo) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Desc = _field - return nil -} -func (p *PublishConnectorInfo) ReadField5(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ShareLink = _field - return nil -} -func (p *PublishConnectorInfo) ReadField6(iprot thrift.TProtocol) error { - - var _field ConfigStatus - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = ConfigStatus(v) - } - p.ConfigStatus = _field - return nil -} -func (p *PublishConnectorInfo) ReadField7(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.LastPublishTime = _field - return nil -} -func (p *PublishConnectorInfo) ReadField8(iprot thrift.TProtocol) error { - - var _field BindType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = BindType(v) - } - p.BindType = _field - return nil -} -func (p *PublishConnectorInfo) ReadField9(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.BindInfo = _field - return nil -} -func (p *PublishConnectorInfo) ReadField10(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.BindID = _field - return nil -} -func (p *PublishConnectorInfo) ReadField11(iprot thrift.TProtocol) error { - _field := NewAuthLoginInfo() - if err := _field.Read(iprot); err != nil { - return err - } - p.AuthLoginInfo = _field - return nil -} -func (p *PublishConnectorInfo) ReadField12(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.IsLastPublished = _field - return nil -} -func (p *PublishConnectorInfo) ReadField13(iprot thrift.TProtocol) error { - - var _field *BotConnectorStatus - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := BotConnectorStatus(v) - _field = &tmp - } - p.ConnectorStatus = _field - return nil -} -func (p *PublishConnectorInfo) ReadField14(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.PrivacyPolicy = _field - return nil -} -func (p *PublishConnectorInfo) ReadField15(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.UserAgreement = _field - return nil -} -func (p *PublishConnectorInfo) ReadField16(iprot thrift.TProtocol) error { - - var _field *AllowPublishStatus - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := AllowPublishStatus(v) - _field = &tmp - } - p.AllowPunish = _field - return nil -} -func (p *PublishConnectorInfo) ReadField17(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.NotAllowReason = _field - return nil -} -func (p *PublishConnectorInfo) ReadField18(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ConfigStatusToast = _field - return nil -} -func (p *PublishConnectorInfo) ReadField19(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.BrandID = _field - return nil -} -func (p *PublishConnectorInfo) ReadField20(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.SupportMonetization = _field - return nil -} -func (p *PublishConnectorInfo) ReadField21(iprot thrift.TProtocol) error { - - var _field *UserAuthStatus - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := UserAuthStatus(v) - _field = &tmp - } - p.AuthStatus = _field - return nil -} -func (p *PublishConnectorInfo) ReadField22(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ToCompleteInfoURL = _field - return nil -} - -func (p *PublishConnectorInfo) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishConnectorInfo"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - if err = p.writeField9(oprot); err != nil { - fieldId = 9 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField12(oprot); err != nil { - fieldId = 12 - goto WriteFieldError - } - if err = p.writeField13(oprot); err != nil { - fieldId = 13 - goto WriteFieldError - } - if err = p.writeField14(oprot); err != nil { - fieldId = 14 - goto WriteFieldError - } - if err = p.writeField15(oprot); err != nil { - fieldId = 15 - goto WriteFieldError - } - if err = p.writeField16(oprot); err != nil { - fieldId = 16 - goto WriteFieldError - } - if err = p.writeField17(oprot); err != nil { - fieldId = 17 - goto WriteFieldError - } - if err = p.writeField18(oprot); err != nil { - fieldId = 18 - goto WriteFieldError - } - if err = p.writeField19(oprot); err != nil { - fieldId = 19 - goto WriteFieldError - } - if err = p.writeField20(oprot); err != nil { - fieldId = 20 - goto WriteFieldError - } - if err = p.writeField21(oprot); err != nil { - fieldId = 21 - goto WriteFieldError - } - if err = p.writeField22(oprot); err != nil { - fieldId = 22 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PublishConnectorInfo) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("icon", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Icon); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("desc", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Desc); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("share_link", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ShareLink); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("config_status", thrift.I32, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.ConfigStatus)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("last_publish_time", thrift.I64, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.LastPublishTime); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bind_type", thrift.I32, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.BindType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField9(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bind_info", thrift.MAP, 9); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.BindInfo)); err != nil { - return err - } - for k, v := range p.BindInfo { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetBindID() { - if err = oprot.WriteFieldBegin("bind_id", thrift.STRING, 10); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.BindID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField11(oprot thrift.TProtocol) (err error) { - if p.IsSetAuthLoginInfo() { - if err = oprot.WriteFieldBegin("auth_login_info", thrift.STRUCT, 11); err != nil { - goto WriteFieldBeginError - } - if err := p.AuthLoginInfo.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField12(oprot thrift.TProtocol) (err error) { - if p.IsSetIsLastPublished() { - if err = oprot.WriteFieldBegin("is_last_published", thrift.BOOL, 12); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.IsLastPublished); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField13(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorStatus() { - if err = oprot.WriteFieldBegin("connector_status", thrift.I32, 13); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.ConnectorStatus)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField14(oprot thrift.TProtocol) (err error) { - if p.IsSetPrivacyPolicy() { - if err = oprot.WriteFieldBegin("privacy_policy", thrift.STRING, 14); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.PrivacyPolicy); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField15(oprot thrift.TProtocol) (err error) { - if p.IsSetUserAgreement() { - if err = oprot.WriteFieldBegin("user_agreement", thrift.STRING, 15); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.UserAgreement); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField16(oprot thrift.TProtocol) (err error) { - if p.IsSetAllowPunish() { - if err = oprot.WriteFieldBegin("allow_punish", thrift.I32, 16); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.AllowPunish)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 16 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField17(oprot thrift.TProtocol) (err error) { - if p.IsSetNotAllowReason() { - if err = oprot.WriteFieldBegin("not_allow_reason", thrift.STRING, 17); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.NotAllowReason); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField18(oprot thrift.TProtocol) (err error) { - if p.IsSetConfigStatusToast() { - if err = oprot.WriteFieldBegin("config_status_toast", thrift.STRING, 18); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ConfigStatusToast); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField19(oprot thrift.TProtocol) (err error) { - if p.IsSetBrandID() { - if err = oprot.WriteFieldBegin("brand_id", thrift.I64, 19); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.BrandID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField20(oprot thrift.TProtocol) (err error) { - if p.IsSetSupportMonetization() { - if err = oprot.WriteFieldBegin("support_monetization", thrift.BOOL, 20); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.SupportMonetization); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField21(oprot thrift.TProtocol) (err error) { - if p.IsSetAuthStatus() { - if err = oprot.WriteFieldBegin("auth_status", thrift.I32, 21); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.AuthStatus)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 21 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err) -} -func (p *PublishConnectorInfo) writeField22(oprot thrift.TProtocol) (err error) { - if p.IsSetToCompleteInfoURL() { - if err = oprot.WriteFieldBegin("to_complete_info_url", thrift.STRING, 22); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ToCompleteInfoURL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 22 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 22 end error: ", p), err) -} - -func (p *PublishConnectorInfo) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PublishConnectorInfo(%+v)", *p) - -} - -type SubmitBotMarketOption struct { - // Is it possible to publicly orchestrate? - CanOpenSource *bool `thrift:"can_open_source,1,optional" form:"can_open_source" json:"can_open_source,omitempty" query:"can_open_source"` -} - -func NewSubmitBotMarketOption() *SubmitBotMarketOption { - return &SubmitBotMarketOption{} -} - -func (p *SubmitBotMarketOption) InitDefault() { -} - -var SubmitBotMarketOption_CanOpenSource_DEFAULT bool - -func (p *SubmitBotMarketOption) GetCanOpenSource() (v bool) { - if !p.IsSetCanOpenSource() { - return SubmitBotMarketOption_CanOpenSource_DEFAULT - } - return *p.CanOpenSource -} - -var fieldIDToName_SubmitBotMarketOption = map[int16]string{ - 1: "can_open_source", -} - -func (p *SubmitBotMarketOption) IsSetCanOpenSource() bool { - return p.CanOpenSource != nil -} - -func (p *SubmitBotMarketOption) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SubmitBotMarketOption[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SubmitBotMarketOption) ReadField1(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.CanOpenSource = _field - return nil -} - -func (p *SubmitBotMarketOption) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SubmitBotMarketOption"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SubmitBotMarketOption) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCanOpenSource() { - if err = oprot.WriteFieldBegin("can_open_source", thrift.BOOL, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.CanOpenSource); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *SubmitBotMarketOption) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SubmitBotMarketOption(%+v)", *p) - -} - -type SubmitBotMarketConfig struct { - // Whether to publish to the market - NeedSubmit *bool `thrift:"need_submit,1,optional" form:"need_submit" json:"need_submit,omitempty" query:"need_submit"` - // Is it open source? - OpenSource *bool `thrift:"open_source,2,optional" form:"open_source" json:"open_source,omitempty" query:"open_source"` - // classification - CategoryID *string `thrift:"category_id,3,optional" form:"category_id" json:"category_id,omitempty" query:"category_id"` -} - -func NewSubmitBotMarketConfig() *SubmitBotMarketConfig { - return &SubmitBotMarketConfig{} -} - -func (p *SubmitBotMarketConfig) InitDefault() { -} - -var SubmitBotMarketConfig_NeedSubmit_DEFAULT bool - -func (p *SubmitBotMarketConfig) GetNeedSubmit() (v bool) { - if !p.IsSetNeedSubmit() { - return SubmitBotMarketConfig_NeedSubmit_DEFAULT - } - return *p.NeedSubmit -} - -var SubmitBotMarketConfig_OpenSource_DEFAULT bool - -func (p *SubmitBotMarketConfig) GetOpenSource() (v bool) { - if !p.IsSetOpenSource() { - return SubmitBotMarketConfig_OpenSource_DEFAULT - } - return *p.OpenSource -} - -var SubmitBotMarketConfig_CategoryID_DEFAULT string - -func (p *SubmitBotMarketConfig) GetCategoryID() (v string) { - if !p.IsSetCategoryID() { - return SubmitBotMarketConfig_CategoryID_DEFAULT - } - return *p.CategoryID -} - -var fieldIDToName_SubmitBotMarketConfig = map[int16]string{ - 1: "need_submit", - 2: "open_source", - 3: "category_id", -} - -func (p *SubmitBotMarketConfig) IsSetNeedSubmit() bool { - return p.NeedSubmit != nil -} - -func (p *SubmitBotMarketConfig) IsSetOpenSource() bool { - return p.OpenSource != nil -} - -func (p *SubmitBotMarketConfig) IsSetCategoryID() bool { - return p.CategoryID != nil -} - -func (p *SubmitBotMarketConfig) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SubmitBotMarketConfig[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SubmitBotMarketConfig) ReadField1(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.NeedSubmit = _field - return nil -} -func (p *SubmitBotMarketConfig) ReadField2(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.OpenSource = _field - return nil -} -func (p *SubmitBotMarketConfig) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.CategoryID = _field - return nil -} - -func (p *SubmitBotMarketConfig) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SubmitBotMarketConfig"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SubmitBotMarketConfig) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetNeedSubmit() { - if err = oprot.WriteFieldBegin("need_submit", thrift.BOOL, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.NeedSubmit); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *SubmitBotMarketConfig) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetOpenSource() { - if err = oprot.WriteFieldBegin("open_source", thrift.BOOL, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.OpenSource); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *SubmitBotMarketConfig) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCategoryID() { - if err = oprot.WriteFieldBegin("category_id", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.CategoryID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *SubmitBotMarketConfig) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SubmitBotMarketConfig(%+v)", *p) - -} - -type ConnectorBrandInfo struct { - ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - Icon string `thrift:"icon,3,required" form:"icon,required" json:"icon,required" query:"icon,required"` -} - -func NewConnectorBrandInfo() *ConnectorBrandInfo { - return &ConnectorBrandInfo{} -} - -func (p *ConnectorBrandInfo) InitDefault() { -} - -func (p *ConnectorBrandInfo) GetID() (v int64) { - return p.ID -} - -func (p *ConnectorBrandInfo) GetName() (v string) { - return p.Name -} - -func (p *ConnectorBrandInfo) GetIcon() (v string) { - return p.Icon -} - -var fieldIDToName_ConnectorBrandInfo = map[int16]string{ - 1: "id", - 2: "name", - 3: "icon", -} - -func (p *ConnectorBrandInfo) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetID bool = false - var issetName bool = false - var issetIcon bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetName = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetIcon = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetName { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetIcon { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ConnectorBrandInfo[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ConnectorBrandInfo[fieldId])) -} - -func (p *ConnectorBrandInfo) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ID = _field - return nil -} -func (p *ConnectorBrandInfo) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Name = _field - return nil -} -func (p *ConnectorBrandInfo) ReadField3(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Icon = _field - return nil -} - -func (p *ConnectorBrandInfo) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("ConnectorBrandInfo"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *ConnectorBrandInfo) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *ConnectorBrandInfo) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *ConnectorBrandInfo) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("icon", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Icon); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *ConnectorBrandInfo) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ConnectorBrandInfo(%+v)", *p) - -} - -type PublishTips struct { - // cost-bearing reminder - CostTips *string `thrift:"cost_tips,1,optional" form:"cost_tips" json:"cost_tips,omitempty" query:"cost_tips"` -} - -func NewPublishTips() *PublishTips { - return &PublishTips{} -} - -func (p *PublishTips) InitDefault() { -} - -var PublishTips_CostTips_DEFAULT string - -func (p *PublishTips) GetCostTips() (v string) { - if !p.IsSetCostTips() { - return PublishTips_CostTips_DEFAULT - } - return *p.CostTips -} - -var fieldIDToName_PublishTips = map[int16]string{ - 1: "cost_tips", -} - -func (p *PublishTips) IsSetCostTips() bool { - return p.CostTips != nil -} - -func (p *PublishTips) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PublishTips[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PublishTips) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.CostTips = _field - return nil -} - -func (p *PublishTips) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishTips"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PublishTips) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCostTips() { - if err = oprot.WriteFieldBegin("cost_tips", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.CostTips); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *PublishTips) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PublishTips(%+v)", *p) - -} - -type PublishConnectorListResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - PublishConnectorList []*PublishConnectorInfo `thrift:"publish_connector_list,3" form:"publish_connector_list" json:"publish_connector_list" query:"publish_connector_list"` - SubmitBotMarketOption *SubmitBotMarketOption `thrift:"submit_bot_market_option,4,optional" form:"submit_bot_market_option" json:"submit_bot_market_option,omitempty" query:"submit_bot_market_option"` - // The configuration of the last submitted market - LastSubmitConfig *SubmitBotMarketConfig `thrift:"last_submit_config,5,optional" form:"last_submit_config" json:"last_submit_config,omitempty" query:"last_submit_config"` - // Channel brand information - ConnectorBrandInfoMap map[int64]*ConnectorBrandInfo `thrift:"connector_brand_info_map,6" form:"connector_brand_info_map" json:"connector_brand_info_map" query:"connector_brand_info_map"` - // post alert - PublishTips *PublishTips `thrift:"publish_tips,7,optional" form:"publish_tips" json:"publish_tips,omitempty" query:"publish_tips"` -} - -func NewPublishConnectorListResponse() *PublishConnectorListResponse { - return &PublishConnectorListResponse{} -} - -func (p *PublishConnectorListResponse) InitDefault() { -} - -func (p *PublishConnectorListResponse) GetCode() (v int64) { - return p.Code -} - -func (p *PublishConnectorListResponse) GetMsg() (v string) { - return p.Msg -} - -func (p *PublishConnectorListResponse) GetPublishConnectorList() (v []*PublishConnectorInfo) { - return p.PublishConnectorList -} - -var PublishConnectorListResponse_SubmitBotMarketOption_DEFAULT *SubmitBotMarketOption - -func (p *PublishConnectorListResponse) GetSubmitBotMarketOption() (v *SubmitBotMarketOption) { - if !p.IsSetSubmitBotMarketOption() { - return PublishConnectorListResponse_SubmitBotMarketOption_DEFAULT - } - return p.SubmitBotMarketOption -} - -var PublishConnectorListResponse_LastSubmitConfig_DEFAULT *SubmitBotMarketConfig - -func (p *PublishConnectorListResponse) GetLastSubmitConfig() (v *SubmitBotMarketConfig) { - if !p.IsSetLastSubmitConfig() { - return PublishConnectorListResponse_LastSubmitConfig_DEFAULT - } - return p.LastSubmitConfig -} - -func (p *PublishConnectorListResponse) GetConnectorBrandInfoMap() (v map[int64]*ConnectorBrandInfo) { - return p.ConnectorBrandInfoMap -} - -var PublishConnectorListResponse_PublishTips_DEFAULT *PublishTips - -func (p *PublishConnectorListResponse) GetPublishTips() (v *PublishTips) { - if !p.IsSetPublishTips() { - return PublishConnectorListResponse_PublishTips_DEFAULT - } - return p.PublishTips -} - -var fieldIDToName_PublishConnectorListResponse = map[int16]string{ - 1: "code", - 2: "msg", - 3: "publish_connector_list", - 4: "submit_bot_market_option", - 5: "last_submit_config", - 6: "connector_brand_info_map", - 7: "publish_tips", -} - -func (p *PublishConnectorListResponse) IsSetSubmitBotMarketOption() bool { - return p.SubmitBotMarketOption != nil -} - -func (p *PublishConnectorListResponse) IsSetLastSubmitConfig() bool { - return p.LastSubmitConfig != nil -} - -func (p *PublishConnectorListResponse) IsSetPublishTips() bool { - return p.PublishTips != nil -} - -func (p *PublishConnectorListResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.MAP { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PublishConnectorListResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PublishConnectorListResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*PublishConnectorInfo, 0, size) - values := make([]PublishConnectorInfo, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.PublishConnectorList = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField4(iprot thrift.TProtocol) error { - _field := NewSubmitBotMarketOption() - if err := _field.Read(iprot); err != nil { - return err - } - p.SubmitBotMarketOption = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField5(iprot thrift.TProtocol) error { - _field := NewSubmitBotMarketConfig() - if err := _field.Read(iprot); err != nil { - return err - } - p.LastSubmitConfig = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField6(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[int64]*ConnectorBrandInfo, size) - values := make([]ConnectorBrandInfo, size) - for i := 0; i < size; i++ { - var _key int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _key = v - } - - _val := &values[i] - _val.InitDefault() - if err := _val.Read(iprot); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.ConnectorBrandInfoMap = _field - return nil -} -func (p *PublishConnectorListResponse) ReadField7(iprot thrift.TProtocol) error { - _field := NewPublishTips() - if err := _field.Read(iprot); err != nil { - return err - } - p.PublishTips = _field - return nil -} - -func (p *PublishConnectorListResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishConnectorListResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PublishConnectorListResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("publish_connector_list", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PublishConnectorList)); err != nil { - return err - } - for _, v := range p.PublishConnectorList { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetSubmitBotMarketOption() { - if err = oprot.WriteFieldBegin("submit_bot_market_option", thrift.STRUCT, 4); err != nil { - goto WriteFieldBeginError - } - if err := p.SubmitBotMarketOption.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetLastSubmitConfig() { - if err = oprot.WriteFieldBegin("last_submit_config", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.LastSubmitConfig.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("connector_brand_info_map", thrift.MAP, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.ConnectorBrandInfoMap)); err != nil { - return err - } - for k, v := range p.ConnectorBrandInfoMap { - if err := oprot.WriteI64(k); err != nil { - return err - } - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} -func (p *PublishConnectorListResponse) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetPublishTips() { - if err = oprot.WriteFieldBegin("publish_tips", thrift.STRUCT, 7); err != nil { - goto WriteFieldBeginError - } - if err := p.PublishTips.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *PublishConnectorListResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PublishConnectorListResponse(%+v)", *p) - -} - -type ConnectorService interface { - PublishConnectorList(ctx context.Context, request *PublishConnectorListRequest) (r *PublishConnectorListResponse, err error) -} - -type ConnectorServiceClient struct { - c thrift.TClient -} - -func NewConnectorServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ConnectorServiceClient { - return &ConnectorServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewConnectorServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ConnectorServiceClient { - return &ConnectorServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewConnectorServiceClient(c thrift.TClient) *ConnectorServiceClient { - return &ConnectorServiceClient{ - c: c, - } -} - -func (p *ConnectorServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *ConnectorServiceClient) PublishConnectorList(ctx context.Context, request *PublishConnectorListRequest) (r *PublishConnectorListResponse, err error) { - var _args ConnectorServicePublishConnectorListArgs - _args.Request = request - var _result ConnectorServicePublishConnectorListResult - if err = p.Client_().Call(ctx, "PublishConnectorList", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -type ConnectorServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler ConnectorService -} - -func (p *ConnectorServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *ConnectorServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *ConnectorServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewConnectorServiceProcessor(handler ConnectorService) *ConnectorServiceProcessor { - self := &ConnectorServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("PublishConnectorList", &connectorServiceProcessorPublishConnectorList{handler: handler}) - return self -} -func (p *ConnectorServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x -} - -type connectorServiceProcessorPublishConnectorList struct { - handler ConnectorService -} - -func (p *connectorServiceProcessorPublishConnectorList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ConnectorServicePublishConnectorListArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("PublishConnectorList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := ConnectorServicePublishConnectorListResult{} - var retval *PublishConnectorListResponse - if retval, err2 = p.handler.PublishConnectorList(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PublishConnectorList: "+err2.Error()) - oprot.WriteMessageBegin("PublishConnectorList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("PublishConnectorList", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type ConnectorServicePublishConnectorListArgs struct { - Request *PublishConnectorListRequest `thrift:"request,1"` -} - -func NewConnectorServicePublishConnectorListArgs() *ConnectorServicePublishConnectorListArgs { - return &ConnectorServicePublishConnectorListArgs{} -} - -func (p *ConnectorServicePublishConnectorListArgs) InitDefault() { -} - -var ConnectorServicePublishConnectorListArgs_Request_DEFAULT *PublishConnectorListRequest - -func (p *ConnectorServicePublishConnectorListArgs) GetRequest() (v *PublishConnectorListRequest) { - if !p.IsSetRequest() { - return ConnectorServicePublishConnectorListArgs_Request_DEFAULT - } - return p.Request -} - -var fieldIDToName_ConnectorServicePublishConnectorListArgs = map[int16]string{ - 1: "request", -} - -func (p *ConnectorServicePublishConnectorListArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *ConnectorServicePublishConnectorListArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ConnectorServicePublishConnectorListArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewPublishConnectorListRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil -} - -func (p *ConnectorServicePublishConnectorListArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishConnectorList_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ConnectorServicePublishConnectorListArgs(%+v)", *p) - -} - -type ConnectorServicePublishConnectorListResult struct { - Success *PublishConnectorListResponse `thrift:"success,0,optional"` -} - -func NewConnectorServicePublishConnectorListResult() *ConnectorServicePublishConnectorListResult { - return &ConnectorServicePublishConnectorListResult{} -} - -func (p *ConnectorServicePublishConnectorListResult) InitDefault() { -} - -var ConnectorServicePublishConnectorListResult_Success_DEFAULT *PublishConnectorListResponse - -func (p *ConnectorServicePublishConnectorListResult) GetSuccess() (v *PublishConnectorListResponse) { - if !p.IsSetSuccess() { - return ConnectorServicePublishConnectorListResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_ConnectorServicePublishConnectorListResult = map[int16]string{ - 0: "success", -} - -func (p *ConnectorServicePublishConnectorListResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ConnectorServicePublishConnectorListResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ConnectorServicePublishConnectorListResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewPublishConnectorListResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *ConnectorServicePublishConnectorListResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PublishConnectorList_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *ConnectorServicePublishConnectorListResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ConnectorServicePublishConnectorListResult(%+v)", *p) - -} diff --git a/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go b/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go deleted file mode 100644 index adcae866..00000000 --- a/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go +++ /dev/null @@ -1,2553 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package coze - -import ( - "fmt" - "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra" - "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/testcase" -) - -// ========== TestCase =========== // -type SaveCaseDataReq struct { - // business information - BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,2,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` - // Case basic data - CaseBase *testcase.CaseDataBase `thrift:"caseBase,3,optional" form:"caseBase" json:"caseBase,omitempty" query:"caseBase"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewSaveCaseDataReq() *SaveCaseDataReq { - return &SaveCaseDataReq{} -} - -func (p *SaveCaseDataReq) InitDefault() { -} - -var SaveCaseDataReq_BizCtx_DEFAULT *infra.BizCtx - -func (p *SaveCaseDataReq) GetBizCtx() (v *infra.BizCtx) { - if !p.IsSetBizCtx() { - return SaveCaseDataReq_BizCtx_DEFAULT - } - return p.BizCtx -} - -var SaveCaseDataReq_BizComponentSubject_DEFAULT *infra.ComponentSubject - -func (p *SaveCaseDataReq) GetBizComponentSubject() (v *infra.ComponentSubject) { - if !p.IsSetBizComponentSubject() { - return SaveCaseDataReq_BizComponentSubject_DEFAULT - } - return p.BizComponentSubject -} - -var SaveCaseDataReq_CaseBase_DEFAULT *testcase.CaseDataBase - -func (p *SaveCaseDataReq) GetCaseBase() (v *testcase.CaseDataBase) { - if !p.IsSetCaseBase() { - return SaveCaseDataReq_CaseBase_DEFAULT - } - return p.CaseBase -} - -var SaveCaseDataReq_Base_DEFAULT *base.Base - -func (p *SaveCaseDataReq) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return SaveCaseDataReq_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_SaveCaseDataReq = map[int16]string{ - 1: "bizCtx", - 2: "bizComponentSubject", - 3: "caseBase", - 255: "Base", -} - -func (p *SaveCaseDataReq) IsSetBizCtx() bool { - return p.BizCtx != nil -} - -func (p *SaveCaseDataReq) IsSetBizComponentSubject() bool { - return p.BizComponentSubject != nil -} - -func (p *SaveCaseDataReq) IsSetCaseBase() bool { - return p.CaseBase != nil -} - -func (p *SaveCaseDataReq) IsSetBase() bool { - return p.Base != nil -} - -func (p *SaveCaseDataReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SaveCaseDataReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SaveCaseDataReq) ReadField1(iprot thrift.TProtocol) error { - _field := infra.NewBizCtx() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizCtx = _field - return nil -} -func (p *SaveCaseDataReq) ReadField2(iprot thrift.TProtocol) error { - _field := infra.NewComponentSubject() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizComponentSubject = _field - return nil -} -func (p *SaveCaseDataReq) ReadField3(iprot thrift.TProtocol) error { - _field := testcase.NewCaseDataBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.CaseBase = _field - return nil -} -func (p *SaveCaseDataReq) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *SaveCaseDataReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SaveCaseDataReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SaveCaseDataReq) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBizCtx() { - if err = oprot.WriteFieldBegin("bizCtx", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.BizCtx.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *SaveCaseDataReq) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetBizComponentSubject() { - if err = oprot.WriteFieldBegin("bizComponentSubject", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.BizComponentSubject.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *SaveCaseDataReq) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseBase() { - if err = oprot.WriteFieldBegin("caseBase", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.CaseBase.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *SaveCaseDataReq) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *SaveCaseDataReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SaveCaseDataReq(%+v)", *p) - -} - -type SaveCaseDataResp struct { - CaseDetail *testcase.CaseDataDetail `thrift:"caseDetail,1,optional" form:"caseDetail" json:"caseDetail,omitempty" query:"caseDetail"` - Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` - Msg *string `thrift:"msg,254,optional" form:"msg" json:"msg,omitempty" query:"msg"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` -} - -func NewSaveCaseDataResp() *SaveCaseDataResp { - return &SaveCaseDataResp{} -} - -func (p *SaveCaseDataResp) InitDefault() { -} - -var SaveCaseDataResp_CaseDetail_DEFAULT *testcase.CaseDataDetail - -func (p *SaveCaseDataResp) GetCaseDetail() (v *testcase.CaseDataDetail) { - if !p.IsSetCaseDetail() { - return SaveCaseDataResp_CaseDetail_DEFAULT - } - return p.CaseDetail -} - -var SaveCaseDataResp_Code_DEFAULT int32 - -func (p *SaveCaseDataResp) GetCode() (v int32) { - if !p.IsSetCode() { - return SaveCaseDataResp_Code_DEFAULT - } - return *p.Code -} - -var SaveCaseDataResp_Msg_DEFAULT string - -func (p *SaveCaseDataResp) GetMsg() (v string) { - if !p.IsSetMsg() { - return SaveCaseDataResp_Msg_DEFAULT - } - return *p.Msg -} - -var SaveCaseDataResp_BaseResp_DEFAULT *base.BaseResp - -func (p *SaveCaseDataResp) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return SaveCaseDataResp_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_SaveCaseDataResp = map[int16]string{ - 1: "caseDetail", - 253: "code", - 254: "msg", - 255: "BaseResp", -} - -func (p *SaveCaseDataResp) IsSetCaseDetail() bool { - return p.CaseDetail != nil -} - -func (p *SaveCaseDataResp) IsSetCode() bool { - return p.Code != nil -} - -func (p *SaveCaseDataResp) IsSetMsg() bool { - return p.Msg != nil -} - -func (p *SaveCaseDataResp) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *SaveCaseDataResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 253: - if fieldTypeId == thrift.I32 { - if err = p.ReadField253(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 254: - if fieldTypeId == thrift.STRING { - if err = p.ReadField254(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SaveCaseDataResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SaveCaseDataResp) ReadField1(iprot thrift.TProtocol) error { - _field := testcase.NewCaseDataDetail() - if err := _field.Read(iprot); err != nil { - return err - } - p.CaseDetail = _field - return nil -} -func (p *SaveCaseDataResp) ReadField253(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *SaveCaseDataResp) ReadField254(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Msg = _field - return nil -} -func (p *SaveCaseDataResp) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *SaveCaseDataResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SaveCaseDataResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField253(oprot); err != nil { - fieldId = 253 - goto WriteFieldError - } - if err = p.writeField254(oprot); err != nil { - fieldId = 254 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SaveCaseDataResp) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseDetail() { - if err = oprot.WriteFieldBegin("caseDetail", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.CaseDetail.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *SaveCaseDataResp) writeField253(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.I32, 253); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) -} -func (p *SaveCaseDataResp) writeField254(oprot thrift.TProtocol) (err error) { - if p.IsSetMsg() { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) -} -func (p *SaveCaseDataResp) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *SaveCaseDataResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SaveCaseDataResp(%+v)", *p) - -} - -type DeleteCaseDataReq struct { - // business information - BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - // A single maximum of 20 - CaseIDs []int64 `thrift:"caseIDs,2,optional" form:"caseIDs" json:"caseIDs,omitempty" query:"caseIDs"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewDeleteCaseDataReq() *DeleteCaseDataReq { - return &DeleteCaseDataReq{} -} - -func (p *DeleteCaseDataReq) InitDefault() { -} - -var DeleteCaseDataReq_BizCtx_DEFAULT *infra.BizCtx - -func (p *DeleteCaseDataReq) GetBizCtx() (v *infra.BizCtx) { - if !p.IsSetBizCtx() { - return DeleteCaseDataReq_BizCtx_DEFAULT - } - return p.BizCtx -} - -var DeleteCaseDataReq_CaseIDs_DEFAULT []int64 - -func (p *DeleteCaseDataReq) GetCaseIDs() (v []int64) { - if !p.IsSetCaseIDs() { - return DeleteCaseDataReq_CaseIDs_DEFAULT - } - return p.CaseIDs -} - -var DeleteCaseDataReq_Base_DEFAULT *base.Base - -func (p *DeleteCaseDataReq) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return DeleteCaseDataReq_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_DeleteCaseDataReq = map[int16]string{ - 1: "bizCtx", - 2: "caseIDs", - 255: "Base", -} - -func (p *DeleteCaseDataReq) IsSetBizCtx() bool { - return p.BizCtx != nil -} - -func (p *DeleteCaseDataReq) IsSetCaseIDs() bool { - return p.CaseIDs != nil -} - -func (p *DeleteCaseDataReq) IsSetBase() bool { - return p.Base != nil -} - -func (p *DeleteCaseDataReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.LIST { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteCaseDataReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *DeleteCaseDataReq) ReadField1(iprot thrift.TProtocol) error { - _field := infra.NewBizCtx() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizCtx = _field - return nil -} -func (p *DeleteCaseDataReq) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]int64, 0, size) - for i := 0; i < size; i++ { - - var _elem int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.CaseIDs = _field - return nil -} -func (p *DeleteCaseDataReq) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *DeleteCaseDataReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DeleteCaseDataReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *DeleteCaseDataReq) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBizCtx() { - if err = oprot.WriteFieldBegin("bizCtx", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.BizCtx.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *DeleteCaseDataReq) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseIDs() { - if err = oprot.WriteFieldBegin("caseIDs", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I64, len(p.CaseIDs)); err != nil { - return err - } - for _, v := range p.CaseIDs { - if err := oprot.WriteI64(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *DeleteCaseDataReq) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *DeleteCaseDataReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DeleteCaseDataReq(%+v)", *p) - -} - -type DeleteCaseDataResp struct { - DeletedCaseIDS []int64 `thrift:"deletedCaseIDS,1,optional" form:"deletedCaseIDS" json:"deletedCaseIDS,omitempty" query:"deletedCaseIDS"` - Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` - Msg *string `thrift:"msg,254,optional" form:"msg" json:"msg,omitempty" query:"msg"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` -} - -func NewDeleteCaseDataResp() *DeleteCaseDataResp { - return &DeleteCaseDataResp{} -} - -func (p *DeleteCaseDataResp) InitDefault() { -} - -var DeleteCaseDataResp_DeletedCaseIDS_DEFAULT []int64 - -func (p *DeleteCaseDataResp) GetDeletedCaseIDS() (v []int64) { - if !p.IsSetDeletedCaseIDS() { - return DeleteCaseDataResp_DeletedCaseIDS_DEFAULT - } - return p.DeletedCaseIDS -} - -var DeleteCaseDataResp_Code_DEFAULT int32 - -func (p *DeleteCaseDataResp) GetCode() (v int32) { - if !p.IsSetCode() { - return DeleteCaseDataResp_Code_DEFAULT - } - return *p.Code -} - -var DeleteCaseDataResp_Msg_DEFAULT string - -func (p *DeleteCaseDataResp) GetMsg() (v string) { - if !p.IsSetMsg() { - return DeleteCaseDataResp_Msg_DEFAULT - } - return *p.Msg -} - -var DeleteCaseDataResp_BaseResp_DEFAULT *base.BaseResp - -func (p *DeleteCaseDataResp) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return DeleteCaseDataResp_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_DeleteCaseDataResp = map[int16]string{ - 1: "deletedCaseIDS", - 253: "code", - 254: "msg", - 255: "BaseResp", -} - -func (p *DeleteCaseDataResp) IsSetDeletedCaseIDS() bool { - return p.DeletedCaseIDS != nil -} - -func (p *DeleteCaseDataResp) IsSetCode() bool { - return p.Code != nil -} - -func (p *DeleteCaseDataResp) IsSetMsg() bool { - return p.Msg != nil -} - -func (p *DeleteCaseDataResp) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *DeleteCaseDataResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 253: - if fieldTypeId == thrift.I32 { - if err = p.ReadField253(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 254: - if fieldTypeId == thrift.STRING { - if err = p.ReadField254(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteCaseDataResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *DeleteCaseDataResp) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]int64, 0, size) - for i := 0; i < size; i++ { - - var _elem int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.DeletedCaseIDS = _field - return nil -} -func (p *DeleteCaseDataResp) ReadField253(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *DeleteCaseDataResp) ReadField254(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Msg = _field - return nil -} -func (p *DeleteCaseDataResp) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *DeleteCaseDataResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DeleteCaseDataResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField253(oprot); err != nil { - fieldId = 253 - goto WriteFieldError - } - if err = p.writeField254(oprot); err != nil { - fieldId = 254 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *DeleteCaseDataResp) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetDeletedCaseIDS() { - if err = oprot.WriteFieldBegin("deletedCaseIDS", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I64, len(p.DeletedCaseIDS)); err != nil { - return err - } - for _, v := range p.DeletedCaseIDS { - if err := oprot.WriteI64(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *DeleteCaseDataResp) writeField253(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.I32, 253); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) -} -func (p *DeleteCaseDataResp) writeField254(oprot thrift.TProtocol) (err error) { - if p.IsSetMsg() { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) -} -func (p *DeleteCaseDataResp) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *DeleteCaseDataResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DeleteCaseDataResp(%+v)", *p) - -} - -type CheckCaseDuplicateReq struct { - BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - // Case name - CaseName *string `thrift:"caseName,2,optional" form:"caseName" json:"caseName,omitempty" query:"caseName"` - BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,3,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewCheckCaseDuplicateReq() *CheckCaseDuplicateReq { - return &CheckCaseDuplicateReq{} -} - -func (p *CheckCaseDuplicateReq) InitDefault() { -} - -var CheckCaseDuplicateReq_BizCtx_DEFAULT *infra.BizCtx - -func (p *CheckCaseDuplicateReq) GetBizCtx() (v *infra.BizCtx) { - if !p.IsSetBizCtx() { - return CheckCaseDuplicateReq_BizCtx_DEFAULT - } - return p.BizCtx -} - -var CheckCaseDuplicateReq_CaseName_DEFAULT string - -func (p *CheckCaseDuplicateReq) GetCaseName() (v string) { - if !p.IsSetCaseName() { - return CheckCaseDuplicateReq_CaseName_DEFAULT - } - return *p.CaseName -} - -var CheckCaseDuplicateReq_BizComponentSubject_DEFAULT *infra.ComponentSubject - -func (p *CheckCaseDuplicateReq) GetBizComponentSubject() (v *infra.ComponentSubject) { - if !p.IsSetBizComponentSubject() { - return CheckCaseDuplicateReq_BizComponentSubject_DEFAULT - } - return p.BizComponentSubject -} - -var CheckCaseDuplicateReq_Base_DEFAULT *base.Base - -func (p *CheckCaseDuplicateReq) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return CheckCaseDuplicateReq_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_CheckCaseDuplicateReq = map[int16]string{ - 1: "bizCtx", - 2: "caseName", - 3: "bizComponentSubject", - 255: "Base", -} - -func (p *CheckCaseDuplicateReq) IsSetBizCtx() bool { - return p.BizCtx != nil -} - -func (p *CheckCaseDuplicateReq) IsSetCaseName() bool { - return p.CaseName != nil -} - -func (p *CheckCaseDuplicateReq) IsSetBizComponentSubject() bool { - return p.BizComponentSubject != nil -} - -func (p *CheckCaseDuplicateReq) IsSetBase() bool { - return p.Base != nil -} - -func (p *CheckCaseDuplicateReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CheckCaseDuplicateReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *CheckCaseDuplicateReq) ReadField1(iprot thrift.TProtocol) error { - _field := infra.NewBizCtx() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizCtx = _field - return nil -} -func (p *CheckCaseDuplicateReq) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.CaseName = _field - return nil -} -func (p *CheckCaseDuplicateReq) ReadField3(iprot thrift.TProtocol) error { - _field := infra.NewComponentSubject() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizComponentSubject = _field - return nil -} -func (p *CheckCaseDuplicateReq) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *CheckCaseDuplicateReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CheckCaseDuplicateReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *CheckCaseDuplicateReq) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBizCtx() { - if err = oprot.WriteFieldBegin("bizCtx", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.BizCtx.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *CheckCaseDuplicateReq) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseName() { - if err = oprot.WriteFieldBegin("caseName", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.CaseName); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *CheckCaseDuplicateReq) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetBizComponentSubject() { - if err = oprot.WriteFieldBegin("bizComponentSubject", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.BizComponentSubject.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *CheckCaseDuplicateReq) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *CheckCaseDuplicateReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CheckCaseDuplicateReq(%+v)", *p) - -} - -type CheckCaseDuplicateResp struct { - IsPass *bool `thrift:"isPass,1,optional" form:"isPass" json:"isPass,omitempty" query:"isPass"` - // When pass = false, give the specific reason why the check failed - FailReason *string `thrift:"failReason,2,optional" form:"failReason" json:"failReason,omitempty" query:"failReason"` - FailCode *int32 `thrift:"failCode,3,optional" form:"failCode" json:"failCode,omitempty" query:"failCode"` - Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` - Msg *string `thrift:"msg,254,optional" form:"msg" json:"msg,omitempty" query:"msg"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` -} - -func NewCheckCaseDuplicateResp() *CheckCaseDuplicateResp { - return &CheckCaseDuplicateResp{} -} - -func (p *CheckCaseDuplicateResp) InitDefault() { -} - -var CheckCaseDuplicateResp_IsPass_DEFAULT bool - -func (p *CheckCaseDuplicateResp) GetIsPass() (v bool) { - if !p.IsSetIsPass() { - return CheckCaseDuplicateResp_IsPass_DEFAULT - } - return *p.IsPass -} - -var CheckCaseDuplicateResp_FailReason_DEFAULT string - -func (p *CheckCaseDuplicateResp) GetFailReason() (v string) { - if !p.IsSetFailReason() { - return CheckCaseDuplicateResp_FailReason_DEFAULT - } - return *p.FailReason -} - -var CheckCaseDuplicateResp_FailCode_DEFAULT int32 - -func (p *CheckCaseDuplicateResp) GetFailCode() (v int32) { - if !p.IsSetFailCode() { - return CheckCaseDuplicateResp_FailCode_DEFAULT - } - return *p.FailCode -} - -var CheckCaseDuplicateResp_Code_DEFAULT int32 - -func (p *CheckCaseDuplicateResp) GetCode() (v int32) { - if !p.IsSetCode() { - return CheckCaseDuplicateResp_Code_DEFAULT - } - return *p.Code -} - -var CheckCaseDuplicateResp_Msg_DEFAULT string - -func (p *CheckCaseDuplicateResp) GetMsg() (v string) { - if !p.IsSetMsg() { - return CheckCaseDuplicateResp_Msg_DEFAULT - } - return *p.Msg -} - -var CheckCaseDuplicateResp_BaseResp_DEFAULT *base.BaseResp - -func (p *CheckCaseDuplicateResp) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return CheckCaseDuplicateResp_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_CheckCaseDuplicateResp = map[int16]string{ - 1: "isPass", - 2: "failReason", - 3: "failCode", - 253: "code", - 254: "msg", - 255: "BaseResp", -} - -func (p *CheckCaseDuplicateResp) IsSetIsPass() bool { - return p.IsPass != nil -} - -func (p *CheckCaseDuplicateResp) IsSetFailReason() bool { - return p.FailReason != nil -} - -func (p *CheckCaseDuplicateResp) IsSetFailCode() bool { - return p.FailCode != nil -} - -func (p *CheckCaseDuplicateResp) IsSetCode() bool { - return p.Code != nil -} - -func (p *CheckCaseDuplicateResp) IsSetMsg() bool { - return p.Msg != nil -} - -func (p *CheckCaseDuplicateResp) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *CheckCaseDuplicateResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I32 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 253: - if fieldTypeId == thrift.I32 { - if err = p.ReadField253(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 254: - if fieldTypeId == thrift.STRING { - if err = p.ReadField254(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CheckCaseDuplicateResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *CheckCaseDuplicateResp) ReadField1(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.IsPass = _field - return nil -} -func (p *CheckCaseDuplicateResp) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.FailReason = _field - return nil -} -func (p *CheckCaseDuplicateResp) ReadField3(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.FailCode = _field - return nil -} -func (p *CheckCaseDuplicateResp) ReadField253(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *CheckCaseDuplicateResp) ReadField254(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Msg = _field - return nil -} -func (p *CheckCaseDuplicateResp) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *CheckCaseDuplicateResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CheckCaseDuplicateResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField253(oprot); err != nil { - fieldId = 253 - goto WriteFieldError - } - if err = p.writeField254(oprot); err != nil { - fieldId = 254 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *CheckCaseDuplicateResp) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetIsPass() { - if err = oprot.WriteFieldBegin("isPass", thrift.BOOL, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.IsPass); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *CheckCaseDuplicateResp) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetFailReason() { - if err = oprot.WriteFieldBegin("failReason", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.FailReason); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *CheckCaseDuplicateResp) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFailCode() { - if err = oprot.WriteFieldBegin("failCode", thrift.I32, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.FailCode); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *CheckCaseDuplicateResp) writeField253(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.I32, 253); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) -} -func (p *CheckCaseDuplicateResp) writeField254(oprot thrift.TProtocol) (err error) { - if p.IsSetMsg() { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) -} -func (p *CheckCaseDuplicateResp) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *CheckCaseDuplicateResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CheckCaseDuplicateResp(%+v)", *p) - -} - -type GetSchemaByIDReq struct { - // business information - BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,2,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewGetSchemaByIDReq() *GetSchemaByIDReq { - return &GetSchemaByIDReq{} -} - -func (p *GetSchemaByIDReq) InitDefault() { -} - -var GetSchemaByIDReq_BizCtx_DEFAULT *infra.BizCtx - -func (p *GetSchemaByIDReq) GetBizCtx() (v *infra.BizCtx) { - if !p.IsSetBizCtx() { - return GetSchemaByIDReq_BizCtx_DEFAULT - } - return p.BizCtx -} - -var GetSchemaByIDReq_BizComponentSubject_DEFAULT *infra.ComponentSubject - -func (p *GetSchemaByIDReq) GetBizComponentSubject() (v *infra.ComponentSubject) { - if !p.IsSetBizComponentSubject() { - return GetSchemaByIDReq_BizComponentSubject_DEFAULT - } - return p.BizComponentSubject -} - -var GetSchemaByIDReq_Base_DEFAULT *base.Base - -func (p *GetSchemaByIDReq) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return GetSchemaByIDReq_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_GetSchemaByIDReq = map[int16]string{ - 1: "bizCtx", - 2: "bizComponentSubject", - 255: "Base", -} - -func (p *GetSchemaByIDReq) IsSetBizCtx() bool { - return p.BizCtx != nil -} - -func (p *GetSchemaByIDReq) IsSetBizComponentSubject() bool { - return p.BizComponentSubject != nil -} - -func (p *GetSchemaByIDReq) IsSetBase() bool { - return p.Base != nil -} - -func (p *GetSchemaByIDReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSchemaByIDReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *GetSchemaByIDReq) ReadField1(iprot thrift.TProtocol) error { - _field := infra.NewBizCtx() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizCtx = _field - return nil -} -func (p *GetSchemaByIDReq) ReadField2(iprot thrift.TProtocol) error { - _field := infra.NewComponentSubject() - if err := _field.Read(iprot); err != nil { - return err - } - p.BizComponentSubject = _field - return nil -} -func (p *GetSchemaByIDReq) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *GetSchemaByIDReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetSchemaByIDReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetSchemaByIDReq) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBizCtx() { - if err = oprot.WriteFieldBegin("bizCtx", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.BizCtx.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetSchemaByIDReq) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetBizComponentSubject() { - if err = oprot.WriteFieldBegin("bizComponentSubject", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.BizComponentSubject.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetSchemaByIDReq) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetSchemaByIDReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetSchemaByIDReq(%+v)", *p) - -} - -type GetSchemaByIDResp struct { - // Component input information in JSON format, consistent with Input JSON Schema, does not contain Value information - SchemaJson *string `thrift:"schemaJson,1,optional" form:"schemaJson" json:"schemaJson,omitempty" query:"schemaJson"` - Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` - Msg *string `thrift:"msg,254,optional" form:"msg" json:"msg,omitempty" query:"msg"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` -} - -func NewGetSchemaByIDResp() *GetSchemaByIDResp { - return &GetSchemaByIDResp{} -} - -func (p *GetSchemaByIDResp) InitDefault() { -} - -var GetSchemaByIDResp_SchemaJson_DEFAULT string - -func (p *GetSchemaByIDResp) GetSchemaJson() (v string) { - if !p.IsSetSchemaJson() { - return GetSchemaByIDResp_SchemaJson_DEFAULT - } - return *p.SchemaJson -} - -var GetSchemaByIDResp_Code_DEFAULT int32 - -func (p *GetSchemaByIDResp) GetCode() (v int32) { - if !p.IsSetCode() { - return GetSchemaByIDResp_Code_DEFAULT - } - return *p.Code -} - -var GetSchemaByIDResp_Msg_DEFAULT string - -func (p *GetSchemaByIDResp) GetMsg() (v string) { - if !p.IsSetMsg() { - return GetSchemaByIDResp_Msg_DEFAULT - } - return *p.Msg -} - -var GetSchemaByIDResp_BaseResp_DEFAULT *base.BaseResp - -func (p *GetSchemaByIDResp) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return GetSchemaByIDResp_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_GetSchemaByIDResp = map[int16]string{ - 1: "schemaJson", - 253: "code", - 254: "msg", - 255: "BaseResp", -} - -func (p *GetSchemaByIDResp) IsSetSchemaJson() bool { - return p.SchemaJson != nil -} - -func (p *GetSchemaByIDResp) IsSetCode() bool { - return p.Code != nil -} - -func (p *GetSchemaByIDResp) IsSetMsg() bool { - return p.Msg != nil -} - -func (p *GetSchemaByIDResp) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *GetSchemaByIDResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 253: - if fieldTypeId == thrift.I32 { - if err = p.ReadField253(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 254: - if fieldTypeId == thrift.STRING { - if err = p.ReadField254(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSchemaByIDResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *GetSchemaByIDResp) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.SchemaJson = _field - return nil -} -func (p *GetSchemaByIDResp) ReadField253(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *GetSchemaByIDResp) ReadField254(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Msg = _field - return nil -} -func (p *GetSchemaByIDResp) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *GetSchemaByIDResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetSchemaByIDResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField253(oprot); err != nil { - fieldId = 253 - goto WriteFieldError - } - if err = p.writeField254(oprot); err != nil { - fieldId = 254 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetSchemaByIDResp) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaJson() { - if err = oprot.WriteFieldBegin("schemaJson", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.SchemaJson); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetSchemaByIDResp) writeField253(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.I32, 253); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) -} -func (p *GetSchemaByIDResp) writeField254(oprot thrift.TProtocol) (err error) { - if p.IsSetMsg() { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) -} -func (p *GetSchemaByIDResp) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetSchemaByIDResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetSchemaByIDResp(%+v)", *p) - -} diff --git a/backend/api/model/flow/devops/debugger/domain/infra/infra.go b/backend/api/model/flow/devops/debugger/domain/infra/infra.go deleted file mode 100644 index 0be16bf5..00000000 --- a/backend/api/model/flow/devops/debugger/domain/infra/infra.go +++ /dev/null @@ -1,1392 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package infra - -import ( - "database/sql" - "database/sql/driver" - "fmt" - "github.com/apache/thrift/lib/go/thrift" -) - -// ComponentType Supports component types -type ComponentType int64 - -const ( - ComponentType_Undefined ComponentType = 0 - // Coze Plugin - ComponentType_CozePlugin ComponentType = 10000 - // Coze Tool - ComponentType_CozeTool ComponentType = 10001 - // Coze Workflow - ComponentType_CozeWorkflow ComponentType = 10002 - // Coze SubWorkflow, which is referenced in Workflow. - ComponentType_CozeSubWorkflow ComponentType = 10003 - // LLM nodes in Coze workflow - ComponentType_CozeLLMNode ComponentType = 10004 - // Coding nodes in a Coze workflow - ComponentType_CozeCodeNode ComponentType = 10005 - // Knowledge nodes in Coze workflow - ComponentType_CozeKnowledgeNode ComponentType = 10006 - // Tools nodes in Coze workflow - ComponentType_CozeToolNode ComponentType = 10007 - // Coze workflow start node - ComponentType_CozeStartNode ComponentType = 10008 - // Cozing variable nodes in workflow - ComponentType_CozeVariableNode ComponentType = 10009 - // Coze virtual nodes to identify variable dependent bots - ComponentType_CozeVariableBot ComponentType = 20000 - // Coze virtual nodes to identify variable dependent chats - ComponentType_CozeVariableChat ComponentType = 20001 -) - -func (p ComponentType) String() string { - switch p { - case ComponentType_Undefined: - return "Undefined" - case ComponentType_CozePlugin: - return "CozePlugin" - case ComponentType_CozeTool: - return "CozeTool" - case ComponentType_CozeWorkflow: - return "CozeWorkflow" - case ComponentType_CozeSubWorkflow: - return "CozeSubWorkflow" - case ComponentType_CozeLLMNode: - return "CozeLLMNode" - case ComponentType_CozeCodeNode: - return "CozeCodeNode" - case ComponentType_CozeKnowledgeNode: - return "CozeKnowledgeNode" - case ComponentType_CozeToolNode: - return "CozeToolNode" - case ComponentType_CozeStartNode: - return "CozeStartNode" - case ComponentType_CozeVariableNode: - return "CozeVariableNode" - case ComponentType_CozeVariableBot: - return "CozeVariableBot" - case ComponentType_CozeVariableChat: - return "CozeVariableChat" - } - return "" -} - -func ComponentTypeFromString(s string) (ComponentType, error) { - switch s { - case "Undefined": - return ComponentType_Undefined, nil - case "CozePlugin": - return ComponentType_CozePlugin, nil - case "CozeTool": - return ComponentType_CozeTool, nil - case "CozeWorkflow": - return ComponentType_CozeWorkflow, nil - case "CozeSubWorkflow": - return ComponentType_CozeSubWorkflow, nil - case "CozeLLMNode": - return ComponentType_CozeLLMNode, nil - case "CozeCodeNode": - return ComponentType_CozeCodeNode, nil - case "CozeKnowledgeNode": - return ComponentType_CozeKnowledgeNode, nil - case "CozeToolNode": - return ComponentType_CozeToolNode, nil - case "CozeStartNode": - return ComponentType_CozeStartNode, nil - case "CozeVariableNode": - return ComponentType_CozeVariableNode, nil - case "CozeVariableBot": - return ComponentType_CozeVariableBot, nil - case "CozeVariableChat": - return ComponentType_CozeVariableChat, nil - } - return ComponentType(0), fmt.Errorf("not a valid ComponentType string") -} - -func ComponentTypePtr(v ComponentType) *ComponentType { return &v } -func (p *ComponentType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = ComponentType(result.Int64) - return -} - -func (p *ComponentType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -// TrafficScene traffic request scenario -type TrafficScene int64 - -const ( - TrafficScene_Undefined TrafficScene = 0 - // Single Agent Debug Page - TrafficScene_CozeSingleAgentDebug TrafficScene = 10000 - // Multi-Agent Debug Page - TrafficScene_CozeMultiAgentDebug TrafficScene = 10001 - // Tool Debug Page - TrafficScene_CozeToolDebug TrafficScene = 10002 - // Workflow debugging page - TrafficScene_CozeWorkflowDebug TrafficScene = 10003 -) - -func (p TrafficScene) String() string { - switch p { - case TrafficScene_Undefined: - return "Undefined" - case TrafficScene_CozeSingleAgentDebug: - return "CozeSingleAgentDebug" - case TrafficScene_CozeMultiAgentDebug: - return "CozeMultiAgentDebug" - case TrafficScene_CozeToolDebug: - return "CozeToolDebug" - case TrafficScene_CozeWorkflowDebug: - return "CozeWorkflowDebug" - } - return "" -} - -func TrafficSceneFromString(s string) (TrafficScene, error) { - switch s { - case "Undefined": - return TrafficScene_Undefined, nil - case "CozeSingleAgentDebug": - return TrafficScene_CozeSingleAgentDebug, nil - case "CozeMultiAgentDebug": - return TrafficScene_CozeMultiAgentDebug, nil - case "CozeToolDebug": - return TrafficScene_CozeToolDebug, nil - case "CozeWorkflowDebug": - return TrafficScene_CozeWorkflowDebug, nil - } - return TrafficScene(0), fmt.Errorf("not a valid TrafficScene string") -} - -func TrafficScenePtr(v TrafficScene) *TrafficScene { return &v } -func (p *TrafficScene) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TrafficScene(result.Int64) - return -} - -func (p *TrafficScene) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -// ComponentMappingType Component Mapping Types -type ComponentMappingType int64 - -const ( - ComponentMappingType_Undefined ComponentMappingType = 0 - ComponentMappingType_MockSet ComponentMappingType = 1 -) - -func (p ComponentMappingType) String() string { - switch p { - case ComponentMappingType_Undefined: - return "Undefined" - case ComponentMappingType_MockSet: - return "MockSet" - } - return "" -} - -func ComponentMappingTypeFromString(s string) (ComponentMappingType, error) { - switch s { - case "Undefined": - return ComponentMappingType_Undefined, nil - case "MockSet": - return ComponentMappingType_MockSet, nil - } - return ComponentMappingType(0), fmt.Errorf("not a valid ComponentMappingType string") -} - -func ComponentMappingTypePtr(v ComponentMappingType) *ComponentMappingType { return &v } -func (p *ComponentMappingType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = ComponentMappingType(result.Int64) - return -} - -func (p *ComponentMappingType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type OrderBy int64 - -const ( - OrderBy_UpdateTime OrderBy = 1 -) - -func (p OrderBy) String() string { - switch p { - case OrderBy_UpdateTime: - return "UpdateTime" - } - return "" -} - -func OrderByFromString(s string) (OrderBy, error) { - switch s { - case "UpdateTime": - return OrderBy_UpdateTime, nil - } - return OrderBy(0), fmt.Errorf("not a valid OrderBy string") -} - -func OrderByPtr(v OrderBy) *OrderBy { return &v } -func (p *OrderBy) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = OrderBy(result.Int64) - return -} - -func (p *OrderBy) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type DebugScene int64 - -const ( - // Default play ground Debug scene - DebugScene_Debug DebugScene = 0 -) - -func (p DebugScene) String() string { - switch p { - case DebugScene_Debug: - return "Debug" - } - return "" -} - -func DebugSceneFromString(s string) (DebugScene, error) { - switch s { - case "Debug": - return DebugScene_Debug, nil - } - return DebugScene(0), fmt.Errorf("not a valid DebugScene string") -} - -func DebugScenePtr(v DebugScene) *DebugScene { return &v } -func (p *DebugScene) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = DebugScene(result.Int64) - return -} - -func (p *DebugScene) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type CozeChannel int64 - -const ( - // Default to Coze, expand to other channels in the future - CozeChannel_Coze CozeChannel = 0 -) - -func (p CozeChannel) String() string { - switch p { - case CozeChannel_Coze: - return "Coze" - } - return "" -} - -func CozeChannelFromString(s string) (CozeChannel, error) { - switch s { - case "Coze": - return CozeChannel_Coze, nil - } - return CozeChannel(0), fmt.Errorf("not a valid CozeChannel string") -} - -func CozeChannelPtr(v CozeChannel) *CozeChannel { return &v } -func (p *CozeChannel) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = CozeChannel(result.Int64) - return -} - -func (p *CozeChannel) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -// BizCtx Business Context -type BizCtx struct { - // connectorID - ConnectorID *string `thrift:"connectorID,1,optional" form:"connectorID" json:"connectorID,omitempty" query:"connectorID"` - // User ID under connector - ConnectorUID *string `thrift:"connectorUID,2,optional" form:"connectorUID" json:"connectorUID,omitempty" query:"connectorUID"` - // business scenario - TrafficScene *TrafficScene `thrift:"trafficScene,3,optional" form:"trafficScene" json:"trafficScene,omitempty" query:"trafficScene"` - // Business Scenario Component ID, such as Bot Debug Page, where trafficSceneID is BotID - TrafficCallerID *string `thrift:"trafficCallerID,4,optional" form:"trafficCallerID" json:"trafficCallerID,omitempty" query:"trafficCallerID"` - // Line of business SpaceID for access control - BizSpaceID *string `thrift:"bizSpaceID,5,optional" form:"bizSpaceID" json:"bizSpaceID,omitempty" query:"bizSpaceID"` - // Additional information - Ext map[string]string `thrift:"ext,6,optional" form:"ext" json:"ext,omitempty" query:"ext"` -} - -func NewBizCtx() *BizCtx { - return &BizCtx{} -} - -func (p *BizCtx) InitDefault() { -} - -var BizCtx_ConnectorID_DEFAULT string - -func (p *BizCtx) GetConnectorID() (v string) { - if !p.IsSetConnectorID() { - return BizCtx_ConnectorID_DEFAULT - } - return *p.ConnectorID -} - -var BizCtx_ConnectorUID_DEFAULT string - -func (p *BizCtx) GetConnectorUID() (v string) { - if !p.IsSetConnectorUID() { - return BizCtx_ConnectorUID_DEFAULT - } - return *p.ConnectorUID -} - -var BizCtx_TrafficScene_DEFAULT TrafficScene - -func (p *BizCtx) GetTrafficScene() (v TrafficScene) { - if !p.IsSetTrafficScene() { - return BizCtx_TrafficScene_DEFAULT - } - return *p.TrafficScene -} - -var BizCtx_TrafficCallerID_DEFAULT string - -func (p *BizCtx) GetTrafficCallerID() (v string) { - if !p.IsSetTrafficCallerID() { - return BizCtx_TrafficCallerID_DEFAULT - } - return *p.TrafficCallerID -} - -var BizCtx_BizSpaceID_DEFAULT string - -func (p *BizCtx) GetBizSpaceID() (v string) { - if !p.IsSetBizSpaceID() { - return BizCtx_BizSpaceID_DEFAULT - } - return *p.BizSpaceID -} - -var BizCtx_Ext_DEFAULT map[string]string - -func (p *BizCtx) GetExt() (v map[string]string) { - if !p.IsSetExt() { - return BizCtx_Ext_DEFAULT - } - return p.Ext -} - -var fieldIDToName_BizCtx = map[int16]string{ - 1: "connectorID", - 2: "connectorUID", - 3: "trafficScene", - 4: "trafficCallerID", - 5: "bizSpaceID", - 6: "ext", -} - -func (p *BizCtx) IsSetConnectorID() bool { - return p.ConnectorID != nil -} - -func (p *BizCtx) IsSetConnectorUID() bool { - return p.ConnectorUID != nil -} - -func (p *BizCtx) IsSetTrafficScene() bool { - return p.TrafficScene != nil -} - -func (p *BizCtx) IsSetTrafficCallerID() bool { - return p.TrafficCallerID != nil -} - -func (p *BizCtx) IsSetBizSpaceID() bool { - return p.BizSpaceID != nil -} - -func (p *BizCtx) IsSetExt() bool { - return p.Ext != nil -} - -func (p *BizCtx) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I32 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRING { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.MAP { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BizCtx[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BizCtx) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ConnectorID = _field - return nil -} -func (p *BizCtx) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ConnectorUID = _field - return nil -} -func (p *BizCtx) ReadField3(iprot thrift.TProtocol) error { - - var _field *TrafficScene - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := TrafficScene(v) - _field = &tmp - } - p.TrafficScene = _field - return nil -} -func (p *BizCtx) ReadField4(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.TrafficCallerID = _field - return nil -} -func (p *BizCtx) ReadField5(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.BizSpaceID = _field - return nil -} -func (p *BizCtx) ReadField6(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.Ext = _field - return nil -} - -func (p *BizCtx) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("BizCtx"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *BizCtx) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorID() { - if err = oprot.WriteFieldBegin("connectorID", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ConnectorID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *BizCtx) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorUID() { - if err = oprot.WriteFieldBegin("connectorUID", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ConnectorUID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *BizCtx) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetTrafficScene() { - if err = oprot.WriteFieldBegin("trafficScene", thrift.I32, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.TrafficScene)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *BizCtx) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetTrafficCallerID() { - if err = oprot.WriteFieldBegin("trafficCallerID", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.TrafficCallerID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *BizCtx) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetBizSpaceID() { - if err = oprot.WriteFieldBegin("bizSpaceID", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.BizSpaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *BizCtx) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetExt() { - if err = oprot.WriteFieldBegin("ext", thrift.MAP, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { - return err - } - for k, v := range p.Ext { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *BizCtx) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BizCtx(%+v)", *p) - -} - -// Secondary structure of the ComponentSubject business component -type ComponentSubject struct { - // Component IDs, such as Tool ID, Node ID, etc - ComponentID *string `thrift:"componentID,1,optional" form:"componentID" json:"componentID,omitempty" query:"componentID"` - // component type - ComponentType *ComponentType `thrift:"componentType,2,optional" form:"componentType" json:"componentType,omitempty" query:"componentType"` - // Parent component ID, e.g. Tool- > Plugin, Node- > Workflow - ParentComponentID *string `thrift:"parentComponentID,3,optional" form:"parentComponentID" json:"parentComponentID,omitempty" query:"parentComponentID"` - // Parent component type - ParentComponentType *ComponentType `thrift:"parentComponentType,4,optional" form:"parentComponentType" json:"parentComponentType,omitempty" query:"parentComponentType"` -} - -func NewComponentSubject() *ComponentSubject { - return &ComponentSubject{} -} - -func (p *ComponentSubject) InitDefault() { -} - -var ComponentSubject_ComponentID_DEFAULT string - -func (p *ComponentSubject) GetComponentID() (v string) { - if !p.IsSetComponentID() { - return ComponentSubject_ComponentID_DEFAULT - } - return *p.ComponentID -} - -var ComponentSubject_ComponentType_DEFAULT ComponentType - -func (p *ComponentSubject) GetComponentType() (v ComponentType) { - if !p.IsSetComponentType() { - return ComponentSubject_ComponentType_DEFAULT - } - return *p.ComponentType -} - -var ComponentSubject_ParentComponentID_DEFAULT string - -func (p *ComponentSubject) GetParentComponentID() (v string) { - if !p.IsSetParentComponentID() { - return ComponentSubject_ParentComponentID_DEFAULT - } - return *p.ParentComponentID -} - -var ComponentSubject_ParentComponentType_DEFAULT ComponentType - -func (p *ComponentSubject) GetParentComponentType() (v ComponentType) { - if !p.IsSetParentComponentType() { - return ComponentSubject_ParentComponentType_DEFAULT - } - return *p.ParentComponentType -} - -var fieldIDToName_ComponentSubject = map[int16]string{ - 1: "componentID", - 2: "componentType", - 3: "parentComponentID", - 4: "parentComponentType", -} - -func (p *ComponentSubject) IsSetComponentID() bool { - return p.ComponentID != nil -} - -func (p *ComponentSubject) IsSetComponentType() bool { - return p.ComponentType != nil -} - -func (p *ComponentSubject) IsSetParentComponentID() bool { - return p.ParentComponentID != nil -} - -func (p *ComponentSubject) IsSetParentComponentType() bool { - return p.ParentComponentType != nil -} - -func (p *ComponentSubject) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I32 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I32 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ComponentSubject[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *ComponentSubject) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ComponentID = _field - return nil -} -func (p *ComponentSubject) ReadField2(iprot thrift.TProtocol) error { - - var _field *ComponentType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := ComponentType(v) - _field = &tmp - } - p.ComponentType = _field - return nil -} -func (p *ComponentSubject) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ParentComponentID = _field - return nil -} -func (p *ComponentSubject) ReadField4(iprot thrift.TProtocol) error { - - var _field *ComponentType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := ComponentType(v) - _field = &tmp - } - p.ParentComponentType = _field - return nil -} - -func (p *ComponentSubject) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("ComponentSubject"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *ComponentSubject) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetComponentID() { - if err = oprot.WriteFieldBegin("componentID", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ComponentID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *ComponentSubject) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetComponentType() { - if err = oprot.WriteFieldBegin("componentType", thrift.I32, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.ComponentType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *ComponentSubject) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetParentComponentID() { - if err = oprot.WriteFieldBegin("parentComponentID", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ParentComponentID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *ComponentSubject) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetParentComponentType() { - if err = oprot.WriteFieldBegin("parentComponentType", thrift.I32, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(*p.ParentComponentType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *ComponentSubject) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ComponentSubject(%+v)", *p) - -} - -type Creator struct { - ID *string `thrift:"ID,1,optional" form:"ID" json:"ID,omitempty" query:"ID"` - Name *string `thrift:"name,2,optional" form:"name" json:"name,omitempty" query:"name"` - AvatarUrl *string `thrift:"avatarUrl,3,optional" form:"avatarUrl" json:"avatarUrl,omitempty" query:"avatarUrl"` -} - -func NewCreator() *Creator { - return &Creator{} -} - -func (p *Creator) InitDefault() { -} - -var Creator_ID_DEFAULT string - -func (p *Creator) GetID() (v string) { - if !p.IsSetID() { - return Creator_ID_DEFAULT - } - return *p.ID -} - -var Creator_Name_DEFAULT string - -func (p *Creator) GetName() (v string) { - if !p.IsSetName() { - return Creator_Name_DEFAULT - } - return *p.Name -} - -var Creator_AvatarUrl_DEFAULT string - -func (p *Creator) GetAvatarUrl() (v string) { - if !p.IsSetAvatarUrl() { - return Creator_AvatarUrl_DEFAULT - } - return *p.AvatarUrl -} - -var fieldIDToName_Creator = map[int16]string{ - 1: "ID", - 2: "name", - 3: "avatarUrl", -} - -func (p *Creator) IsSetID() bool { - return p.ID != nil -} - -func (p *Creator) IsSetName() bool { - return p.Name != nil -} - -func (p *Creator) IsSetAvatarUrl() bool { - return p.AvatarUrl != nil -} - -func (p *Creator) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Creator[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *Creator) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ID = _field - return nil -} -func (p *Creator) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Name = _field - return nil -} -func (p *Creator) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.AvatarUrl = _field - return nil -} - -func (p *Creator) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("Creator"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *Creator) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetID() { - if err = oprot.WriteFieldBegin("ID", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *Creator) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetName() { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *Creator) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetAvatarUrl() { - if err = oprot.WriteFieldBegin("avatarUrl", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.AvatarUrl); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *Creator) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Creator(%+v)", *p) - -} diff --git a/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go b/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go deleted file mode 100644 index 1470a9b5..00000000 --- a/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go +++ /dev/null @@ -1,810 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package testcase - -import ( - "fmt" - "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra" -) - -type CaseDataBase struct { - // Do not fill in when adding, fill in when updating - CaseID *int64 `thrift:"caseID,1,optional" json:"caseID,string" form:"caseID" query:"caseID"` - Name *string `thrift:"name,2,optional" form:"name" json:"name,omitempty" query:"name"` - Description *string `thrift:"description,3,optional" form:"description" json:"description,omitempty" query:"description"` - // Input information in JSON format - Input *string `thrift:"input,4,optional" form:"input" json:"input,omitempty" query:"input"` - IsDefault *bool `thrift:"isDefault,5,optional" form:"isDefault" json:"isDefault,omitempty" query:"isDefault"` -} - -func NewCaseDataBase() *CaseDataBase { - return &CaseDataBase{} -} - -func (p *CaseDataBase) InitDefault() { -} - -var CaseDataBase_CaseID_DEFAULT int64 - -func (p *CaseDataBase) GetCaseID() (v int64) { - if !p.IsSetCaseID() { - return CaseDataBase_CaseID_DEFAULT - } - return *p.CaseID -} - -var CaseDataBase_Name_DEFAULT string - -func (p *CaseDataBase) GetName() (v string) { - if !p.IsSetName() { - return CaseDataBase_Name_DEFAULT - } - return *p.Name -} - -var CaseDataBase_Description_DEFAULT string - -func (p *CaseDataBase) GetDescription() (v string) { - if !p.IsSetDescription() { - return CaseDataBase_Description_DEFAULT - } - return *p.Description -} - -var CaseDataBase_Input_DEFAULT string - -func (p *CaseDataBase) GetInput() (v string) { - if !p.IsSetInput() { - return CaseDataBase_Input_DEFAULT - } - return *p.Input -} - -var CaseDataBase_IsDefault_DEFAULT bool - -func (p *CaseDataBase) GetIsDefault() (v bool) { - if !p.IsSetIsDefault() { - return CaseDataBase_IsDefault_DEFAULT - } - return *p.IsDefault -} - -var fieldIDToName_CaseDataBase = map[int16]string{ - 1: "caseID", - 2: "name", - 3: "description", - 4: "input", - 5: "isDefault", -} - -func (p *CaseDataBase) IsSetCaseID() bool { - return p.CaseID != nil -} - -func (p *CaseDataBase) IsSetName() bool { - return p.Name != nil -} - -func (p *CaseDataBase) IsSetDescription() bool { - return p.Description != nil -} - -func (p *CaseDataBase) IsSetInput() bool { - return p.Input != nil -} - -func (p *CaseDataBase) IsSetIsDefault() bool { - return p.IsDefault != nil -} - -func (p *CaseDataBase) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CaseDataBase[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *CaseDataBase) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.CaseID = _field - return nil -} -func (p *CaseDataBase) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Name = _field - return nil -} -func (p *CaseDataBase) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Description = _field - return nil -} -func (p *CaseDataBase) ReadField4(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Input = _field - return nil -} -func (p *CaseDataBase) ReadField5(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.IsDefault = _field - return nil -} - -func (p *CaseDataBase) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CaseDataBase"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *CaseDataBase) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseID() { - if err = oprot.WriteFieldBegin("caseID", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.CaseID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *CaseDataBase) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetName() { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *CaseDataBase) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDescription() { - if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Description); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *CaseDataBase) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetInput() { - if err = oprot.WriteFieldBegin("input", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Input); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *CaseDataBase) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetIsDefault() { - if err = oprot.WriteFieldBegin("isDefault", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.IsDefault); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *CaseDataBase) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CaseDataBase(%+v)", *p) - -} - -type CaseDataDetail struct { - CaseBase *CaseDataBase `thrift:"caseBase,1,optional" form:"caseBase" json:"caseBase,omitempty" query:"caseBase"` - CreatorID *string `thrift:"creatorID,2,optional" form:"creatorID" json:"creatorID,omitempty" query:"creatorID"` - CreateTimeInSec *int64 `thrift:"createTimeInSec,3,optional" form:"createTimeInSec" json:"createTimeInSec,omitempty" query:"createTimeInSec"` - UpdateTimeInSec *int64 `thrift:"updateTimeInSec,4,optional" form:"updateTimeInSec" json:"updateTimeInSec,omitempty" query:"updateTimeInSec"` - // Schema incompatibility - SchemaIncompatible *bool `thrift:"schemaIncompatible,5,optional" form:"schemaIncompatible" json:"schemaIncompatible,omitempty" query:"schemaIncompatible"` - Updater *infra.Creator `thrift:"updater,6,optional" form:"updater" json:"updater,omitempty" query:"updater"` -} - -func NewCaseDataDetail() *CaseDataDetail { - return &CaseDataDetail{} -} - -func (p *CaseDataDetail) InitDefault() { -} - -var CaseDataDetail_CaseBase_DEFAULT *CaseDataBase - -func (p *CaseDataDetail) GetCaseBase() (v *CaseDataBase) { - if !p.IsSetCaseBase() { - return CaseDataDetail_CaseBase_DEFAULT - } - return p.CaseBase -} - -var CaseDataDetail_CreatorID_DEFAULT string - -func (p *CaseDataDetail) GetCreatorID() (v string) { - if !p.IsSetCreatorID() { - return CaseDataDetail_CreatorID_DEFAULT - } - return *p.CreatorID -} - -var CaseDataDetail_CreateTimeInSec_DEFAULT int64 - -func (p *CaseDataDetail) GetCreateTimeInSec() (v int64) { - if !p.IsSetCreateTimeInSec() { - return CaseDataDetail_CreateTimeInSec_DEFAULT - } - return *p.CreateTimeInSec -} - -var CaseDataDetail_UpdateTimeInSec_DEFAULT int64 - -func (p *CaseDataDetail) GetUpdateTimeInSec() (v int64) { - if !p.IsSetUpdateTimeInSec() { - return CaseDataDetail_UpdateTimeInSec_DEFAULT - } - return *p.UpdateTimeInSec -} - -var CaseDataDetail_SchemaIncompatible_DEFAULT bool - -func (p *CaseDataDetail) GetSchemaIncompatible() (v bool) { - if !p.IsSetSchemaIncompatible() { - return CaseDataDetail_SchemaIncompatible_DEFAULT - } - return *p.SchemaIncompatible -} - -var CaseDataDetail_Updater_DEFAULT *infra.Creator - -func (p *CaseDataDetail) GetUpdater() (v *infra.Creator) { - if !p.IsSetUpdater() { - return CaseDataDetail_Updater_DEFAULT - } - return p.Updater -} - -var fieldIDToName_CaseDataDetail = map[int16]string{ - 1: "caseBase", - 2: "creatorID", - 3: "createTimeInSec", - 4: "updateTimeInSec", - 5: "schemaIncompatible", - 6: "updater", -} - -func (p *CaseDataDetail) IsSetCaseBase() bool { - return p.CaseBase != nil -} - -func (p *CaseDataDetail) IsSetCreatorID() bool { - return p.CreatorID != nil -} - -func (p *CaseDataDetail) IsSetCreateTimeInSec() bool { - return p.CreateTimeInSec != nil -} - -func (p *CaseDataDetail) IsSetUpdateTimeInSec() bool { - return p.UpdateTimeInSec != nil -} - -func (p *CaseDataDetail) IsSetSchemaIncompatible() bool { - return p.SchemaIncompatible != nil -} - -func (p *CaseDataDetail) IsSetUpdater() bool { - return p.Updater != nil -} - -func (p *CaseDataDetail) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CaseDataDetail[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *CaseDataDetail) ReadField1(iprot thrift.TProtocol) error { - _field := NewCaseDataBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.CaseBase = _field - return nil -} -func (p *CaseDataDetail) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.CreatorID = _field - return nil -} -func (p *CaseDataDetail) ReadField3(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.CreateTimeInSec = _field - return nil -} -func (p *CaseDataDetail) ReadField4(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.UpdateTimeInSec = _field - return nil -} -func (p *CaseDataDetail) ReadField5(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.SchemaIncompatible = _field - return nil -} -func (p *CaseDataDetail) ReadField6(iprot thrift.TProtocol) error { - _field := infra.NewCreator() - if err := _field.Read(iprot); err != nil { - return err - } - p.Updater = _field - return nil -} - -func (p *CaseDataDetail) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CaseDataDetail"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *CaseDataDetail) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCaseBase() { - if err = oprot.WriteFieldBegin("caseBase", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.CaseBase.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *CaseDataDetail) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCreatorID() { - if err = oprot.WriteFieldBegin("creatorID", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.CreatorID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *CaseDataDetail) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCreateTimeInSec() { - if err = oprot.WriteFieldBegin("createTimeInSec", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.CreateTimeInSec); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *CaseDataDetail) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetUpdateTimeInSec() { - if err = oprot.WriteFieldBegin("updateTimeInSec", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.UpdateTimeInSec); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *CaseDataDetail) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaIncompatible() { - if err = oprot.WriteFieldBegin("schemaIncompatible", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.SchemaIncompatible); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *CaseDataDetail) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetUpdater() { - if err = oprot.WriteFieldBegin("updater", thrift.STRUCT, 6); err != nil { - goto WriteFieldBeginError - } - if err := p.Updater.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *CaseDataDetail) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CaseDataDetail(%+v)", *p) - -} diff --git a/backend/api/model/knowledge/document/kdocument.go b/backend/api/model/knowledge/document/kdocument.go deleted file mode 100644 index 7de749f2..00000000 --- a/backend/api/model/knowledge/document/kdocument.go +++ /dev/null @@ -1,1308 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package document - -import ( - "fmt" - "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/common" -) - -// Get table structure, preview data -type GetDocumentTableInfoRequest struct { - // If the table is uploaded for the first local file, pass the value - TosURI *string `thrift:"tos_uri,2,optional" form:"tos_uri" json:"tos_uri,omitempty" query:"tos_uri"` - // If it is a document with an existing table, pass the value - DocumentID *int64 `thrift:"document_id,3,optional" form:"document_id" json:"document_id,string,omitempty"` - // Creator [http interface does not need to be passed] - CreatorID int64 `thrift:"creator_id,4" form:"creator_id" json:"creator_id" query:"creator_id"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewGetDocumentTableInfoRequest() *GetDocumentTableInfoRequest { - return &GetDocumentTableInfoRequest{} -} - -func (p *GetDocumentTableInfoRequest) InitDefault() { -} - -var GetDocumentTableInfoRequest_TosURI_DEFAULT string - -func (p *GetDocumentTableInfoRequest) GetTosURI() (v string) { - if !p.IsSetTosURI() { - return GetDocumentTableInfoRequest_TosURI_DEFAULT - } - return *p.TosURI -} - -var GetDocumentTableInfoRequest_DocumentID_DEFAULT int64 - -func (p *GetDocumentTableInfoRequest) GetDocumentID() (v int64) { - if !p.IsSetDocumentID() { - return GetDocumentTableInfoRequest_DocumentID_DEFAULT - } - return *p.DocumentID -} - -func (p *GetDocumentTableInfoRequest) GetCreatorID() (v int64) { - return p.CreatorID -} - -var GetDocumentTableInfoRequest_Base_DEFAULT *base.Base - -func (p *GetDocumentTableInfoRequest) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return GetDocumentTableInfoRequest_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_GetDocumentTableInfoRequest = map[int16]string{ - 2: "tos_uri", - 3: "document_id", - 4: "creator_id", - 255: "Base", -} - -func (p *GetDocumentTableInfoRequest) IsSetTosURI() bool { - return p.TosURI != nil -} - -func (p *GetDocumentTableInfoRequest) IsSetDocumentID() bool { - return p.DocumentID != nil -} - -func (p *GetDocumentTableInfoRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *GetDocumentTableInfoRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDocumentTableInfoRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *GetDocumentTableInfoRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.TosURI = _field - return nil -} -func (p *GetDocumentTableInfoRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.DocumentID = _field - return nil -} -func (p *GetDocumentTableInfoRequest) ReadField4(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.CreatorID = _field - return nil -} -func (p *GetDocumentTableInfoRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *GetDocumentTableInfoRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDocumentTableInfoRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetDocumentTableInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetTosURI() { - if err = oprot.WriteFieldBegin("tos_uri", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.TosURI); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetDocumentTableInfoRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDocumentID() { - if err = oprot.WriteFieldBegin("document_id", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.DocumentID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *GetDocumentTableInfoRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("creator_id", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.CreatorID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *GetDocumentTableInfoRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetDocumentTableInfoRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetDocumentTableInfoRequest(%+v)", *p) - -} - -type GetDocumentTableInfoResponse struct { - Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - SheetList []*common.DocTableSheet `thrift:"sheet_list,3" form:"sheet_list" json:"sheet_list" query:"sheet_list"` - // key: sheet_id -> list - TableMeta map[string][]*common.DocTableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta"` - // key: sheet_id -> list_preview_data - PreviewData map[string][]map[string]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"-" json:"-" query:"-"` -} - -func NewGetDocumentTableInfoResponse() *GetDocumentTableInfoResponse { - return &GetDocumentTableInfoResponse{} -} - -func (p *GetDocumentTableInfoResponse) InitDefault() { -} - -func (p *GetDocumentTableInfoResponse) GetCode() (v int32) { - return p.Code -} - -func (p *GetDocumentTableInfoResponse) GetMsg() (v string) { - return p.Msg -} - -func (p *GetDocumentTableInfoResponse) GetSheetList() (v []*common.DocTableSheet) { - return p.SheetList -} - -func (p *GetDocumentTableInfoResponse) GetTableMeta() (v map[string][]*common.DocTableColumn) { - return p.TableMeta -} - -func (p *GetDocumentTableInfoResponse) GetPreviewData() (v map[string][]map[string]string) { - return p.PreviewData -} - -var GetDocumentTableInfoResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *GetDocumentTableInfoResponse) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return GetDocumentTableInfoResponse_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_GetDocumentTableInfoResponse = map[int16]string{ - 1: "code", - 2: "msg", - 3: "sheet_list", - 4: "table_meta", - 5: "preview_data", - 255: "BaseResp", -} - -func (p *GetDocumentTableInfoResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *GetDocumentTableInfoResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetBaseResp bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.MAP { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.MAP { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - issetBaseResp = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetBaseResp { - fieldId = 255 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDocumentTableInfoResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetDocumentTableInfoResponse[fieldId])) -} - -func (p *GetDocumentTableInfoResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *GetDocumentTableInfoResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *GetDocumentTableInfoResponse) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*common.DocTableSheet, 0, size) - values := make([]common.DocTableSheet, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.SheetList = _field - return nil -} -func (p *GetDocumentTableInfoResponse) ReadField4(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string][]*common.DocTableColumn, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _val := make([]*common.DocTableColumn, 0, size) - values := make([]common.DocTableColumn, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _val = append(_val, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.TableMeta = _field - return nil -} -func (p *GetDocumentTableInfoResponse) ReadField5(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string][]map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _val := make([]map[string]string, 0, size) - for i := 0; i < size; i++ { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _elem := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key1 string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key1 = v - } - - var _val1 string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val1 = v - } - - _elem[_key1] = _val1 - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - - _val = append(_val, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.PreviewData = _field - return nil -} -func (p *GetDocumentTableInfoResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *GetDocumentTableInfoResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDocumentTableInfoResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetDocumentTableInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetDocumentTableInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetDocumentTableInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sheet_list", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SheetList)); err != nil { - return err - } - for _, v := range p.SheetList { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *GetDocumentTableInfoResponse) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("table_meta", thrift.MAP, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.TableMeta)); err != nil { - return err - } - for k, v := range p.TableMeta { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { - return err - } - for _, v := range v { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *GetDocumentTableInfoResponse) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("preview_data", thrift.MAP, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.PreviewData)); err != nil { - return err - } - for k, v := range p.PreviewData { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteListBegin(thrift.MAP, len(v)); err != nil { - return err - } - for _, v := range v { - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil { - return err - } - for k, v := range v { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *GetDocumentTableInfoResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetDocumentTableInfoResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetDocumentTableInfoResponse(%+v)", *p) - -} - -type GetTableSchemaInfoResponse struct { - Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - SheetList []*common.DocTableSheet `thrift:"sheet_list,3" form:"sheet_list" json:"sheet_list" query:"sheet_list"` - // The schema of the selected sheet, not selected to return the first sheet by default - TableMeta []*common.DocTableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta" query:"table_meta"` - // The knowledge table will return - PreviewData []map[int64]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data" query:"preview_data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"-" json:"-" query:"-"` -} - -func NewGetTableSchemaInfoResponse() *GetTableSchemaInfoResponse { - return &GetTableSchemaInfoResponse{} -} - -func (p *GetTableSchemaInfoResponse) InitDefault() { -} - -func (p *GetTableSchemaInfoResponse) GetCode() (v int32) { - return p.Code -} - -func (p *GetTableSchemaInfoResponse) GetMsg() (v string) { - return p.Msg -} - -func (p *GetTableSchemaInfoResponse) GetSheetList() (v []*common.DocTableSheet) { - return p.SheetList -} - -func (p *GetTableSchemaInfoResponse) GetTableMeta() (v []*common.DocTableColumn) { - return p.TableMeta -} - -func (p *GetTableSchemaInfoResponse) GetPreviewData() (v []map[int64]string) { - return p.PreviewData -} - -var GetTableSchemaInfoResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *GetTableSchemaInfoResponse) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return GetTableSchemaInfoResponse_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_GetTableSchemaInfoResponse = map[int16]string{ - 1: "code", - 2: "msg", - 3: "sheet_list", - 4: "table_meta", - 5: "preview_data", - 255: "BaseResp", -} - -func (p *GetTableSchemaInfoResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *GetTableSchemaInfoResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.LIST { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.LIST { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTableSchemaInfoResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *GetTableSchemaInfoResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *GetTableSchemaInfoResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *GetTableSchemaInfoResponse) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*common.DocTableSheet, 0, size) - values := make([]common.DocTableSheet, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.SheetList = _field - return nil -} -func (p *GetTableSchemaInfoResponse) ReadField4(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*common.DocTableColumn, 0, size) - values := make([]common.DocTableColumn, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.TableMeta = _field - return nil -} -func (p *GetTableSchemaInfoResponse) ReadField5(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]map[int64]string, 0, size) - for i := 0; i < size; i++ { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _elem := make(map[int64]string, size) - for i := 0; i < size; i++ { - var _key int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _elem[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.PreviewData = _field - return nil -} -func (p *GetTableSchemaInfoResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *GetTableSchemaInfoResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetTableSchemaInfoResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetTableSchemaInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetTableSchemaInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetTableSchemaInfoResponse) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sheet_list", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SheetList)); err != nil { - return err - } - for _, v := range p.SheetList { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *GetTableSchemaInfoResponse) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("table_meta", thrift.LIST, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableMeta)); err != nil { - return err - } - for _, v := range p.TableMeta { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *GetTableSchemaInfoResponse) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("preview_data", thrift.LIST, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.MAP, len(p.PreviewData)); err != nil { - return err - } - for _, v := range p.PreviewData { - if err := oprot.WriteMapBegin(thrift.I64, thrift.STRING, len(v)); err != nil { - return err - } - for k, v := range v { - if err := oprot.WriteI64(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *GetTableSchemaInfoResponse) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBaseResp() { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *GetTableSchemaInfoResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetTableSchemaInfoResponse(%+v)", *p) - -} diff --git a/backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go b/backend/api/model/marketplace/marketplace_common/marketplace_common.go similarity index 100% rename from backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go rename to backend/api/model/marketplace/marketplace_common/marketplace_common.go diff --git a/backend/api/model/flow/marketplace/product_common/product_common.go b/backend/api/model/marketplace/product_common/product_common.go similarity index 99% rename from backend/api/model/flow/marketplace/product_common/product_common.go rename to backend/api/model/marketplace/product_common/product_common.go index f051ef38..88e62987 100644 --- a/backend/api/model/flow/marketplace/product_common/product_common.go +++ b/backend/api/model/marketplace/product_common/product_common.go @@ -7,7 +7,7 @@ import ( "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common" ) type ProductEntityType int64 diff --git a/backend/api/model/flow/marketplace/product_public_api/public_api.go b/backend/api/model/marketplace/product_public_api/public_api.go similarity index 99% rename from backend/api/model/flow/marketplace/product_public_api/public_api.go rename to backend/api/model/marketplace/product_public_api/public_api.go index 426797b9..c17d3601 100644 --- a/backend/api/model/flow/marketplace/product_public_api/public_api.go +++ b/backend/api/model/marketplace/product_public_api/public_api.go @@ -9,8 +9,8 @@ import ( "fmt" "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common" ) type PluginAuthMode int64 diff --git a/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go b/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go deleted file mode 100644 index 3d43bf92..00000000 --- a/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go +++ /dev/null @@ -1,768 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package bot_open_api - -import ( - "context" - "fmt" - "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-studio/backend/api/model/base" -) - -type OauthAuthorizationCodeReq struct { - Code string `thrift:"code,1" json:"code" query:"code"` - State string `thrift:"state,2" json:"state" query:"state"` -} - -func NewOauthAuthorizationCodeReq() *OauthAuthorizationCodeReq { - return &OauthAuthorizationCodeReq{} -} - -func (p *OauthAuthorizationCodeReq) InitDefault() { -} - -func (p *OauthAuthorizationCodeReq) GetCode() (v string) { - return p.Code -} - -func (p *OauthAuthorizationCodeReq) GetState() (v string) { - return p.State -} - -var fieldIDToName_OauthAuthorizationCodeReq = map[int16]string{ - 1: "code", - 2: "state", -} - -func (p *OauthAuthorizationCodeReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *OauthAuthorizationCodeReq) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *OauthAuthorizationCodeReq) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.State = _field - return nil -} - -func (p *OauthAuthorizationCodeReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("OauthAuthorizationCodeReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *OauthAuthorizationCodeReq) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *OauthAuthorizationCodeReq) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("state", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.State); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *OauthAuthorizationCodeReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("OauthAuthorizationCodeReq(%+v)", *p) - -} - -type OauthAuthorizationCodeResp struct { - BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` -} - -func NewOauthAuthorizationCodeResp() *OauthAuthorizationCodeResp { - return &OauthAuthorizationCodeResp{} -} - -func (p *OauthAuthorizationCodeResp) InitDefault() { -} - -var OauthAuthorizationCodeResp_BaseResp_DEFAULT *base.BaseResp - -func (p *OauthAuthorizationCodeResp) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return OauthAuthorizationCodeResp_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_OauthAuthorizationCodeResp = map[int16]string{ - 255: "BaseResp", -} - -func (p *OauthAuthorizationCodeResp) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *OauthAuthorizationCodeResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetBaseResp bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - issetBaseResp = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetBaseResp { - fieldId = 255 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_OauthAuthorizationCodeResp[fieldId])) -} - -func (p *OauthAuthorizationCodeResp) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *OauthAuthorizationCodeResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("OauthAuthorizationCodeResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *OauthAuthorizationCodeResp) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *OauthAuthorizationCodeResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("OauthAuthorizationCodeResp(%+v)", *p) - -} - -type BotOpenApiService interface { - OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error) -} - -type BotOpenApiServiceClient struct { - c thrift.TClient -} - -func NewBotOpenApiServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *BotOpenApiServiceClient { - return &BotOpenApiServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewBotOpenApiServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BotOpenApiServiceClient { - return &BotOpenApiServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewBotOpenApiServiceClient(c thrift.TClient) *BotOpenApiServiceClient { - return &BotOpenApiServiceClient{ - c: c, - } -} - -func (p *BotOpenApiServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *BotOpenApiServiceClient) OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error) { - var _args BotOpenApiServiceOauthAuthorizationCodeArgs - _args.Request = request - var _result BotOpenApiServiceOauthAuthorizationCodeResult - if err = p.Client_().Call(ctx, "OauthAuthorizationCode", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -type BotOpenApiServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler BotOpenApiService -} - -func (p *BotOpenApiServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *BotOpenApiServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *BotOpenApiServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewBotOpenApiServiceProcessor(handler BotOpenApiService) *BotOpenApiServiceProcessor { - self := &BotOpenApiServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("OauthAuthorizationCode", &botOpenApiServiceProcessorOauthAuthorizationCode{handler: handler}) - return self -} -func (p *BotOpenApiServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x -} - -type botOpenApiServiceProcessorOauthAuthorizationCode struct { - handler BotOpenApiService -} - -func (p *botOpenApiServiceProcessorOauthAuthorizationCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := BotOpenApiServiceOauthAuthorizationCodeArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := BotOpenApiServiceOauthAuthorizationCodeResult{} - var retval *OauthAuthorizationCodeResp - if retval, err2 = p.handler.OauthAuthorizationCode(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OauthAuthorizationCode: "+err2.Error()) - oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type BotOpenApiServiceOauthAuthorizationCodeArgs struct { - Request *OauthAuthorizationCodeReq `thrift:"request,1"` -} - -func NewBotOpenApiServiceOauthAuthorizationCodeArgs() *BotOpenApiServiceOauthAuthorizationCodeArgs { - return &BotOpenApiServiceOauthAuthorizationCodeArgs{} -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) InitDefault() { -} - -var BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT *OauthAuthorizationCodeReq - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) GetRequest() (v *OauthAuthorizationCodeReq) { - if !p.IsSetRequest() { - return BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT - } - return p.Request -} - -var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs = map[int16]string{ - 1: "request", -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewOauthAuthorizationCodeReq() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("OauthAuthorizationCode_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeArgs(%+v)", *p) - -} - -type BotOpenApiServiceOauthAuthorizationCodeResult struct { - Success *OauthAuthorizationCodeResp `thrift:"success,0,optional"` -} - -func NewBotOpenApiServiceOauthAuthorizationCodeResult() *BotOpenApiServiceOauthAuthorizationCodeResult { - return &BotOpenApiServiceOauthAuthorizationCodeResult{} -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) InitDefault() { -} - -var BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT *OauthAuthorizationCodeResp - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) GetSuccess() (v *OauthAuthorizationCodeResp) { - if !p.IsSetSuccess() { - return BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult = map[int16]string{ - 0: "success", -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewOauthAuthorizationCodeResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("OauthAuthorizationCode_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *BotOpenApiServiceOauthAuthorizationCodeResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeResult(%+v)", *p) - -} diff --git a/backend/api/model/ocean/cloud/playground/playground.go b/backend/api/model/playground/playground.go similarity index 92% rename from backend/api/model/ocean/cloud/playground/playground.go rename to backend/api/model/playground/playground.go index 39919875..b28e04c0 100644 --- a/backend/api/model/ocean/cloud/playground/playground.go +++ b/backend/api/model/playground/playground.go @@ -8,8 +8,8 @@ import ( "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" ) // branch @@ -15881,561 +15881,6 @@ func (p *GetFileUrlsResponse) String() string { } -type UploadFileOpenRequest struct { - // file type - ContentType string `thrift:"ContentType,1,required" header:"Content-Type,required" json:"ContentType,required"` - // binary data - Data []byte `thrift:"Data,2,required" json:"Data,required" raw_body:",required"` - Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` -} - -func NewUploadFileOpenRequest() *UploadFileOpenRequest { - return &UploadFileOpenRequest{} -} - -func (p *UploadFileOpenRequest) InitDefault() { -} - -func (p *UploadFileOpenRequest) GetContentType() (v string) { - return p.ContentType -} - -func (p *UploadFileOpenRequest) GetData() (v []byte) { - return p.Data -} - -var UploadFileOpenRequest_Base_DEFAULT *base.Base - -func (p *UploadFileOpenRequest) GetBase() (v *base.Base) { - if !p.IsSetBase() { - return UploadFileOpenRequest_Base_DEFAULT - } - return p.Base -} - -var fieldIDToName_UploadFileOpenRequest = map[int16]string{ - 1: "ContentType", - 2: "Data", - 255: "Base", -} - -func (p *UploadFileOpenRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *UploadFileOpenRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetContentType bool = false - var issetData bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetContentType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetData = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetContentType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetData { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadFileOpenRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadFileOpenRequest[fieldId])) -} - -func (p *UploadFileOpenRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.ContentType = _field - return nil -} -func (p *UploadFileOpenRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { - return err - } else { - _field = []byte(v) - } - p.Data = _field - return nil -} -func (p *UploadFileOpenRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *UploadFileOpenRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("UploadFileOpenRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *UploadFileOpenRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("ContentType", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.ContentType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *UploadFileOpenRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("Data", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.Data)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *UploadFileOpenRequest) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *UploadFileOpenRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadFileOpenRequest(%+v)", *p) - -} - -type UploadFileOpenResponse struct { - File *File `thrift:"File,1,optional" form:"data" json:"data,omitempty"` - Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"` - Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"` - BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` -} - -func NewUploadFileOpenResponse() *UploadFileOpenResponse { - return &UploadFileOpenResponse{} -} - -func (p *UploadFileOpenResponse) InitDefault() { -} - -var UploadFileOpenResponse_File_DEFAULT *File - -func (p *UploadFileOpenResponse) GetFile() (v *File) { - if !p.IsSetFile() { - return UploadFileOpenResponse_File_DEFAULT - } - return p.File -} - -func (p *UploadFileOpenResponse) GetCode() (v int64) { - return p.Code -} - -func (p *UploadFileOpenResponse) GetMsg() (v string) { - return p.Msg -} - -var UploadFileOpenResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *UploadFileOpenResponse) GetBaseResp() (v *base.BaseResp) { - if !p.IsSetBaseResp() { - return UploadFileOpenResponse_BaseResp_DEFAULT - } - return p.BaseResp -} - -var fieldIDToName_UploadFileOpenResponse = map[int16]string{ - 1: "File", - 253: "code", - 254: "msg", - 255: "BaseResp", -} - -func (p *UploadFileOpenResponse) IsSetFile() bool { - return p.File != nil -} - -func (p *UploadFileOpenResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *UploadFileOpenResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetCode bool = false - var issetMsg bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 253: - if fieldTypeId == thrift.I64 { - if err = p.ReadField253(iprot); err != nil { - goto ReadFieldError - } - issetCode = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 254: - if fieldTypeId == thrift.STRING { - if err = p.ReadField254(iprot); err != nil { - goto ReadFieldError - } - issetMsg = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetCode { - fieldId = 253 - goto RequiredFieldNotSetError - } - - if !issetMsg { - fieldId = 254 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadFileOpenResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadFileOpenResponse[fieldId])) -} - -func (p *UploadFileOpenResponse) ReadField1(iprot thrift.TProtocol) error { - _field := NewFile() - if err := _field.Read(iprot); err != nil { - return err - } - p.File = _field - return nil -} -func (p *UploadFileOpenResponse) ReadField253(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *UploadFileOpenResponse) ReadField254(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *UploadFileOpenResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *UploadFileOpenResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("UploadFileOpenResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField253(oprot); err != nil { - fieldId = 253 - goto WriteFieldError - } - if err = p.writeField254(oprot); err != nil { - fieldId = 254 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *UploadFileOpenResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetFile() { - if err = oprot.WriteFieldBegin("File", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.File.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *UploadFileOpenResponse) writeField253(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I64, 253); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err) -} -func (p *UploadFileOpenResponse) writeField254(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err) -} -func (p *UploadFileOpenResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *UploadFileOpenResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadFileOpenResponse(%+v)", *p) - -} - type File struct { // File URI URI string `thrift:"URI,1" form:"uri" json:"uri"` @@ -16759,526 +16204,6 @@ func (p *File) String() string { } -type GetBotOnlineInfoReq struct { - // botId - BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` - // Keep it first, don't expose it, and don't use the field - ConnectorID *string `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // bot version, get the latest version if you don't pass it on. - Version *string `thrift:"version,3,optional" form:"version" json:"version,omitempty" query:"version"` -} - -func NewGetBotOnlineInfoReq() *GetBotOnlineInfoReq { - return &GetBotOnlineInfoReq{} -} - -func (p *GetBotOnlineInfoReq) InitDefault() { -} - -func (p *GetBotOnlineInfoReq) GetBotID() (v int64) { - return p.BotID -} - -var GetBotOnlineInfoReq_ConnectorID_DEFAULT string - -func (p *GetBotOnlineInfoReq) GetConnectorID() (v string) { - if !p.IsSetConnectorID() { - return GetBotOnlineInfoReq_ConnectorID_DEFAULT - } - return *p.ConnectorID -} - -var GetBotOnlineInfoReq_Version_DEFAULT string - -func (p *GetBotOnlineInfoReq) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetBotOnlineInfoReq_Version_DEFAULT - } - return *p.Version -} - -var fieldIDToName_GetBotOnlineInfoReq = map[int16]string{ - 1: "bot_id", - 2: "connector_id", - 3: "version", -} - -func (p *GetBotOnlineInfoReq) IsSetConnectorID() bool { - return p.ConnectorID != nil -} - -func (p *GetBotOnlineInfoReq) IsSetVersion() bool { - return p.Version != nil -} - -func (p *GetBotOnlineInfoReq) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetBotID bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetBotID = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetBotID { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBotOnlineInfoReq[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetBotOnlineInfoReq[fieldId])) -} - -func (p *GetBotOnlineInfoReq) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.BotID = _field - return nil -} -func (p *GetBotOnlineInfoReq) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ConnectorID = _field - return nil -} -func (p *GetBotOnlineInfoReq) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Version = _field - return nil -} - -func (p *GetBotOnlineInfoReq) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetBotOnlineInfoReq"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetBotOnlineInfoReq) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.BotID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetBotOnlineInfoReq) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetConnectorID() { - if err = oprot.WriteFieldBegin("connector_id", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ConnectorID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetBotOnlineInfoReq) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetVersion() { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Version); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *GetBotOnlineInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetBotOnlineInfoReq(%+v)", *p) - -} - -// resp -type GetBotOnlineInfoResp struct { - Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` - Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` - Data *bot_common.OpenAPIBotInfo `thrift:"data,3,required" form:"data,required" json:"data,required" query:"data,required"` -} - -func NewGetBotOnlineInfoResp() *GetBotOnlineInfoResp { - return &GetBotOnlineInfoResp{} -} - -func (p *GetBotOnlineInfoResp) InitDefault() { -} - -func (p *GetBotOnlineInfoResp) GetCode() (v int32) { - return p.Code -} - -func (p *GetBotOnlineInfoResp) GetMsg() (v string) { - return p.Msg -} - -var GetBotOnlineInfoResp_Data_DEFAULT *bot_common.OpenAPIBotInfo - -func (p *GetBotOnlineInfoResp) GetData() (v *bot_common.OpenAPIBotInfo) { - if !p.IsSetData() { - return GetBotOnlineInfoResp_Data_DEFAULT - } - return p.Data -} - -var fieldIDToName_GetBotOnlineInfoResp = map[int16]string{ - 1: "code", - 2: "msg", - 3: "data", -} - -func (p *GetBotOnlineInfoResp) IsSetData() bool { - return p.Data != nil -} - -func (p *GetBotOnlineInfoResp) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - var issetCode bool = false - var issetMsg bool = false - var issetData bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetCode = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetMsg = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetData = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetCode { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetMsg { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetData { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBotOnlineInfoResp[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetBotOnlineInfoResp[fieldId])) -} - -func (p *GetBotOnlineInfoResp) ReadField1(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *GetBotOnlineInfoResp) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Msg = _field - return nil -} -func (p *GetBotOnlineInfoResp) ReadField3(iprot thrift.TProtocol) error { - _field := bot_common.NewOpenAPIBotInfo() - if err := _field.Read(iprot); err != nil { - return err - } - p.Data = _field - return nil -} - -func (p *GetBotOnlineInfoResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetBotOnlineInfoResp"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *GetBotOnlineInfoResp) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.Code); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *GetBotOnlineInfoResp) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Msg); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *GetBotOnlineInfoResp) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.Data.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *GetBotOnlineInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetBotOnlineInfoResp(%+v)", *p) - -} - type PlaygroundService interface { UpdateDraftBotInfoAgw(ctx context.Context, request *UpdateDraftBotInfoAgwRequest) (r *UpdateDraftBotInfoAgwResponse, err error) @@ -17307,10 +16232,6 @@ type PlaygroundService interface { GetSpaceListV2(ctx context.Context, request *GetSpaceListV2Request) (r *GetSpaceListV2Response, err error) MGetUserBasicInfo(ctx context.Context, request *MGetUserBasicInfoRequest) (r *MGetUserBasicInfoResponse, err error) - //openapi - GetBotOnlineInfo(ctx context.Context, request *GetBotOnlineInfoReq) (r *GetBotOnlineInfoResp, err error) - // File related OpenAPI - UploadFileOpen(ctx context.Context, request *UploadFileOpenRequest) (r *UploadFileOpenResponse, err error) } type PlaygroundServiceClient struct { @@ -17465,24 +16386,6 @@ func (p *PlaygroundServiceClient) MGetUserBasicInfo(ctx context.Context, request } return _result.GetSuccess(), nil } -func (p *PlaygroundServiceClient) GetBotOnlineInfo(ctx context.Context, request *GetBotOnlineInfoReq) (r *GetBotOnlineInfoResp, err error) { - var _args PlaygroundServiceGetBotOnlineInfoArgs - _args.Request = request - var _result PlaygroundServiceGetBotOnlineInfoResult - if err = p.Client_().Call(ctx, "GetBotOnlineInfo", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *PlaygroundServiceClient) UploadFileOpen(ctx context.Context, request *UploadFileOpenRequest) (r *UploadFileOpenResponse, err error) { - var _args PlaygroundServiceUploadFileOpenArgs - _args.Request = request - var _result PlaygroundServiceUploadFileOpenResult - if err = p.Client_().Call(ctx, "UploadFileOpen", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} type PlaygroundServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction @@ -17518,8 +16421,6 @@ func NewPlaygroundServiceProcessor(handler PlaygroundService) *PlaygroundService self.AddToProcessorMap("DeletePromptResource", &playgroundServiceProcessorDeletePromptResource{handler: handler}) self.AddToProcessorMap("GetSpaceListV2", &playgroundServiceProcessorGetSpaceListV2{handler: handler}) self.AddToProcessorMap("MGetUserBasicInfo", &playgroundServiceProcessorMGetUserBasicInfo{handler: handler}) - self.AddToProcessorMap("GetBotOnlineInfo", &playgroundServiceProcessorGetBotOnlineInfo{handler: handler}) - self.AddToProcessorMap("UploadFileOpen", &playgroundServiceProcessorUploadFileOpen{handler: handler}) return self } func (p *PlaygroundServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -18212,102 +17113,6 @@ func (p *playgroundServiceProcessorMGetUserBasicInfo) Process(ctx context.Contex return true, err } -type playgroundServiceProcessorGetBotOnlineInfo struct { - handler PlaygroundService -} - -func (p *playgroundServiceProcessorGetBotOnlineInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PlaygroundServiceGetBotOnlineInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := PlaygroundServiceGetBotOnlineInfoResult{} - var retval *GetBotOnlineInfoResp - if retval, err2 = p.handler.GetBotOnlineInfo(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetBotOnlineInfo: "+err2.Error()) - oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetBotOnlineInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type playgroundServiceProcessorUploadFileOpen struct { - handler PlaygroundService -} - -func (p *playgroundServiceProcessorUploadFileOpen) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PlaygroundServiceUploadFileOpenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UploadFileOpen", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := PlaygroundServiceUploadFileOpenResult{} - var retval *UploadFileOpenResponse - if retval, err2 = p.handler.UploadFileOpen(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadFileOpen: "+err2.Error()) - oprot.WriteMessageBegin("UploadFileOpen", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("UploadFileOpen", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - type PlaygroundServiceUpdateDraftBotInfoAgwArgs struct { Request *UpdateDraftBotInfoAgwRequest `thrift:"request,1"` } @@ -22395,587 +21200,3 @@ func (p *PlaygroundServiceMGetUserBasicInfoResult) String() string { return fmt.Sprintf("PlaygroundServiceMGetUserBasicInfoResult(%+v)", *p) } - -type PlaygroundServiceGetBotOnlineInfoArgs struct { - Request *GetBotOnlineInfoReq `thrift:"request,1"` -} - -func NewPlaygroundServiceGetBotOnlineInfoArgs() *PlaygroundServiceGetBotOnlineInfoArgs { - return &PlaygroundServiceGetBotOnlineInfoArgs{} -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) InitDefault() { -} - -var PlaygroundServiceGetBotOnlineInfoArgs_Request_DEFAULT *GetBotOnlineInfoReq - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) GetRequest() (v *GetBotOnlineInfoReq) { - if !p.IsSetRequest() { - return PlaygroundServiceGetBotOnlineInfoArgs_Request_DEFAULT - } - return p.Request -} - -var fieldIDToName_PlaygroundServiceGetBotOnlineInfoArgs = map[int16]string{ - 1: "request", -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PlaygroundServiceGetBotOnlineInfoArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetBotOnlineInfoReq() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetBotOnlineInfo_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PlaygroundServiceGetBotOnlineInfoArgs(%+v)", *p) - -} - -type PlaygroundServiceGetBotOnlineInfoResult struct { - Success *GetBotOnlineInfoResp `thrift:"success,0,optional"` -} - -func NewPlaygroundServiceGetBotOnlineInfoResult() *PlaygroundServiceGetBotOnlineInfoResult { - return &PlaygroundServiceGetBotOnlineInfoResult{} -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) InitDefault() { -} - -var PlaygroundServiceGetBotOnlineInfoResult_Success_DEFAULT *GetBotOnlineInfoResp - -func (p *PlaygroundServiceGetBotOnlineInfoResult) GetSuccess() (v *GetBotOnlineInfoResp) { - if !p.IsSetSuccess() { - return PlaygroundServiceGetBotOnlineInfoResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_PlaygroundServiceGetBotOnlineInfoResult = map[int16]string{ - 0: "success", -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PlaygroundServiceGetBotOnlineInfoResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetBotOnlineInfoResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetBotOnlineInfo_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *PlaygroundServiceGetBotOnlineInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PlaygroundServiceGetBotOnlineInfoResult(%+v)", *p) - -} - -type PlaygroundServiceUploadFileOpenArgs struct { - Request *UploadFileOpenRequest `thrift:"request,1"` -} - -func NewPlaygroundServiceUploadFileOpenArgs() *PlaygroundServiceUploadFileOpenArgs { - return &PlaygroundServiceUploadFileOpenArgs{} -} - -func (p *PlaygroundServiceUploadFileOpenArgs) InitDefault() { -} - -var PlaygroundServiceUploadFileOpenArgs_Request_DEFAULT *UploadFileOpenRequest - -func (p *PlaygroundServiceUploadFileOpenArgs) GetRequest() (v *UploadFileOpenRequest) { - if !p.IsSetRequest() { - return PlaygroundServiceUploadFileOpenArgs_Request_DEFAULT - } - return p.Request -} - -var fieldIDToName_PlaygroundServiceUploadFileOpenArgs = map[int16]string{ - 1: "request", -} - -func (p *PlaygroundServiceUploadFileOpenArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *PlaygroundServiceUploadFileOpenArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PlaygroundServiceUploadFileOpenArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewUploadFileOpenRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil -} - -func (p *PlaygroundServiceUploadFileOpenArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("UploadFileOpen_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PlaygroundServiceUploadFileOpenArgs(%+v)", *p) - -} - -type PlaygroundServiceUploadFileOpenResult struct { - Success *UploadFileOpenResponse `thrift:"success,0,optional"` -} - -func NewPlaygroundServiceUploadFileOpenResult() *PlaygroundServiceUploadFileOpenResult { - return &PlaygroundServiceUploadFileOpenResult{} -} - -func (p *PlaygroundServiceUploadFileOpenResult) InitDefault() { -} - -var PlaygroundServiceUploadFileOpenResult_Success_DEFAULT *UploadFileOpenResponse - -func (p *PlaygroundServiceUploadFileOpenResult) GetSuccess() (v *UploadFileOpenResponse) { - if !p.IsSetSuccess() { - return PlaygroundServiceUploadFileOpenResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_PlaygroundServiceUploadFileOpenResult = map[int16]string{ - 0: "success", -} - -func (p *PlaygroundServiceUploadFileOpenResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *PlaygroundServiceUploadFileOpenResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PlaygroundServiceUploadFileOpenResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewUploadFileOpenResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *PlaygroundServiceUploadFileOpenResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("UploadFileOpen_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *PlaygroundServiceUploadFileOpenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PlaygroundServiceUploadFileOpenResult(%+v)", *p) - -} diff --git a/backend/api/model/ocean/cloud/playground/prompt_resource.go b/backend/api/model/playground/prompt_resource.go similarity index 100% rename from backend/api/model/ocean/cloud/playground/prompt_resource.go rename to backend/api/model/playground/prompt_resource.go diff --git a/backend/api/model/ocean/cloud/playground/shortcut_command.go b/backend/api/model/playground/shortcut_command.go similarity index 100% rename from backend/api/model/ocean/cloud/playground/shortcut_command.go rename to backend/api/model/playground/shortcut_command.go diff --git a/backend/api/model/plugin_develop_common/plugin_develop_common.go b/backend/api/model/plugin_develop/common/plugin_develop_common.go similarity index 99% rename from backend/api/model/plugin_develop_common/plugin_develop_common.go rename to backend/api/model/plugin_develop/common/plugin_develop_common.go index 13cb180a..7ded2259 100644 --- a/backend/api/model/plugin_develop_common/plugin_develop_common.go +++ b/backend/api/model/plugin_develop/common/plugin_develop_common.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.4.1). DO NOT EDIT. -package plugin_develop_common +package common import ( "database/sql" diff --git a/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go b/backend/api/model/plugin_develop/plugin_develop.go similarity index 96% rename from backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go rename to backend/api/model/plugin_develop/plugin_develop.go index 1f89819f..2a6aa38f 100644 --- a/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go +++ b/backend/api/model/plugin_develop/plugin_develop.go @@ -7,7 +7,7 @@ import ( "fmt" "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" ) type GetPlaygroundPluginListRequest struct { @@ -792,10 +792,10 @@ func (p *GetPlaygroundPluginListRequest) String() string { } type GetPlaygroundPluginListResponse struct { - Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` - Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` - Data *plugin_develop_common.GetPlaygroundPluginListData `thrift:"data,3" form:"data" json:"data" query:"data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` + Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` + Data *common.GetPlaygroundPluginListData `thrift:"data,3" form:"data" json:"data" query:"data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewGetPlaygroundPluginListResponse() *GetPlaygroundPluginListResponse { @@ -813,9 +813,9 @@ func (p *GetPlaygroundPluginListResponse) GetMsg() (v string) { return p.Msg } -var GetPlaygroundPluginListResponse_Data_DEFAULT *plugin_develop_common.GetPlaygroundPluginListData +var GetPlaygroundPluginListResponse_Data_DEFAULT *common.GetPlaygroundPluginListData -func (p *GetPlaygroundPluginListResponse) GetData() (v *plugin_develop_common.GetPlaygroundPluginListData) { +func (p *GetPlaygroundPluginListResponse) GetData() (v *common.GetPlaygroundPluginListData) { if !p.IsSetData() { return GetPlaygroundPluginListResponse_Data_DEFAULT } @@ -963,7 +963,7 @@ func (p *GetPlaygroundPluginListResponse) ReadField2(iprot thrift.TProtocol) err return nil } func (p *GetPlaygroundPluginListResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewGetPlaygroundPluginListData() + _field := common.NewGetPlaygroundPluginListData() if err := _field.Read(iprot); err != nil { return err } @@ -1104,7 +1104,7 @@ type GetPluginAPIsRequest struct { // page size Size int32 `thrift:"size,4" form:"size" json:"size" query:"size"` // ignore - Order *plugin_develop_common.APIListOrder `thrift:"order,5" form:"order" json:"order" query:"order"` + Order *common.APIListOrder `thrift:"order,5" form:"order" json:"order" query:"order"` // ignore PreviewVersionTs *string `thrift:"preview_version_ts,6,optional" form:"preview_version_ts" json:"preview_version_ts,omitempty" query:"preview_version_ts"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -1133,9 +1133,9 @@ func (p *GetPluginAPIsRequest) GetSize() (v int32) { return p.Size } -var GetPluginAPIsRequest_Order_DEFAULT *plugin_develop_common.APIListOrder +var GetPluginAPIsRequest_Order_DEFAULT *common.APIListOrder -func (p *GetPluginAPIsRequest) GetOrder() (v *plugin_develop_common.APIListOrder) { +func (p *GetPluginAPIsRequest) GetOrder() (v *common.APIListOrder) { if !p.IsSetOrder() { return GetPluginAPIsRequest_Order_DEFAULT } @@ -1350,7 +1350,7 @@ func (p *GetPluginAPIsRequest) ReadField4(iprot thrift.TProtocol) error { return nil } func (p *GetPluginAPIsRequest) ReadField5(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewAPIListOrder() + _field := common.NewAPIListOrder() if err := _field.Read(iprot); err != nil { return err } @@ -1563,12 +1563,12 @@ func (p *GetPluginAPIsRequest) String() string { } type GetPluginAPIsResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - APIInfo []*plugin_develop_common.PluginAPIInfo `thrift:"api_info,3" form:"api_info" json:"api_info" query:"api_info"` - Total int32 `thrift:"total,4" form:"total" json:"total" query:"total"` - EditVersion int32 `thrift:"edit_version,5" form:"edit_version" json:"edit_version" query:"edit_version"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + APIInfo []*common.PluginAPIInfo `thrift:"api_info,3" form:"api_info" json:"api_info" query:"api_info"` + Total int32 `thrift:"total,4" form:"total" json:"total" query:"total"` + EditVersion int32 `thrift:"edit_version,5" form:"edit_version" json:"edit_version" query:"edit_version"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewGetPluginAPIsResponse() *GetPluginAPIsResponse { @@ -1586,7 +1586,7 @@ func (p *GetPluginAPIsResponse) GetMsg() (v string) { return p.Msg } -func (p *GetPluginAPIsResponse) GetAPIInfo() (v []*plugin_develop_common.PluginAPIInfo) { +func (p *GetPluginAPIsResponse) GetAPIInfo() (v []*common.PluginAPIInfo) { return p.APIInfo } @@ -1742,8 +1742,8 @@ func (p *GetPluginAPIsResponse) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.PluginAPIInfo, 0, size) - values := make([]plugin_develop_common.PluginAPIInfo, size) + _field := make([]*common.PluginAPIInfo, 0, size) + values := make([]common.PluginAPIInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -2849,33 +2849,33 @@ func (p *GetPluginInfoRequest) String() string { } type GetPluginInfoResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - MetaInfo *plugin_develop_common.PluginMetaInfo `thrift:"meta_info,3" form:"meta_info" json:"meta_info" query:"meta_info"` - CodeInfo *plugin_develop_common.CodeInfo `thrift:"code_info,4" form:"code_info" json:"code_info" query:"code_info"` + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + MetaInfo *common.PluginMetaInfo `thrift:"meta_info,3" form:"meta_info" json:"meta_info" query:"meta_info"` + CodeInfo *common.CodeInfo `thrift:"code_info,4" form:"code_info" json:"code_info" query:"code_info"` // 0 No updates 1 Yes updates Not released Status bool `thrift:"status,5" form:"status" json:"status" query:"status"` // Has it been published? Published bool `thrift:"published,6" form:"published" json:"published" query:"published"` // creator information - Creator *plugin_develop_common.Creator `thrift:"creator,7" form:"creator" json:"creator" query:"creator"` + Creator *common.Creator `thrift:"creator,7" form:"creator" json:"creator" query:"creator"` // ignore - StatisticData *plugin_develop_common.PluginStatisticData `thrift:"statistic_data,8" form:"statistic_data" json:"statistic_data" query:"statistic_data"` + StatisticData *common.PluginStatisticData `thrift:"statistic_data,8" form:"statistic_data" json:"statistic_data" query:"statistic_data"` // ignore - PluginProductStatus plugin_develop_common.ProductStatus `thrift:"plugin_product_status,9" form:"plugin_product_status" json:"plugin_product_status" query:"plugin_product_status"` + PluginProductStatus common.ProductStatus `thrift:"plugin_product_status,9" form:"plugin_product_status" json:"plugin_product_status" query:"plugin_product_status"` // ignore PrivacyStatus bool `thrift:"privacy_status,10" form:"privacy_status" json:"privacy_status" query:"privacy_status"` // ignore PrivacyInfo string `thrift:"privacy_info,11" form:"privacy_info" json:"privacy_info" query:"privacy_info"` // ignore - CreationMethod plugin_develop_common.CreationMethod `thrift:"creation_method,12" form:"creation_method" json:"creation_method" query:"creation_method"` + CreationMethod common.CreationMethod `thrift:"creation_method,12" form:"creation_method" json:"creation_method" query:"creation_method"` // ignore IdeCodeRuntime string `thrift:"ide_code_runtime,13" form:"ide_code_runtime" json:"ide_code_runtime" query:"ide_code_runtime"` // ignore EditVersion int32 `thrift:"edit_version,14" form:"edit_version" json:"edit_version" query:"edit_version"` // ignore - PluginType plugin_develop_common.PluginType `thrift:"plugin_type,15" form:"plugin_type" json:"plugin_type" query:"plugin_type"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + PluginType common.PluginType `thrift:"plugin_type,15" form:"plugin_type" json:"plugin_type" query:"plugin_type"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewGetPluginInfoResponse() *GetPluginInfoResponse { @@ -2893,18 +2893,18 @@ func (p *GetPluginInfoResponse) GetMsg() (v string) { return p.Msg } -var GetPluginInfoResponse_MetaInfo_DEFAULT *plugin_develop_common.PluginMetaInfo +var GetPluginInfoResponse_MetaInfo_DEFAULT *common.PluginMetaInfo -func (p *GetPluginInfoResponse) GetMetaInfo() (v *plugin_develop_common.PluginMetaInfo) { +func (p *GetPluginInfoResponse) GetMetaInfo() (v *common.PluginMetaInfo) { if !p.IsSetMetaInfo() { return GetPluginInfoResponse_MetaInfo_DEFAULT } return p.MetaInfo } -var GetPluginInfoResponse_CodeInfo_DEFAULT *plugin_develop_common.CodeInfo +var GetPluginInfoResponse_CodeInfo_DEFAULT *common.CodeInfo -func (p *GetPluginInfoResponse) GetCodeInfo() (v *plugin_develop_common.CodeInfo) { +func (p *GetPluginInfoResponse) GetCodeInfo() (v *common.CodeInfo) { if !p.IsSetCodeInfo() { return GetPluginInfoResponse_CodeInfo_DEFAULT } @@ -2919,25 +2919,25 @@ func (p *GetPluginInfoResponse) GetPublished() (v bool) { return p.Published } -var GetPluginInfoResponse_Creator_DEFAULT *plugin_develop_common.Creator +var GetPluginInfoResponse_Creator_DEFAULT *common.Creator -func (p *GetPluginInfoResponse) GetCreator() (v *plugin_develop_common.Creator) { +func (p *GetPluginInfoResponse) GetCreator() (v *common.Creator) { if !p.IsSetCreator() { return GetPluginInfoResponse_Creator_DEFAULT } return p.Creator } -var GetPluginInfoResponse_StatisticData_DEFAULT *plugin_develop_common.PluginStatisticData +var GetPluginInfoResponse_StatisticData_DEFAULT *common.PluginStatisticData -func (p *GetPluginInfoResponse) GetStatisticData() (v *plugin_develop_common.PluginStatisticData) { +func (p *GetPluginInfoResponse) GetStatisticData() (v *common.PluginStatisticData) { if !p.IsSetStatisticData() { return GetPluginInfoResponse_StatisticData_DEFAULT } return p.StatisticData } -func (p *GetPluginInfoResponse) GetPluginProductStatus() (v plugin_develop_common.ProductStatus) { +func (p *GetPluginInfoResponse) GetPluginProductStatus() (v common.ProductStatus) { return p.PluginProductStatus } @@ -2949,7 +2949,7 @@ func (p *GetPluginInfoResponse) GetPrivacyInfo() (v string) { return p.PrivacyInfo } -func (p *GetPluginInfoResponse) GetCreationMethod() (v plugin_develop_common.CreationMethod) { +func (p *GetPluginInfoResponse) GetCreationMethod() (v common.CreationMethod) { return p.CreationMethod } @@ -2961,7 +2961,7 @@ func (p *GetPluginInfoResponse) GetEditVersion() (v int32) { return p.EditVersion } -func (p *GetPluginInfoResponse) GetPluginType() (v plugin_develop_common.PluginType) { +func (p *GetPluginInfoResponse) GetPluginType() (v common.PluginType) { return p.PluginType } @@ -3211,7 +3211,7 @@ func (p *GetPluginInfoResponse) ReadField2(iprot thrift.TProtocol) error { return nil } func (p *GetPluginInfoResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewPluginMetaInfo() + _field := common.NewPluginMetaInfo() if err := _field.Read(iprot); err != nil { return err } @@ -3219,7 +3219,7 @@ func (p *GetPluginInfoResponse) ReadField3(iprot thrift.TProtocol) error { return nil } func (p *GetPluginInfoResponse) ReadField4(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewCodeInfo() + _field := common.NewCodeInfo() if err := _field.Read(iprot); err != nil { return err } @@ -3249,7 +3249,7 @@ func (p *GetPluginInfoResponse) ReadField6(iprot thrift.TProtocol) error { return nil } func (p *GetPluginInfoResponse) ReadField7(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewCreator() + _field := common.NewCreator() if err := _field.Read(iprot); err != nil { return err } @@ -3257,7 +3257,7 @@ func (p *GetPluginInfoResponse) ReadField7(iprot thrift.TProtocol) error { return nil } func (p *GetPluginInfoResponse) ReadField8(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewPluginStatisticData() + _field := common.NewPluginStatisticData() if err := _field.Read(iprot); err != nil { return err } @@ -3266,11 +3266,11 @@ func (p *GetPluginInfoResponse) ReadField8(iprot thrift.TProtocol) error { } func (p *GetPluginInfoResponse) ReadField9(iprot thrift.TProtocol) error { - var _field plugin_develop_common.ProductStatus + var _field common.ProductStatus if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.ProductStatus(v) + _field = common.ProductStatus(v) } p.PluginProductStatus = _field return nil @@ -3299,11 +3299,11 @@ func (p *GetPluginInfoResponse) ReadField11(iprot thrift.TProtocol) error { } func (p *GetPluginInfoResponse) ReadField12(iprot thrift.TProtocol) error { - var _field plugin_develop_common.CreationMethod + var _field common.CreationMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.CreationMethod(v) + _field = common.CreationMethod(v) } p.CreationMethod = _field return nil @@ -3332,11 +3332,11 @@ func (p *GetPluginInfoResponse) ReadField14(iprot thrift.TProtocol) error { } func (p *GetPluginInfoResponse) ReadField15(iprot thrift.TProtocol) error { - var _field plugin_develop_common.PluginType + var _field common.PluginType if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.PluginType(v) + _field = common.PluginType(v) } p.PluginType = _field return nil @@ -4276,10 +4276,10 @@ func (p *UpdatePluginRequest) String() string { } type UpdatePluginResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - Data *plugin_develop_common.UpdatePluginData `thrift:"data,3,required" form:"data,required" json:"data,required" query:"data,required"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + Data *common.UpdatePluginData `thrift:"data,3,required" form:"data,required" json:"data,required" query:"data,required"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewUpdatePluginResponse() *UpdatePluginResponse { @@ -4297,9 +4297,9 @@ func (p *UpdatePluginResponse) GetMsg() (v string) { return p.Msg } -var UpdatePluginResponse_Data_DEFAULT *plugin_develop_common.UpdatePluginData +var UpdatePluginResponse_Data_DEFAULT *common.UpdatePluginData -func (p *UpdatePluginResponse) GetData() (v *plugin_develop_common.UpdatePluginData) { +func (p *UpdatePluginResponse) GetData() (v *common.UpdatePluginData) { if !p.IsSetData() { return UpdatePluginResponse_Data_DEFAULT } @@ -4440,7 +4440,7 @@ func (p *UpdatePluginResponse) ReadField2(iprot thrift.TProtocol) error { return nil } func (p *UpdatePluginResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewUpdatePluginData() + _field := common.NewUpdatePluginData() if err := _field.Read(iprot); err != nil { return err } @@ -4579,11 +4579,11 @@ type RegisterPluginMetaRequest struct { // Plugin service address prefix URL *string `thrift:"url,3,optional" form:"url" json:"url,omitempty" query:"url"` // plugin icon - Icon *plugin_develop_common.PluginIcon `thrift:"icon,4,required" form:"icon,required" json:"icon,required" query:"icon,required"` + Icon *common.PluginIcon `thrift:"icon,4,required" form:"icon,required" json:"icon,required" query:"icon,required"` // plug-in authorization type - AuthType *plugin_develop_common.AuthorizationType `thrift:"auth_type,5,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` + AuthType *common.AuthorizationType `thrift:"auth_type,5,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` // When the sub-authorization type is api/token, the token parameter position - Location *plugin_develop_common.AuthorizationServiceLocation `thrift:"location,6,optional" form:"location" json:"location,omitempty" query:"location"` + Location *common.AuthorizationServiceLocation `thrift:"location,6,optional" form:"location" json:"location,omitempty" query:"location"` // When the sub-authorization type is api/token, the token parameter key Key *string `thrift:"key,7,optional" form:"key" json:"key,omitempty" query:"key"` // When the sub-authorization type is api/token, the token parameter value @@ -4593,13 +4593,13 @@ type RegisterPluginMetaRequest struct { // Space ID SpaceID int64 `thrift:"space_id,10,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` // Plugin public parameters, key is the parameter position, value is the parameter list - CommonParams map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` + CommonParams map[common.ParameterLocation][]*common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` // ignore - CreationMethod *plugin_develop_common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` + CreationMethod *common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` // ignore IdeCodeRuntime *string `thrift:"ide_code_runtime,13,optional" form:"ide_code_runtime" json:"ide_code_runtime,omitempty" query:"ide_code_runtime"` // ignore - PluginType *plugin_develop_common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` + PluginType *common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` // App ID ProjectID *int64 `thrift:"project_id,15,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` // Level 2 authorization type, 0: api/token of service, 10: client credentials of oauth @@ -4635,27 +4635,27 @@ func (p *RegisterPluginMetaRequest) GetURL() (v string) { return *p.URL } -var RegisterPluginMetaRequest_Icon_DEFAULT *plugin_develop_common.PluginIcon +var RegisterPluginMetaRequest_Icon_DEFAULT *common.PluginIcon -func (p *RegisterPluginMetaRequest) GetIcon() (v *plugin_develop_common.PluginIcon) { +func (p *RegisterPluginMetaRequest) GetIcon() (v *common.PluginIcon) { if !p.IsSetIcon() { return RegisterPluginMetaRequest_Icon_DEFAULT } return p.Icon } -var RegisterPluginMetaRequest_AuthType_DEFAULT plugin_develop_common.AuthorizationType +var RegisterPluginMetaRequest_AuthType_DEFAULT common.AuthorizationType -func (p *RegisterPluginMetaRequest) GetAuthType() (v plugin_develop_common.AuthorizationType) { +func (p *RegisterPluginMetaRequest) GetAuthType() (v common.AuthorizationType) { if !p.IsSetAuthType() { return RegisterPluginMetaRequest_AuthType_DEFAULT } return *p.AuthType } -var RegisterPluginMetaRequest_Location_DEFAULT plugin_develop_common.AuthorizationServiceLocation +var RegisterPluginMetaRequest_Location_DEFAULT common.AuthorizationServiceLocation -func (p *RegisterPluginMetaRequest) GetLocation() (v plugin_develop_common.AuthorizationServiceLocation) { +func (p *RegisterPluginMetaRequest) GetLocation() (v common.AuthorizationServiceLocation) { if !p.IsSetLocation() { return RegisterPluginMetaRequest_Location_DEFAULT } @@ -4693,18 +4693,18 @@ func (p *RegisterPluginMetaRequest) GetSpaceID() (v int64) { return p.SpaceID } -var RegisterPluginMetaRequest_CommonParams_DEFAULT map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema +var RegisterPluginMetaRequest_CommonParams_DEFAULT map[common.ParameterLocation][]*common.CommonParamSchema -func (p *RegisterPluginMetaRequest) GetCommonParams() (v map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema) { +func (p *RegisterPluginMetaRequest) GetCommonParams() (v map[common.ParameterLocation][]*common.CommonParamSchema) { if !p.IsSetCommonParams() { return RegisterPluginMetaRequest_CommonParams_DEFAULT } return p.CommonParams } -var RegisterPluginMetaRequest_CreationMethod_DEFAULT plugin_develop_common.CreationMethod +var RegisterPluginMetaRequest_CreationMethod_DEFAULT common.CreationMethod -func (p *RegisterPluginMetaRequest) GetCreationMethod() (v plugin_develop_common.CreationMethod) { +func (p *RegisterPluginMetaRequest) GetCreationMethod() (v common.CreationMethod) { if !p.IsSetCreationMethod() { return RegisterPluginMetaRequest_CreationMethod_DEFAULT } @@ -4720,9 +4720,9 @@ func (p *RegisterPluginMetaRequest) GetIdeCodeRuntime() (v string) { return *p.IdeCodeRuntime } -var RegisterPluginMetaRequest_PluginType_DEFAULT plugin_develop_common.PluginType +var RegisterPluginMetaRequest_PluginType_DEFAULT common.PluginType -func (p *RegisterPluginMetaRequest) GetPluginType() (v plugin_develop_common.PluginType) { +func (p *RegisterPluginMetaRequest) GetPluginType() (v common.PluginType) { if !p.IsSetPluginType() { return RegisterPluginMetaRequest_PluginType_DEFAULT } @@ -5122,7 +5122,7 @@ func (p *RegisterPluginMetaRequest) ReadField3(iprot thrift.TProtocol) error { return nil } func (p *RegisterPluginMetaRequest) ReadField4(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewPluginIcon() + _field := common.NewPluginIcon() if err := _field.Read(iprot); err != nil { return err } @@ -5131,11 +5131,11 @@ func (p *RegisterPluginMetaRequest) ReadField4(iprot thrift.TProtocol) error { } func (p *RegisterPluginMetaRequest) ReadField5(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.AuthorizationType + var _field *common.AuthorizationType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.AuthorizationType(v) + tmp := common.AuthorizationType(v) _field = &tmp } p.AuthType = _field @@ -5143,11 +5143,11 @@ func (p *RegisterPluginMetaRequest) ReadField5(iprot thrift.TProtocol) error { } func (p *RegisterPluginMetaRequest) ReadField6(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.AuthorizationServiceLocation + var _field *common.AuthorizationServiceLocation if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.AuthorizationServiceLocation(v) + tmp := common.AuthorizationServiceLocation(v) _field = &tmp } p.Location = _field @@ -5202,20 +5202,20 @@ func (p *RegisterPluginMetaRequest) ReadField11(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make(map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema, size) + _field := make(map[common.ParameterLocation][]*common.CommonParamSchema, size) for i := 0; i < size; i++ { - var _key plugin_develop_common.ParameterLocation + var _key common.ParameterLocation if v, err := iprot.ReadI32(); err != nil { return err } else { - _key = plugin_develop_common.ParameterLocation(v) + _key = common.ParameterLocation(v) } _, size, err := iprot.ReadListBegin() if err != nil { return err } - _val := make([]*plugin_develop_common.CommonParamSchema, 0, size) - values := make([]plugin_develop_common.CommonParamSchema, size) + _val := make([]*common.CommonParamSchema, 0, size) + values := make([]common.CommonParamSchema, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -5240,11 +5240,11 @@ func (p *RegisterPluginMetaRequest) ReadField11(iprot thrift.TProtocol) error { } func (p *RegisterPluginMetaRequest) ReadField12(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.CreationMethod + var _field *common.CreationMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.CreationMethod(v) + tmp := common.CreationMethod(v) _field = &tmp } p.CreationMethod = _field @@ -5263,11 +5263,11 @@ func (p *RegisterPluginMetaRequest) ReadField13(iprot thrift.TProtocol) error { } func (p *RegisterPluginMetaRequest) ReadField14(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.PluginType + var _field *common.PluginType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.PluginType(v) + tmp := common.PluginType(v) _field = &tmp } p.PluginType = _field @@ -6075,11 +6075,11 @@ type UpdatePluginMetaRequest struct { Name *string `thrift:"name,2,optional" form:"name" json:"name,omitempty" query:"name"` Desc *string `thrift:"desc,3,optional" form:"desc" json:"desc,omitempty" query:"desc"` // plugin service url - URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` - Icon *plugin_develop_common.PluginIcon `thrift:"icon,5,optional" form:"icon" json:"icon,omitempty" query:"icon"` - AuthType *plugin_develop_common.AuthorizationType `thrift:"auth_type,6,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` + URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` + Icon *common.PluginIcon `thrift:"icon,5,optional" form:"icon" json:"icon,omitempty" query:"icon"` + AuthType *common.AuthorizationType `thrift:"auth_type,6,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` // When the sub-authorization type is api/token, the token parameter position - Location *plugin_develop_common.AuthorizationServiceLocation `thrift:"location,7,optional" form:"location" json:"location,omitempty" query:"location"` + Location *common.AuthorizationServiceLocation `thrift:"location,7,optional" form:"location" json:"location,omitempty" query:"location"` // When the sub-authorization type is api/token, the token parameter key Key *string `thrift:"key,8,optional" form:"key" json:"key,omitempty" query:"key"` // When the sub-authorization type is api/token, the token parameter value @@ -6087,12 +6087,12 @@ type UpdatePluginMetaRequest struct { // When the sub-authorization type is oauth, for oauth information, see GetOAuthSchema return value OauthInfo *string `thrift:"oauth_info,10,optional" form:"oauth_info" json:"oauth_info,omitempty" query:"oauth_info"` // JSON serialization - CommonParams map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` + CommonParams map[common.ParameterLocation][]*common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` // ignore - CreationMethod *plugin_develop_common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` + CreationMethod *common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` // ignore - EditVersion *int32 `thrift:"edit_version,13,optional" form:"edit_version" json:"edit_version,omitempty" query:"edit_version"` - PluginType *plugin_develop_common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` + EditVersion *int32 `thrift:"edit_version,13,optional" form:"edit_version" json:"edit_version,omitempty" query:"edit_version"` + PluginType *common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` // Level 2 authorization type SubAuthType *int32 `thrift:"sub_auth_type,15,optional" form:"sub_auth_type" json:"sub_auth_type,omitempty" query:"sub_auth_type"` // ignore @@ -6140,27 +6140,27 @@ func (p *UpdatePluginMetaRequest) GetURL() (v string) { return *p.URL } -var UpdatePluginMetaRequest_Icon_DEFAULT *plugin_develop_common.PluginIcon +var UpdatePluginMetaRequest_Icon_DEFAULT *common.PluginIcon -func (p *UpdatePluginMetaRequest) GetIcon() (v *plugin_develop_common.PluginIcon) { +func (p *UpdatePluginMetaRequest) GetIcon() (v *common.PluginIcon) { if !p.IsSetIcon() { return UpdatePluginMetaRequest_Icon_DEFAULT } return p.Icon } -var UpdatePluginMetaRequest_AuthType_DEFAULT plugin_develop_common.AuthorizationType +var UpdatePluginMetaRequest_AuthType_DEFAULT common.AuthorizationType -func (p *UpdatePluginMetaRequest) GetAuthType() (v plugin_develop_common.AuthorizationType) { +func (p *UpdatePluginMetaRequest) GetAuthType() (v common.AuthorizationType) { if !p.IsSetAuthType() { return UpdatePluginMetaRequest_AuthType_DEFAULT } return *p.AuthType } -var UpdatePluginMetaRequest_Location_DEFAULT plugin_develop_common.AuthorizationServiceLocation +var UpdatePluginMetaRequest_Location_DEFAULT common.AuthorizationServiceLocation -func (p *UpdatePluginMetaRequest) GetLocation() (v plugin_develop_common.AuthorizationServiceLocation) { +func (p *UpdatePluginMetaRequest) GetLocation() (v common.AuthorizationServiceLocation) { if !p.IsSetLocation() { return UpdatePluginMetaRequest_Location_DEFAULT } @@ -6194,18 +6194,18 @@ func (p *UpdatePluginMetaRequest) GetOauthInfo() (v string) { return *p.OauthInfo } -var UpdatePluginMetaRequest_CommonParams_DEFAULT map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema +var UpdatePluginMetaRequest_CommonParams_DEFAULT map[common.ParameterLocation][]*common.CommonParamSchema -func (p *UpdatePluginMetaRequest) GetCommonParams() (v map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema) { +func (p *UpdatePluginMetaRequest) GetCommonParams() (v map[common.ParameterLocation][]*common.CommonParamSchema) { if !p.IsSetCommonParams() { return UpdatePluginMetaRequest_CommonParams_DEFAULT } return p.CommonParams } -var UpdatePluginMetaRequest_CreationMethod_DEFAULT plugin_develop_common.CreationMethod +var UpdatePluginMetaRequest_CreationMethod_DEFAULT common.CreationMethod -func (p *UpdatePluginMetaRequest) GetCreationMethod() (v plugin_develop_common.CreationMethod) { +func (p *UpdatePluginMetaRequest) GetCreationMethod() (v common.CreationMethod) { if !p.IsSetCreationMethod() { return UpdatePluginMetaRequest_CreationMethod_DEFAULT } @@ -6221,9 +6221,9 @@ func (p *UpdatePluginMetaRequest) GetEditVersion() (v int32) { return *p.EditVersion } -var UpdatePluginMetaRequest_PluginType_DEFAULT plugin_develop_common.PluginType +var UpdatePluginMetaRequest_PluginType_DEFAULT common.PluginType -func (p *UpdatePluginMetaRequest) GetPluginType() (v plugin_develop_common.PluginType) { +func (p *UpdatePluginMetaRequest) GetPluginType() (v common.PluginType) { if !p.IsSetPluginType() { return UpdatePluginMetaRequest_PluginType_DEFAULT } @@ -6599,7 +6599,7 @@ func (p *UpdatePluginMetaRequest) ReadField4(iprot thrift.TProtocol) error { return nil } func (p *UpdatePluginMetaRequest) ReadField5(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewPluginIcon() + _field := common.NewPluginIcon() if err := _field.Read(iprot); err != nil { return err } @@ -6608,11 +6608,11 @@ func (p *UpdatePluginMetaRequest) ReadField5(iprot thrift.TProtocol) error { } func (p *UpdatePluginMetaRequest) ReadField6(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.AuthorizationType + var _field *common.AuthorizationType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.AuthorizationType(v) + tmp := common.AuthorizationType(v) _field = &tmp } p.AuthType = _field @@ -6620,11 +6620,11 @@ func (p *UpdatePluginMetaRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *UpdatePluginMetaRequest) ReadField7(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.AuthorizationServiceLocation + var _field *common.AuthorizationServiceLocation if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.AuthorizationServiceLocation(v) + tmp := common.AuthorizationServiceLocation(v) _field = &tmp } p.Location = _field @@ -6668,20 +6668,20 @@ func (p *UpdatePluginMetaRequest) ReadField11(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make(map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema, size) + _field := make(map[common.ParameterLocation][]*common.CommonParamSchema, size) for i := 0; i < size; i++ { - var _key plugin_develop_common.ParameterLocation + var _key common.ParameterLocation if v, err := iprot.ReadI32(); err != nil { return err } else { - _key = plugin_develop_common.ParameterLocation(v) + _key = common.ParameterLocation(v) } _, size, err := iprot.ReadListBegin() if err != nil { return err } - _val := make([]*plugin_develop_common.CommonParamSchema, 0, size) - values := make([]plugin_develop_common.CommonParamSchema, size) + _val := make([]*common.CommonParamSchema, 0, size) + values := make([]common.CommonParamSchema, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -6706,11 +6706,11 @@ func (p *UpdatePluginMetaRequest) ReadField11(iprot thrift.TProtocol) error { } func (p *UpdatePluginMetaRequest) ReadField12(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.CreationMethod + var _field *common.CreationMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.CreationMethod(v) + tmp := common.CreationMethod(v) _field = &tmp } p.CreationMethod = _field @@ -6729,11 +6729,11 @@ func (p *UpdatePluginMetaRequest) ReadField13(iprot thrift.TProtocol) error { } func (p *UpdatePluginMetaRequest) ReadField14(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.PluginType + var _field *common.PluginType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.PluginType(v) + tmp := common.PluginType(v) _field = &tmp } p.PluginType = _field @@ -8175,17 +8175,17 @@ func (p *PublishPluginResponse) String() string { // Bot reference plugin type GetBotDefaultParamsRequest struct { - SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` - BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` - DevID string `thrift:"dev_id,3" form:"dev_id" json:"dev_id" query:"dev_id"` - PluginID int64 `thrift:"plugin_id,4" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` - APIName string `thrift:"api_name,5" form:"api_name" json:"api_name" query:"api_name"` - PluginReferrerID string `thrift:"plugin_referrer_id,6" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` - PluginReferrerScene plugin_develop_common.PluginReferrerScene `thrift:"plugin_referrer_scene,7" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` - PluginIsDebug bool `thrift:"plugin_is_debug,8" form:"plugin_is_debug" json:"plugin_is_debug" query:"plugin_is_debug"` - WorkflowID string `thrift:"workflow_id,9" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - PluginPublishVersionTs *string `thrift:"plugin_publish_version_ts,10,optional" form:"plugin_publish_version_ts" json:"plugin_publish_version_ts,omitempty" query:"plugin_publish_version_ts"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` + SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` + BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` + DevID string `thrift:"dev_id,3" form:"dev_id" json:"dev_id" query:"dev_id"` + PluginID int64 `thrift:"plugin_id,4" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` + APIName string `thrift:"api_name,5" form:"api_name" json:"api_name" query:"api_name"` + PluginReferrerID string `thrift:"plugin_referrer_id,6" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` + PluginReferrerScene common.PluginReferrerScene `thrift:"plugin_referrer_scene,7" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` + PluginIsDebug bool `thrift:"plugin_is_debug,8" form:"plugin_is_debug" json:"plugin_is_debug" query:"plugin_is_debug"` + WorkflowID string `thrift:"workflow_id,9" form:"workflow_id" json:"workflow_id" query:"workflow_id"` + PluginPublishVersionTs *string `thrift:"plugin_publish_version_ts,10,optional" form:"plugin_publish_version_ts" json:"plugin_publish_version_ts,omitempty" query:"plugin_publish_version_ts"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } func NewGetBotDefaultParamsRequest() *GetBotDefaultParamsRequest { @@ -8219,7 +8219,7 @@ func (p *GetBotDefaultParamsRequest) GetPluginReferrerID() (v string) { return p.PluginReferrerID } -func (p *GetBotDefaultParamsRequest) GetPluginReferrerScene() (v plugin_develop_common.PluginReferrerScene) { +func (p *GetBotDefaultParamsRequest) GetPluginReferrerScene() (v common.PluginReferrerScene) { return p.PluginReferrerScene } @@ -8474,11 +8474,11 @@ func (p *GetBotDefaultParamsRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *GetBotDefaultParamsRequest) ReadField7(iprot thrift.TProtocol) error { - var _field plugin_develop_common.PluginReferrerScene + var _field common.PluginReferrerScene if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.PluginReferrerScene(v) + _field = common.PluginReferrerScene(v) } p.PluginReferrerScene = _field return nil @@ -8783,12 +8783,12 @@ func (p *GetBotDefaultParamsRequest) String() string { } type GetBotDefaultParamsResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - RequestParams []*plugin_develop_common.APIParameter `thrift:"request_params,3" form:"request_params" json:"request_params" query:"request_params"` - ResponseParams []*plugin_develop_common.APIParameter `thrift:"response_params,4" form:"response_params" json:"response_params" query:"response_params"` - ResponseStyle *plugin_develop_common.ResponseStyle `thrift:"response_style,5" form:"response_style" json:"response_style" query:"response_style"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + RequestParams []*common.APIParameter `thrift:"request_params,3" form:"request_params" json:"request_params" query:"request_params"` + ResponseParams []*common.APIParameter `thrift:"response_params,4" form:"response_params" json:"response_params" query:"response_params"` + ResponseStyle *common.ResponseStyle `thrift:"response_style,5" form:"response_style" json:"response_style" query:"response_style"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewGetBotDefaultParamsResponse() *GetBotDefaultParamsResponse { @@ -8806,17 +8806,17 @@ func (p *GetBotDefaultParamsResponse) GetMsg() (v string) { return p.Msg } -func (p *GetBotDefaultParamsResponse) GetRequestParams() (v []*plugin_develop_common.APIParameter) { +func (p *GetBotDefaultParamsResponse) GetRequestParams() (v []*common.APIParameter) { return p.RequestParams } -func (p *GetBotDefaultParamsResponse) GetResponseParams() (v []*plugin_develop_common.APIParameter) { +func (p *GetBotDefaultParamsResponse) GetResponseParams() (v []*common.APIParameter) { return p.ResponseParams } -var GetBotDefaultParamsResponse_ResponseStyle_DEFAULT *plugin_develop_common.ResponseStyle +var GetBotDefaultParamsResponse_ResponseStyle_DEFAULT *common.ResponseStyle -func (p *GetBotDefaultParamsResponse) GetResponseStyle() (v *plugin_develop_common.ResponseStyle) { +func (p *GetBotDefaultParamsResponse) GetResponseStyle() (v *common.ResponseStyle) { if !p.IsSetResponseStyle() { return GetBotDefaultParamsResponse_ResponseStyle_DEFAULT } @@ -8971,8 +8971,8 @@ func (p *GetBotDefaultParamsResponse) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -8994,8 +8994,8 @@ func (p *GetBotDefaultParamsResponse) ReadField4(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -9013,7 +9013,7 @@ func (p *GetBotDefaultParamsResponse) ReadField4(iprot thrift.TProtocol) error { return nil } func (p *GetBotDefaultParamsResponse) ReadField5(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewResponseStyle() + _field := common.NewResponseStyle() if err := _field.Read(iprot); err != nil { return err } @@ -9201,18 +9201,18 @@ func (p *GetBotDefaultParamsResponse) String() string { } type UpdateBotDefaultParamsRequest struct { - SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` - BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` - DevID string `thrift:"dev_id,3" form:"dev_id" json:"dev_id" query:"dev_id"` - PluginID int64 `thrift:"plugin_id,4" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` - APIName string `thrift:"api_name,5" form:"api_name" json:"api_name" query:"api_name"` - RequestParams []*plugin_develop_common.APIParameter `thrift:"request_params,6" form:"request_params" json:"request_params" query:"request_params"` - ResponseParams []*plugin_develop_common.APIParameter `thrift:"response_params,7" form:"response_params" json:"response_params" query:"response_params"` - PluginReferrerID string `thrift:"plugin_referrer_id,8" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` - PluginReferrerScene plugin_develop_common.PluginReferrerScene `thrift:"plugin_referrer_scene,9" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` - ResponseStyle *plugin_develop_common.ResponseStyle `thrift:"response_style,10" form:"response_style" json:"response_style" query:"response_style"` - WorkflowID string `thrift:"workflow_id,11" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` + SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` + BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` + DevID string `thrift:"dev_id,3" form:"dev_id" json:"dev_id" query:"dev_id"` + PluginID int64 `thrift:"plugin_id,4" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` + APIName string `thrift:"api_name,5" form:"api_name" json:"api_name" query:"api_name"` + RequestParams []*common.APIParameter `thrift:"request_params,6" form:"request_params" json:"request_params" query:"request_params"` + ResponseParams []*common.APIParameter `thrift:"response_params,7" form:"response_params" json:"response_params" query:"response_params"` + PluginReferrerID string `thrift:"plugin_referrer_id,8" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` + PluginReferrerScene common.PluginReferrerScene `thrift:"plugin_referrer_scene,9" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` + ResponseStyle *common.ResponseStyle `thrift:"response_style,10" form:"response_style" json:"response_style" query:"response_style"` + WorkflowID string `thrift:"workflow_id,11" form:"workflow_id" json:"workflow_id" query:"workflow_id"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } func NewUpdateBotDefaultParamsRequest() *UpdateBotDefaultParamsRequest { @@ -9242,11 +9242,11 @@ func (p *UpdateBotDefaultParamsRequest) GetAPIName() (v string) { return p.APIName } -func (p *UpdateBotDefaultParamsRequest) GetRequestParams() (v []*plugin_develop_common.APIParameter) { +func (p *UpdateBotDefaultParamsRequest) GetRequestParams() (v []*common.APIParameter) { return p.RequestParams } -func (p *UpdateBotDefaultParamsRequest) GetResponseParams() (v []*plugin_develop_common.APIParameter) { +func (p *UpdateBotDefaultParamsRequest) GetResponseParams() (v []*common.APIParameter) { return p.ResponseParams } @@ -9254,13 +9254,13 @@ func (p *UpdateBotDefaultParamsRequest) GetPluginReferrerID() (v string) { return p.PluginReferrerID } -func (p *UpdateBotDefaultParamsRequest) GetPluginReferrerScene() (v plugin_develop_common.PluginReferrerScene) { +func (p *UpdateBotDefaultParamsRequest) GetPluginReferrerScene() (v common.PluginReferrerScene) { return p.PluginReferrerScene } -var UpdateBotDefaultParamsRequest_ResponseStyle_DEFAULT *plugin_develop_common.ResponseStyle +var UpdateBotDefaultParamsRequest_ResponseStyle_DEFAULT *common.ResponseStyle -func (p *UpdateBotDefaultParamsRequest) GetResponseStyle() (v *plugin_develop_common.ResponseStyle) { +func (p *UpdateBotDefaultParamsRequest) GetResponseStyle() (v *common.ResponseStyle) { if !p.IsSetResponseStyle() { return UpdateBotDefaultParamsRequest_ResponseStyle_DEFAULT } @@ -9506,8 +9506,8 @@ func (p *UpdateBotDefaultParamsRequest) ReadField6(iprot thrift.TProtocol) error if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -9529,8 +9529,8 @@ func (p *UpdateBotDefaultParamsRequest) ReadField7(iprot thrift.TProtocol) error if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -9560,17 +9560,17 @@ func (p *UpdateBotDefaultParamsRequest) ReadField8(iprot thrift.TProtocol) error } func (p *UpdateBotDefaultParamsRequest) ReadField9(iprot thrift.TProtocol) error { - var _field plugin_develop_common.PluginReferrerScene + var _field common.PluginReferrerScene if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.PluginReferrerScene(v) + _field = common.PluginReferrerScene(v) } p.PluginReferrerScene = _field return nil } func (p *UpdateBotDefaultParamsRequest) ReadField10(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewResponseStyle() + _field := common.NewResponseStyle() if err := _field.Read(iprot); err != nil { return err } @@ -10132,13 +10132,13 @@ type DeleteBotDefaultParamsRequest struct { APIName string `thrift:"api_name,4" form:"api_name" json:"api_name" query:"api_name"` // Bot removal tool when: DeleteBot = false, APIName to set // Delete bot: DeleteBot = true, APIName is empty - DeleteBot bool `thrift:"delete_bot,5" form:"delete_bot" json:"delete_bot" query:"delete_bot"` - SpaceID int64 `thrift:"space_id,6" form:"space_id" json:"space_id,string" query:"space_id"` - PluginReferrerID string `thrift:"plugin_referrer_id,7" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` - PluginReferrerScene plugin_develop_common.PluginReferrerScene `thrift:"plugin_referrer_scene,8" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` - WorkflowID string `thrift:"workflow_id,9" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - APIID int64 `thrift:"api_id,10" form:"api_id" json:"api_id,string" query:"api_id"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` + DeleteBot bool `thrift:"delete_bot,5" form:"delete_bot" json:"delete_bot" query:"delete_bot"` + SpaceID int64 `thrift:"space_id,6" form:"space_id" json:"space_id,string" query:"space_id"` + PluginReferrerID string `thrift:"plugin_referrer_id,7" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` + PluginReferrerScene common.PluginReferrerScene `thrift:"plugin_referrer_scene,8" form:"plugin_referrer_scene" json:"plugin_referrer_scene" query:"plugin_referrer_scene"` + WorkflowID string `thrift:"workflow_id,9" form:"workflow_id" json:"workflow_id" query:"workflow_id"` + APIID int64 `thrift:"api_id,10" form:"api_id" json:"api_id,string" query:"api_id"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } func NewDeleteBotDefaultParamsRequest() *DeleteBotDefaultParamsRequest { @@ -10176,7 +10176,7 @@ func (p *DeleteBotDefaultParamsRequest) GetPluginReferrerID() (v string) { return p.PluginReferrerID } -func (p *DeleteBotDefaultParamsRequest) GetPluginReferrerScene() (v plugin_develop_common.PluginReferrerScene) { +func (p *DeleteBotDefaultParamsRequest) GetPluginReferrerScene() (v common.PluginReferrerScene) { return p.PluginReferrerScene } @@ -10429,11 +10429,11 @@ func (p *DeleteBotDefaultParamsRequest) ReadField7(iprot thrift.TProtocol) error } func (p *DeleteBotDefaultParamsRequest) ReadField8(iprot thrift.TProtocol) error { - var _field plugin_develop_common.PluginReferrerScene + var _field common.PluginReferrerScene if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.PluginReferrerScene(v) + _field = common.PluginReferrerScene(v) } p.PluginReferrerScene = _field return nil @@ -10877,20 +10877,20 @@ type UpdateAPIRequest struct { // http subURL of tool Path *string `thrift:"path,5,optional" form:"path" json:"path,omitempty" query:"path"` // http method of tool - Method *plugin_develop_common.APIMethod `thrift:"method,6,optional" form:"method" json:"method,omitempty" query:"method"` + Method *common.APIMethod `thrift:"method,6,optional" form:"method" json:"method,omitempty" query:"method"` // request parameters of tool - RequestParams []*plugin_develop_common.APIParameter `thrift:"request_params,7,optional" form:"request_params" json:"request_params,omitempty" query:"request_params"` + RequestParams []*common.APIParameter `thrift:"request_params,7,optional" form:"request_params" json:"request_params,omitempty" query:"request_params"` // response parameters of tool - ResponseParams []*plugin_develop_common.APIParameter `thrift:"response_params,8,optional" form:"response_params" json:"response_params,omitempty" query:"response_params"` + ResponseParams []*common.APIParameter `thrift:"response_params,8,optional" form:"response_params" json:"response_params,omitempty" query:"response_params"` // whether disable tool Disabled *bool `thrift:"disabled,9,optional" form:"disabled" json:"disabled,omitempty" query:"disabled"` // ignore - APIExtend *plugin_develop_common.APIExtend `thrift:"api_extend,10,optional" form:"api_extend" json:"api_extend,omitempty" query:"api_extend"` + APIExtend *common.APIExtend `thrift:"api_extend,10,optional" form:"api_extend" json:"api_extend,omitempty" query:"api_extend"` // ignore EditVersion *int32 `thrift:"edit_version,11,optional" form:"edit_version" json:"edit_version,omitempty" query:"edit_version"` // whether save example - SaveExample *bool `thrift:"save_example,12,optional" form:"save_example" json:"save_example,omitempty" query:"save_example"` - DebugExample *plugin_develop_common.DebugExample `thrift:"debug_example,13,optional" form:"debug_example" json:"debug_example,omitempty" query:"debug_example"` + SaveExample *bool `thrift:"save_example,12,optional" form:"save_example" json:"save_example,omitempty" query:"save_example"` + DebugExample *common.DebugExample `thrift:"debug_example,13,optional" form:"debug_example" json:"debug_example,omitempty" query:"debug_example"` // ignore FunctionName *string `thrift:"function_name,14,optional" form:"function_name" json:"function_name,omitempty" query:"function_name"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -10938,27 +10938,27 @@ func (p *UpdateAPIRequest) GetPath() (v string) { return *p.Path } -var UpdateAPIRequest_Method_DEFAULT plugin_develop_common.APIMethod +var UpdateAPIRequest_Method_DEFAULT common.APIMethod -func (p *UpdateAPIRequest) GetMethod() (v plugin_develop_common.APIMethod) { +func (p *UpdateAPIRequest) GetMethod() (v common.APIMethod) { if !p.IsSetMethod() { return UpdateAPIRequest_Method_DEFAULT } return *p.Method } -var UpdateAPIRequest_RequestParams_DEFAULT []*plugin_develop_common.APIParameter +var UpdateAPIRequest_RequestParams_DEFAULT []*common.APIParameter -func (p *UpdateAPIRequest) GetRequestParams() (v []*plugin_develop_common.APIParameter) { +func (p *UpdateAPIRequest) GetRequestParams() (v []*common.APIParameter) { if !p.IsSetRequestParams() { return UpdateAPIRequest_RequestParams_DEFAULT } return p.RequestParams } -var UpdateAPIRequest_ResponseParams_DEFAULT []*plugin_develop_common.APIParameter +var UpdateAPIRequest_ResponseParams_DEFAULT []*common.APIParameter -func (p *UpdateAPIRequest) GetResponseParams() (v []*plugin_develop_common.APIParameter) { +func (p *UpdateAPIRequest) GetResponseParams() (v []*common.APIParameter) { if !p.IsSetResponseParams() { return UpdateAPIRequest_ResponseParams_DEFAULT } @@ -10974,9 +10974,9 @@ func (p *UpdateAPIRequest) GetDisabled() (v bool) { return *p.Disabled } -var UpdateAPIRequest_APIExtend_DEFAULT *plugin_develop_common.APIExtend +var UpdateAPIRequest_APIExtend_DEFAULT *common.APIExtend -func (p *UpdateAPIRequest) GetAPIExtend() (v *plugin_develop_common.APIExtend) { +func (p *UpdateAPIRequest) GetAPIExtend() (v *common.APIExtend) { if !p.IsSetAPIExtend() { return UpdateAPIRequest_APIExtend_DEFAULT } @@ -11001,9 +11001,9 @@ func (p *UpdateAPIRequest) GetSaveExample() (v bool) { return *p.SaveExample } -var UpdateAPIRequest_DebugExample_DEFAULT *plugin_develop_common.DebugExample +var UpdateAPIRequest_DebugExample_DEFAULT *common.DebugExample -func (p *UpdateAPIRequest) GetDebugExample() (v *plugin_develop_common.DebugExample) { +func (p *UpdateAPIRequest) GetDebugExample() (v *common.DebugExample) { if !p.IsSetDebugExample() { return UpdateAPIRequest_DebugExample_DEFAULT } @@ -11337,11 +11337,11 @@ func (p *UpdateAPIRequest) ReadField5(iprot thrift.TProtocol) error { } func (p *UpdateAPIRequest) ReadField6(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.APIMethod + var _field *common.APIMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.APIMethod(v) + tmp := common.APIMethod(v) _field = &tmp } p.Method = _field @@ -11352,8 +11352,8 @@ func (p *UpdateAPIRequest) ReadField7(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -11375,8 +11375,8 @@ func (p *UpdateAPIRequest) ReadField8(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -11405,7 +11405,7 @@ func (p *UpdateAPIRequest) ReadField9(iprot thrift.TProtocol) error { return nil } func (p *UpdateAPIRequest) ReadField10(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewAPIExtend() + _field := common.NewAPIExtend() if err := _field.Read(iprot); err != nil { return err } @@ -11435,7 +11435,7 @@ func (p *UpdateAPIRequest) ReadField12(iprot thrift.TProtocol) error { return nil } func (p *UpdateAPIRequest) ReadField13(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewDebugExample() + _field := common.NewDebugExample() if err := _field.Read(iprot); err != nil { return err } @@ -12557,13 +12557,13 @@ type CreateAPIRequest struct { // http subURL of tool Path *string `thrift:"path,4,optional" form:"path" json:"path,omitempty" query:"path"` // http method of tool - Method *plugin_develop_common.APIMethod `thrift:"method,5,optional" form:"method" json:"method,omitempty" query:"method"` + Method *common.APIMethod `thrift:"method,5,optional" form:"method" json:"method,omitempty" query:"method"` // ignore - APIExtend *plugin_develop_common.APIExtend `thrift:"api_extend,6,optional" form:"api_extend" json:"api_extend,omitempty" query:"api_extend"` + APIExtend *common.APIExtend `thrift:"api_extend,6,optional" form:"api_extend" json:"api_extend,omitempty" query:"api_extend"` // ignore - RequestParams []*plugin_develop_common.APIParameter `thrift:"request_params,7,optional" form:"request_params" json:"request_params,omitempty" query:"request_params"` + RequestParams []*common.APIParameter `thrift:"request_params,7,optional" form:"request_params" json:"request_params,omitempty" query:"request_params"` // ignore - ResponseParams []*plugin_develop_common.APIParameter `thrift:"response_params,8,optional" form:"response_params" json:"response_params,omitempty" query:"response_params"` + ResponseParams []*common.APIParameter `thrift:"response_params,8,optional" form:"response_params" json:"response_params,omitempty" query:"response_params"` // ignore Disabled *bool `thrift:"disabled,9,optional" form:"disabled" json:"disabled,omitempty" query:"disabled"` // ignore @@ -12601,36 +12601,36 @@ func (p *CreateAPIRequest) GetPath() (v string) { return *p.Path } -var CreateAPIRequest_Method_DEFAULT plugin_develop_common.APIMethod +var CreateAPIRequest_Method_DEFAULT common.APIMethod -func (p *CreateAPIRequest) GetMethod() (v plugin_develop_common.APIMethod) { +func (p *CreateAPIRequest) GetMethod() (v common.APIMethod) { if !p.IsSetMethod() { return CreateAPIRequest_Method_DEFAULT } return *p.Method } -var CreateAPIRequest_APIExtend_DEFAULT *plugin_develop_common.APIExtend +var CreateAPIRequest_APIExtend_DEFAULT *common.APIExtend -func (p *CreateAPIRequest) GetAPIExtend() (v *plugin_develop_common.APIExtend) { +func (p *CreateAPIRequest) GetAPIExtend() (v *common.APIExtend) { if !p.IsSetAPIExtend() { return CreateAPIRequest_APIExtend_DEFAULT } return p.APIExtend } -var CreateAPIRequest_RequestParams_DEFAULT []*plugin_develop_common.APIParameter +var CreateAPIRequest_RequestParams_DEFAULT []*common.APIParameter -func (p *CreateAPIRequest) GetRequestParams() (v []*plugin_develop_common.APIParameter) { +func (p *CreateAPIRequest) GetRequestParams() (v []*common.APIParameter) { if !p.IsSetRequestParams() { return CreateAPIRequest_RequestParams_DEFAULT } return p.RequestParams } -var CreateAPIRequest_ResponseParams_DEFAULT []*plugin_develop_common.APIParameter +var CreateAPIRequest_ResponseParams_DEFAULT []*common.APIParameter -func (p *CreateAPIRequest) GetResponseParams() (v []*plugin_develop_common.APIParameter) { +func (p *CreateAPIRequest) GetResponseParams() (v []*common.APIParameter) { if !p.IsSetResponseParams() { return CreateAPIRequest_ResponseParams_DEFAULT } @@ -12935,18 +12935,18 @@ func (p *CreateAPIRequest) ReadField4(iprot thrift.TProtocol) error { } func (p *CreateAPIRequest) ReadField5(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.APIMethod + var _field *common.APIMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.APIMethod(v) + tmp := common.APIMethod(v) _field = &tmp } p.Method = _field return nil } func (p *CreateAPIRequest) ReadField6(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewAPIExtend() + _field := common.NewAPIExtend() if err := _field.Read(iprot); err != nil { return err } @@ -12958,8 +12958,8 @@ func (p *CreateAPIRequest) ReadField7(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -12981,8 +12981,8 @@ func (p *CreateAPIRequest) ReadField8(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -14742,10 +14742,10 @@ func (p *GetOAuthSchemaResponse) String() string { } type GetUserAuthorityRequest struct { - PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required"` - CreationMethod plugin_develop_common.CreationMethod `thrift:"creation_method,2,required" form:"creation_method,required" json:"creation_method,required"` - ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id,string"` - Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` + PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required"` + CreationMethod common.CreationMethod `thrift:"creation_method,2,required" form:"creation_method,required" json:"creation_method,required"` + ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id,string"` + Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } func NewGetUserAuthorityRequest() *GetUserAuthorityRequest { @@ -14759,7 +14759,7 @@ func (p *GetUserAuthorityRequest) GetPluginID() (v int64) { return p.PluginID } -func (p *GetUserAuthorityRequest) GetCreationMethod() (v plugin_develop_common.CreationMethod) { +func (p *GetUserAuthorityRequest) GetCreationMethod() (v common.CreationMethod) { return p.CreationMethod } @@ -14894,11 +14894,11 @@ func (p *GetUserAuthorityRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *GetUserAuthorityRequest) ReadField2(iprot thrift.TProtocol) error { - var _field plugin_develop_common.CreationMethod + var _field common.CreationMethod if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.CreationMethod(v) + _field = common.CreationMethod(v) } p.CreationMethod = _field return nil @@ -15039,10 +15039,10 @@ func (p *GetUserAuthorityRequest) String() string { } type GetUserAuthorityResponse struct { - Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` - Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` - Data *plugin_develop_common.GetUserAuthorityData `thrift:"data,3" form:"data" json:"data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` + Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` + Data *common.GetUserAuthorityData `thrift:"data,3" form:"data" json:"data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewGetUserAuthorityResponse() *GetUserAuthorityResponse { @@ -15060,9 +15060,9 @@ func (p *GetUserAuthorityResponse) GetMsg() (v string) { return p.Msg } -var GetUserAuthorityResponse_Data_DEFAULT *plugin_develop_common.GetUserAuthorityData +var GetUserAuthorityResponse_Data_DEFAULT *common.GetUserAuthorityData -func (p *GetUserAuthorityResponse) GetData() (v *plugin_develop_common.GetUserAuthorityData) { +func (p *GetUserAuthorityResponse) GetData() (v *common.GetUserAuthorityData) { if !p.IsSetData() { return GetUserAuthorityResponse_Data_DEFAULT } @@ -15210,7 +15210,7 @@ func (p *GetUserAuthorityResponse) ReadField2(iprot thrift.TProtocol) error { return nil } func (p *GetUserAuthorityResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewGetUserAuthorityData() + _field := common.NewGetUserAuthorityData() if err := _field.Read(iprot); err != nil { return err } @@ -15544,7 +15544,7 @@ type GetOAuthStatusResponse struct { // Is it an authorized plugin? IsOauth bool `thrift:"is_oauth,1" form:"is_oauth" json:"is_oauth" query:"is_oauth"` // user authorization status - Status plugin_develop_common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` + Status common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` // Unauthorized, return the authorized url. Content string `thrift:"content,3" form:"content" json:"content" query:"content"` Code int64 `thrift:"code,253" form:"code" json:"code" query:"code"` @@ -15563,7 +15563,7 @@ func (p *GetOAuthStatusResponse) GetIsOauth() (v bool) { return p.IsOauth } -func (p *GetOAuthStatusResponse) GetStatus() (v plugin_develop_common.OAuthStatus) { +func (p *GetOAuthStatusResponse) GetStatus() (v common.OAuthStatus) { return p.Status } @@ -15717,11 +15717,11 @@ func (p *GetOAuthStatusResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetOAuthStatusResponse) ReadField2(iprot thrift.TProtocol) error { - var _field plugin_develop_common.OAuthStatus + var _field common.OAuthStatus if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.OAuthStatus(v) + _field = common.OAuthStatus(v) } p.Status = _field return nil @@ -16122,10 +16122,10 @@ func (p *CheckAndLockPluginEditRequest) String() string { } type CheckAndLockPluginEditResponse struct { - Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` - Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` - Data *plugin_develop_common.CheckAndLockPluginEditData `thrift:"data,3" form:"data" json:"data" query:"data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"` + Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"` + Data *common.CheckAndLockPluginEditData `thrift:"data,3" form:"data" json:"data" query:"data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewCheckAndLockPluginEditResponse() *CheckAndLockPluginEditResponse { @@ -16143,9 +16143,9 @@ func (p *CheckAndLockPluginEditResponse) GetMsg() (v string) { return p.Msg } -var CheckAndLockPluginEditResponse_Data_DEFAULT *plugin_develop_common.CheckAndLockPluginEditData +var CheckAndLockPluginEditResponse_Data_DEFAULT *common.CheckAndLockPluginEditData -func (p *CheckAndLockPluginEditResponse) GetData() (v *plugin_develop_common.CheckAndLockPluginEditData) { +func (p *CheckAndLockPluginEditResponse) GetData() (v *common.CheckAndLockPluginEditData) { if !p.IsSetData() { return CheckAndLockPluginEditResponse_Data_DEFAULT } @@ -16293,7 +16293,7 @@ func (p *CheckAndLockPluginEditResponse) ReadField2(iprot thrift.TProtocol) erro return nil } func (p *CheckAndLockPluginEditResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewCheckAndLockPluginEditData() + _field := common.NewCheckAndLockPluginEditData() if err := _field.Read(iprot); err != nil { return err } @@ -16794,7 +16794,7 @@ type GetPluginPublishHistoryResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` // reverse time - PluginPublishInfoList []*plugin_develop_common.PluginPublishInfo `thrift:"plugin_publish_info_list,3" form:"plugin_publish_info_list" json:"plugin_publish_info_list" query:"plugin_publish_info_list"` + PluginPublishInfoList []*common.PluginPublishInfo `thrift:"plugin_publish_info_list,3" form:"plugin_publish_info_list" json:"plugin_publish_info_list" query:"plugin_publish_info_list"` // How many in total, greater than page x size description and next page Total int32 `thrift:"total,4" form:"total" json:"total" query:"total"` BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` @@ -16815,7 +16815,7 @@ func (p *GetPluginPublishHistoryResponse) GetMsg() (v string) { return p.Msg } -func (p *GetPluginPublishHistoryResponse) GetPluginPublishInfoList() (v []*plugin_develop_common.PluginPublishInfo) { +func (p *GetPluginPublishHistoryResponse) GetPluginPublishInfoList() (v []*common.PluginPublishInfo) { return p.PluginPublishInfoList } @@ -16958,8 +16958,8 @@ func (p *GetPluginPublishHistoryResponse) ReadField3(iprot thrift.TProtocol) err if err != nil { return err } - _field := make([]*plugin_develop_common.PluginPublishInfo, 0, size) - values := make([]plugin_develop_common.PluginPublishInfo, size) + _field := make([]*common.PluginPublishInfo, 0, size) + values := make([]common.PluginPublishInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -17143,7 +17143,7 @@ type DebugAPIRequest struct { // request parameters in json string Parameters string `thrift:"parameters,3,required" form:"parameters,required" json:"parameters,required" query:"parameters,required"` // ignore - Operation plugin_develop_common.DebugOperation `thrift:"operation,4,required" form:"operation,required" json:"operation,required" query:"operation,required"` + Operation common.DebugOperation `thrift:"operation,4,required" form:"operation,required" json:"operation,required" query:"operation,required"` // ignore EditVersion *int32 `thrift:"edit_version,5,optional" form:"edit_version" json:"edit_version,omitempty" query:"edit_version"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -17168,7 +17168,7 @@ func (p *DebugAPIRequest) GetParameters() (v string) { return p.Parameters } -func (p *DebugAPIRequest) GetOperation() (v plugin_develop_common.DebugOperation) { +func (p *DebugAPIRequest) GetOperation() (v common.DebugOperation) { return p.Operation } @@ -17366,11 +17366,11 @@ func (p *DebugAPIRequest) ReadField3(iprot thrift.TProtocol) error { } func (p *DebugAPIRequest) ReadField4(iprot thrift.TProtocol) error { - var _field plugin_develop_common.DebugOperation + var _field common.DebugOperation if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.DebugOperation(v) + _field = common.DebugOperation(v) } p.Operation = _field return nil @@ -17556,7 +17556,7 @@ type DebugAPIResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` // response parameters - ResponseParams []*plugin_develop_common.APIParameter `thrift:"response_params,3" form:"response_params" json:"response_params" query:"response_params"` + ResponseParams []*common.APIParameter `thrift:"response_params,3" form:"response_params" json:"response_params" query:"response_params"` // invoke success or not Success bool `thrift:"success,4" form:"success" json:"success" query:"success"` // trimmed response in json string @@ -17585,7 +17585,7 @@ func (p *DebugAPIResponse) GetMsg() (v string) { return p.Msg } -func (p *DebugAPIResponse) GetResponseParams() (v []*plugin_develop_common.APIParameter) { +func (p *DebugAPIResponse) GetResponseParams() (v []*common.APIParameter) { return p.ResponseParams } @@ -17780,8 +17780,8 @@ func (p *DebugAPIResponse) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.APIParameter, 0, size) - values := make([]plugin_develop_common.APIParameter, size) + _field := make([]*common.APIParameter, 0, size) + values := make([]common.APIParameter, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -19133,8 +19133,8 @@ type RegisterPluginRequest struct { // ignore ServiceToken *string `thrift:"service_token,6,optional" form:"service_token" json:"service_token,omitempty" query:"service_token"` // ignore - PluginType *plugin_develop_common.PluginType `thrift:"plugin_type,7,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` - SpaceID int64 `thrift:"space_id,8" form:"space_id" json:"space_id,string" query:"space_id"` + PluginType *common.PluginType `thrift:"plugin_type,7,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` + SpaceID int64 `thrift:"space_id,8" form:"space_id" json:"space_id,string" query:"space_id"` // ignore ImportFromFile bool `thrift:"import_from_file,9" form:"import_from_file" json:"import_from_file" query:"import_from_file"` ProjectID *int64 `thrift:"project_id,10,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` @@ -19183,9 +19183,9 @@ func (p *RegisterPluginRequest) GetServiceToken() (v string) { return *p.ServiceToken } -var RegisterPluginRequest_PluginType_DEFAULT plugin_develop_common.PluginType +var RegisterPluginRequest_PluginType_DEFAULT common.PluginType -func (p *RegisterPluginRequest) GetPluginType() (v plugin_develop_common.PluginType) { +func (p *RegisterPluginRequest) GetPluginType() (v common.PluginType) { if !p.IsSetPluginType() { return RegisterPluginRequest_PluginType_DEFAULT } @@ -19439,11 +19439,11 @@ func (p *RegisterPluginRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *RegisterPluginRequest) ReadField7(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.PluginType + var _field *common.PluginType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.PluginType(v) + tmp := common.PluginType(v) _field = &tmp } p.PluginType = _field @@ -19737,10 +19737,10 @@ func (p *RegisterPluginRequest) String() string { } type RegisterPluginResponse struct { - Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - Data *plugin_develop_common.RegisterPluginData `thrift:"data,3" form:"data" json:"data" query:"data"` - BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + Data *common.RegisterPluginData `thrift:"data,3" form:"data" json:"data" query:"data"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } func NewRegisterPluginResponse() *RegisterPluginResponse { @@ -19758,9 +19758,9 @@ func (p *RegisterPluginResponse) GetMsg() (v string) { return p.Msg } -var RegisterPluginResponse_Data_DEFAULT *plugin_develop_common.RegisterPluginData +var RegisterPluginResponse_Data_DEFAULT *common.RegisterPluginData -func (p *RegisterPluginResponse) GetData() (v *plugin_develop_common.RegisterPluginData) { +func (p *RegisterPluginResponse) GetData() (v *common.RegisterPluginData) { if !p.IsSetData() { return RegisterPluginResponse_Data_DEFAULT } @@ -19893,7 +19893,7 @@ func (p *RegisterPluginResponse) ReadField2(iprot thrift.TProtocol) error { return nil } func (p *RegisterPluginResponse) ReadField3(iprot thrift.TProtocol) error { - _field := plugin_develop_common.NewRegisterPluginData() + _field := common.NewRegisterPluginData() if err := _field.Read(iprot); err != nil { return err } @@ -20025,20 +20025,20 @@ func (p *RegisterPluginResponse) String() string { } type GetDevPluginListRequest struct { - Status []plugin_develop_common.PluginStatus `thrift:"status,1,optional" form:"status" json:"status,omitempty" query:"status"` - Page *int32 `thrift:"page,2,optional" form:"page" json:"page,omitempty" query:"page"` - Size *int32 `thrift:"size,3,optional" form:"size" json:"size,omitempty" query:"size"` - DevID int64 `thrift:"dev_id,4,required" form:"dev_id,required" json:"dev_id,string,required"` - SpaceID int64 `thrift:"space_id,5" form:"space_id" json:"space_id,string"` - ScopeType *plugin_develop_common.ScopeType `thrift:"scope_type,6,optional" form:"scope_type" json:"scope_type,omitempty" query:"scope_type"` - OrderBy *plugin_develop_common.OrderBy `thrift:"order_by,7,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` + Status []common.PluginStatus `thrift:"status,1,optional" form:"status" json:"status,omitempty" query:"status"` + Page *int32 `thrift:"page,2,optional" form:"page" json:"page,omitempty" query:"page"` + Size *int32 `thrift:"size,3,optional" form:"size" json:"size,omitempty" query:"size"` + DevID int64 `thrift:"dev_id,4,required" form:"dev_id,required" json:"dev_id,string,required"` + SpaceID int64 `thrift:"space_id,5" form:"space_id" json:"space_id,string"` + ScopeType *common.ScopeType `thrift:"scope_type,6,optional" form:"scope_type" json:"scope_type,omitempty" query:"scope_type"` + OrderBy *common.OrderBy `thrift:"order_by,7,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` // Release status filter: true: published, false: not published PublishStatus *bool `thrift:"publish_status,8,optional" form:"publish_status" json:"publish_status,omitempty" query:"publish_status"` // Plugin name or tool name Name *string `thrift:"name,9,optional" form:"name" json:"name,omitempty" query:"name"` // Plugin Type Filter, End/Cloud - PluginTypeForFilter *plugin_develop_common.PluginTypeForFilter `thrift:"plugin_type_for_filter,10,optional" form:"plugin_type_for_filter" json:"plugin_type_for_filter,omitempty" query:"plugin_type_for_filter"` - ProjectID int64 `thrift:"project_id,11" form:"project_id" json:"project_id,string"` + PluginTypeForFilter *common.PluginTypeForFilter `thrift:"plugin_type_for_filter,10,optional" form:"plugin_type_for_filter" json:"plugin_type_for_filter,omitempty" query:"plugin_type_for_filter"` + ProjectID int64 `thrift:"project_id,11" form:"project_id" json:"project_id,string"` // plugin id list PluginIds []int64 `thrift:"plugin_ids,12" form:"plugin_ids" json:"plugin_ids"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -20051,9 +20051,9 @@ func NewGetDevPluginListRequest() *GetDevPluginListRequest { func (p *GetDevPluginListRequest) InitDefault() { } -var GetDevPluginListRequest_Status_DEFAULT []plugin_develop_common.PluginStatus +var GetDevPluginListRequest_Status_DEFAULT []common.PluginStatus -func (p *GetDevPluginListRequest) GetStatus() (v []plugin_develop_common.PluginStatus) { +func (p *GetDevPluginListRequest) GetStatus() (v []common.PluginStatus) { if !p.IsSetStatus() { return GetDevPluginListRequest_Status_DEFAULT } @@ -20086,18 +20086,18 @@ func (p *GetDevPluginListRequest) GetSpaceID() (v int64) { return p.SpaceID } -var GetDevPluginListRequest_ScopeType_DEFAULT plugin_develop_common.ScopeType +var GetDevPluginListRequest_ScopeType_DEFAULT common.ScopeType -func (p *GetDevPluginListRequest) GetScopeType() (v plugin_develop_common.ScopeType) { +func (p *GetDevPluginListRequest) GetScopeType() (v common.ScopeType) { if !p.IsSetScopeType() { return GetDevPluginListRequest_ScopeType_DEFAULT } return *p.ScopeType } -var GetDevPluginListRequest_OrderBy_DEFAULT plugin_develop_common.OrderBy +var GetDevPluginListRequest_OrderBy_DEFAULT common.OrderBy -func (p *GetDevPluginListRequest) GetOrderBy() (v plugin_develop_common.OrderBy) { +func (p *GetDevPluginListRequest) GetOrderBy() (v common.OrderBy) { if !p.IsSetOrderBy() { return GetDevPluginListRequest_OrderBy_DEFAULT } @@ -20122,9 +20122,9 @@ func (p *GetDevPluginListRequest) GetName() (v string) { return *p.Name } -var GetDevPluginListRequest_PluginTypeForFilter_DEFAULT plugin_develop_common.PluginTypeForFilter +var GetDevPluginListRequest_PluginTypeForFilter_DEFAULT common.PluginTypeForFilter -func (p *GetDevPluginListRequest) GetPluginTypeForFilter() (v plugin_develop_common.PluginTypeForFilter) { +func (p *GetDevPluginListRequest) GetPluginTypeForFilter() (v common.PluginTypeForFilter) { if !p.IsSetPluginTypeForFilter() { return GetDevPluginListRequest_PluginTypeForFilter_DEFAULT } @@ -20364,14 +20364,14 @@ func (p *GetDevPluginListRequest) ReadField1(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]plugin_develop_common.PluginStatus, 0, size) + _field := make([]common.PluginStatus, 0, size) for i := 0; i < size; i++ { - var _elem plugin_develop_common.PluginStatus + var _elem common.PluginStatus if v, err := iprot.ReadI32(); err != nil { return err } else { - _elem = plugin_develop_common.PluginStatus(v) + _elem = common.PluginStatus(v) } _field = append(_field, _elem) @@ -20428,11 +20428,11 @@ func (p *GetDevPluginListRequest) ReadField5(iprot thrift.TProtocol) error { } func (p *GetDevPluginListRequest) ReadField6(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.ScopeType + var _field *common.ScopeType if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.ScopeType(v) + tmp := common.ScopeType(v) _field = &tmp } p.ScopeType = _field @@ -20440,11 +20440,11 @@ func (p *GetDevPluginListRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *GetDevPluginListRequest) ReadField7(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.OrderBy + var _field *common.OrderBy if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.OrderBy(v) + tmp := common.OrderBy(v) _field = &tmp } p.OrderBy = _field @@ -20474,11 +20474,11 @@ func (p *GetDevPluginListRequest) ReadField9(iprot thrift.TProtocol) error { } func (p *GetDevPluginListRequest) ReadField10(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.PluginTypeForFilter + var _field *common.PluginTypeForFilter if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.PluginTypeForFilter(v) + tmp := common.PluginTypeForFilter(v) _field = &tmp } p.PluginTypeForFilter = _field @@ -20855,11 +20855,11 @@ func (p *GetDevPluginListRequest) String() string { } type GetDevPluginListResponse struct { - Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` - Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - PluginList []*plugin_develop_common.PluginInfoForPlayground `thrift:"plugin_list,3" form:"plugin_list" json:"plugin_list" query:"plugin_list"` - Total int64 `thrift:"total,4" form:"total" json:"total,string"` - BaseResp *base.BaseResp `thrift:"baseResp,255" form:"baseResp" json:"baseResp" query:"baseResp"` + Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` + PluginList []*common.PluginInfoForPlayground `thrift:"plugin_list,3" form:"plugin_list" json:"plugin_list" query:"plugin_list"` + Total int64 `thrift:"total,4" form:"total" json:"total,string"` + BaseResp *base.BaseResp `thrift:"baseResp,255" form:"baseResp" json:"baseResp" query:"baseResp"` } func NewGetDevPluginListResponse() *GetDevPluginListResponse { @@ -20877,7 +20877,7 @@ func (p *GetDevPluginListResponse) GetMsg() (v string) { return p.Msg } -func (p *GetDevPluginListResponse) GetPluginList() (v []*plugin_develop_common.PluginInfoForPlayground) { +func (p *GetDevPluginListResponse) GetPluginList() (v []*common.PluginInfoForPlayground) { return p.PluginList } @@ -21020,8 +21020,8 @@ func (p *GetDevPluginListResponse) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.PluginInfoForPlayground, 0, size) - values := make([]plugin_develop_common.PluginInfoForPlayground, size) + _field := make([]*common.PluginInfoForPlayground, 0, size) + values := make([]common.PluginInfoForPlayground, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -21679,9 +21679,9 @@ type Convert2OpenAPIResponse struct { // plugin manifest in json string AiPlugin *string `thrift:"ai_plugin,4,optional" form:"ai_plugin" json:"ai_plugin,omitempty" query:"ai_plugin"` // protocol type - PluginDataFormat *plugin_develop_common.PluginDataFormat `thrift:"plugin_data_format,5,optional" form:"plugin_data_format" json:"plugin_data_format,omitempty" query:"plugin_data_format"` + PluginDataFormat *common.PluginDataFormat `thrift:"plugin_data_format,5,optional" form:"plugin_data_format" json:"plugin_data_format,omitempty" query:"plugin_data_format"` // ignore - DuplicateAPIInfos []*plugin_develop_common.DuplicateAPIInfo `thrift:"duplicate_api_infos,6" form:"duplicate_api_infos" json:"duplicate_api_infos" query:"duplicate_api_infos"` + DuplicateAPIInfos []*common.DuplicateAPIInfo `thrift:"duplicate_api_infos,6" form:"duplicate_api_infos" json:"duplicate_api_infos" query:"duplicate_api_infos"` // BaseResp.StatusCode // DuplicateAPIPath: Duplicate API Path in imported file with request. MergeSamePaths = false // InvalidParam: Other errors @@ -21721,16 +21721,16 @@ func (p *Convert2OpenAPIResponse) GetAiPlugin() (v string) { return *p.AiPlugin } -var Convert2OpenAPIResponse_PluginDataFormat_DEFAULT plugin_develop_common.PluginDataFormat +var Convert2OpenAPIResponse_PluginDataFormat_DEFAULT common.PluginDataFormat -func (p *Convert2OpenAPIResponse) GetPluginDataFormat() (v plugin_develop_common.PluginDataFormat) { +func (p *Convert2OpenAPIResponse) GetPluginDataFormat() (v common.PluginDataFormat) { if !p.IsSetPluginDataFormat() { return Convert2OpenAPIResponse_PluginDataFormat_DEFAULT } return *p.PluginDataFormat } -func (p *Convert2OpenAPIResponse) GetDuplicateAPIInfos() (v []*plugin_develop_common.DuplicateAPIInfo) { +func (p *Convert2OpenAPIResponse) GetDuplicateAPIInfos() (v []*common.DuplicateAPIInfo) { return p.DuplicateAPIInfos } @@ -21918,11 +21918,11 @@ func (p *Convert2OpenAPIResponse) ReadField4(iprot thrift.TProtocol) error { } func (p *Convert2OpenAPIResponse) ReadField5(iprot thrift.TProtocol) error { - var _field *plugin_develop_common.PluginDataFormat + var _field *common.PluginDataFormat if v, err := iprot.ReadI32(); err != nil { return err } else { - tmp := plugin_develop_common.PluginDataFormat(v) + tmp := common.PluginDataFormat(v) _field = &tmp } p.PluginDataFormat = _field @@ -21933,8 +21933,8 @@ func (p *Convert2OpenAPIResponse) ReadField6(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.DuplicateAPIInfo, 0, size) - values := make([]plugin_develop_common.DuplicateAPIInfo, size) + _field := make([]*common.DuplicateAPIInfo, 0, size) + values := make([]common.DuplicateAPIInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -22161,7 +22161,7 @@ type BatchCreateAPIRequest struct { // whether to replace the same tool, method:subURL is unique ReplaceSamePaths bool `thrift:"replace_same_paths,6" form:"replace_same_paths" json:"replace_same_paths"` // ignore - PathsToReplace []*plugin_develop_common.PluginAPIInfo `thrift:"paths_to_replace,7,optional" form:"paths_to_replace" json:"paths_to_replace,omitempty"` + PathsToReplace []*common.PluginAPIInfo `thrift:"paths_to_replace,7,optional" form:"paths_to_replace" json:"paths_to_replace,omitempty"` // ignore EditVersion *int32 `thrift:"edit_version,8,optional" form:"edit_version" json:"edit_version,omitempty"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -22198,9 +22198,9 @@ func (p *BatchCreateAPIRequest) GetReplaceSamePaths() (v bool) { return p.ReplaceSamePaths } -var BatchCreateAPIRequest_PathsToReplace_DEFAULT []*plugin_develop_common.PluginAPIInfo +var BatchCreateAPIRequest_PathsToReplace_DEFAULT []*common.PluginAPIInfo -func (p *BatchCreateAPIRequest) GetPathsToReplace() (v []*plugin_develop_common.PluginAPIInfo) { +func (p *BatchCreateAPIRequest) GetPathsToReplace() (v []*common.PluginAPIInfo) { if !p.IsSetPathsToReplace() { return BatchCreateAPIRequest_PathsToReplace_DEFAULT } @@ -22439,8 +22439,8 @@ func (p *BatchCreateAPIRequest) ReadField7(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.PluginAPIInfo, 0, size) - values := make([]plugin_develop_common.PluginAPIInfo, size) + _field := make([]*common.PluginAPIInfo, 0, size) + values := make([]common.PluginAPIInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -22709,9 +22709,9 @@ type BatchCreateAPIResponse struct { Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` // PathsToReplace represents the tools to override, // If BaseResp. StatusCode = DuplicateAPIPath, then PathsToReplace is not empty - PathsDuplicated []*plugin_develop_common.PluginAPIInfo `thrift:"paths_duplicated,3,optional" form:"paths_duplicated" json:"paths_duplicated,omitempty" query:"paths_duplicated"` - PathsCreated []*plugin_develop_common.PluginAPIInfo `thrift:"paths_created,4,optional" form:"paths_created" json:"paths_created,omitempty" query:"paths_created"` - EditVersion int32 `thrift:"edit_version,5" form:"edit_version" json:"edit_version" query:"edit_version"` + PathsDuplicated []*common.PluginAPIInfo `thrift:"paths_duplicated,3,optional" form:"paths_duplicated" json:"paths_duplicated,omitempty" query:"paths_duplicated"` + PathsCreated []*common.PluginAPIInfo `thrift:"paths_created,4,optional" form:"paths_created" json:"paths_created,omitempty" query:"paths_created"` + EditVersion int32 `thrift:"edit_version,5" form:"edit_version" json:"edit_version" query:"edit_version"` // BaseResp.StatusCode // DuplicateAPIPath: There is a duplicate API Path with request. ReplaceDupPath = false // InvalidParam: Other errors @@ -22733,18 +22733,18 @@ func (p *BatchCreateAPIResponse) GetMsg() (v string) { return p.Msg } -var BatchCreateAPIResponse_PathsDuplicated_DEFAULT []*plugin_develop_common.PluginAPIInfo +var BatchCreateAPIResponse_PathsDuplicated_DEFAULT []*common.PluginAPIInfo -func (p *BatchCreateAPIResponse) GetPathsDuplicated() (v []*plugin_develop_common.PluginAPIInfo) { +func (p *BatchCreateAPIResponse) GetPathsDuplicated() (v []*common.PluginAPIInfo) { if !p.IsSetPathsDuplicated() { return BatchCreateAPIResponse_PathsDuplicated_DEFAULT } return p.PathsDuplicated } -var BatchCreateAPIResponse_PathsCreated_DEFAULT []*plugin_develop_common.PluginAPIInfo +var BatchCreateAPIResponse_PathsCreated_DEFAULT []*common.PluginAPIInfo -func (p *BatchCreateAPIResponse) GetPathsCreated() (v []*plugin_develop_common.PluginAPIInfo) { +func (p *BatchCreateAPIResponse) GetPathsCreated() (v []*common.PluginAPIInfo) { if !p.IsSetPathsCreated() { return BatchCreateAPIResponse_PathsCreated_DEFAULT } @@ -22915,8 +22915,8 @@ func (p *BatchCreateAPIResponse) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.PluginAPIInfo, 0, size) - values := make([]plugin_develop_common.PluginAPIInfo, size) + _field := make([]*common.PluginAPIInfo, 0, size) + values := make([]common.PluginAPIInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -22938,8 +22938,8 @@ func (p *BatchCreateAPIResponse) ReadField4(iprot thrift.TProtocol) error { if err != nil { return err } - _field := make([]*plugin_develop_common.PluginAPIInfo, 0, size) - values := make([]plugin_develop_common.PluginAPIInfo, size) + _field := make([]*common.PluginAPIInfo, 0, size) + values := make([]common.PluginAPIInfo, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -23616,7 +23616,7 @@ func (p *RevokeAuthTokenResponse) String() string { type OAuthPluginInfo struct { PluginID int64 `thrift:"plugin_id,1" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` // user authorization status - Status plugin_develop_common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` + Status common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` // Plugin name Name string `thrift:"name,3" form:"name" json:"name" query:"name"` // plugin avatar @@ -23634,7 +23634,7 @@ func (p *OAuthPluginInfo) GetPluginID() (v int64) { return p.PluginID } -func (p *OAuthPluginInfo) GetStatus() (v plugin_develop_common.OAuthStatus) { +func (p *OAuthPluginInfo) GetStatus() (v common.OAuthStatus) { return p.Status } @@ -23745,11 +23745,11 @@ func (p *OAuthPluginInfo) ReadField1(iprot thrift.TProtocol) error { } func (p *OAuthPluginInfo) ReadField2(iprot thrift.TProtocol) error { - var _field plugin_develop_common.OAuthStatus + var _field common.OAuthStatus if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = plugin_develop_common.OAuthStatus(v) + _field = common.OAuthStatus(v) } p.Status = _field return nil diff --git a/backend/api/model/ocean/cloud/workflow/trace.go b/backend/api/model/workflow/trace.go similarity index 100% rename from backend/api/model/ocean/cloud/workflow/trace.go rename to backend/api/model/workflow/trace.go diff --git a/backend/api/model/ocean/cloud/workflow/workflow.go b/backend/api/model/workflow/workflow.go similarity index 100% rename from backend/api/model/ocean/cloud/workflow/workflow.go rename to backend/api/model/workflow/workflow.go diff --git a/backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go b/backend/api/model/workflow/workflow_svc.go similarity index 100% rename from backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go rename to backend/api/model/workflow/workflow_svc.go diff --git a/backend/application/app/app.go b/backend/application/app/app.go index 16848239..c1d7e60b 100644 --- a/backend/application/app/app.go +++ b/backend/application/app/app.go @@ -26,21 +26,21 @@ import ( "github.com/google/uuid" + intelligenceAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" + taskStruct "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" + projectAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project" + publishAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish" + taskAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task" connectorModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector" knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" pluginModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - intelligenceAPI "github.com/coze-dev/coze-studio/backend/api/model/intelligence" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - workflowAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" - projectAPI "github.com/coze-dev/coze-studio/backend/api/model/project" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" - publishAPI "github.com/coze-dev/coze-studio/backend/api/model/publish" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/playground" resourceAPI "github.com/coze-dev/coze-studio/backend/api/model/resource" resourceCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" - "github.com/coze-dev/coze-studio/backend/api/model/table" - taskAPI "github.com/coze-dev/coze-studio/backend/api/model/task" - taskStruct "github.com/coze-dev/coze-studio/backend/api/model/task_struct" + workflowAPI "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/knowledge" "github.com/coze-dev/coze-studio/backend/application/memory" diff --git a/backend/application/base/pluginutil/api.go b/backend/application/base/pluginutil/api.go index 7555666b..30070918 100644 --- a/backend/application/base/pluginutil/api.go +++ b/backend/application/base/pluginutil/api.go @@ -25,7 +25,7 @@ import ( "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/pkg/errorx" "github.com/coze-dev/coze-studio/backend/types/errno" ) diff --git a/backend/application/knowledge/convertor.go b/backend/application/knowledge/convertor.go index 0b184bfe..68a903e2 100644 --- a/backend/application/knowledge/convertor.go +++ b/backend/application/knowledge/convertor.go @@ -25,10 +25,10 @@ import ( "strings" "time" - modelCommon "github.com/coze-dev/coze-studio/backend/api/model/common" knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" - "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset" + dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" + modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" "github.com/coze-dev/coze-studio/backend/application/upload" "github.com/coze-dev/coze-studio/backend/domain/knowledge/entity" "github.com/coze-dev/coze-studio/backend/domain/knowledge/service" diff --git a/backend/application/knowledge/knowledge.go b/backend/application/knowledge/knowledge.go index 568b7fec..11856d23 100644 --- a/backend/application/knowledge/knowledge.go +++ b/backend/application/knowledge/knowledge.go @@ -26,10 +26,10 @@ import ( "github.com/bytedance/sonic" - modelCommon "github.com/coze-dev/coze-studio/backend/api/model/common" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" - "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset" - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" + dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" + document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" + modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/search" diff --git a/backend/application/memory/convertor.go b/backend/application/memory/convertor.go index 90095078..6b5088ff 100644 --- a/backend/application/memory/convertor.go +++ b/backend/application/memory/convertor.go @@ -23,7 +23,7 @@ import ( "github.com/coze-dev/coze-studio/backend/api/model/base" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" diff --git a/backend/application/memory/database.go b/backend/application/memory/database.go index 3aa5f43f..cb5de1c2 100644 --- a/backend/application/memory/database.go +++ b/backend/application/memory/database.go @@ -22,9 +22,10 @@ import ( "github.com/coze-dev/coze-studio/backend/api/model/base" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" + document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" - "github.com/coze-dev/coze-studio/backend/api/model/table" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/search" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossuser" @@ -48,8 +49,8 @@ type DatabaseApplicationService struct { var DatabaseApplicationSVC = DatabaseApplicationService{} -func (d *DatabaseApplicationService) GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (*table.GetModeConfigResponse, error) { - return &table.GetModeConfigResponse{ +func (d *DatabaseApplicationService) GetModeConfig(ctx context.Context, req *knowledge.GetModeConfigRequest) (*knowledge.GetModeConfigResponse, error) { + return &knowledge.GetModeConfigResponse{ Code: 0, Msg: "success", BotID: req.BotID, diff --git a/backend/application/memory/variables.go b/backend/application/memory/variables.go index d6e5f32d..ac965dfa 100644 --- a/backend/application/memory/variables.go +++ b/backend/application/memory/variables.go @@ -24,8 +24,8 @@ import ( "github.com/coze-dev/coze-studio/backend/api/model/base" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service" diff --git a/backend/application/modelmgr/modelmgr.go b/backend/application/modelmgr/modelmgr.go index 8d85c66f..6ebc38c5 100644 --- a/backend/application/modelmgr/modelmgr.go +++ b/backend/application/modelmgr/modelmgr.go @@ -19,7 +19,7 @@ package modelmgr import ( "context" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr" "github.com/coze-dev/coze-studio/backend/infra/impl/storage" "github.com/coze-dev/coze-studio/backend/pkg/i18n" diff --git a/backend/application/plugin/plugin.go b/backend/application/plugin/plugin.go index da8e3120..f7e9cc98 100644 --- a/backend/application/plugin/plugin.go +++ b/backend/application/plugin/plugin.go @@ -33,13 +33,13 @@ import ( gonanoid "github.com/matoous/go-nanoid" "gopkg.in/yaml.v3" + botOpenAPI "github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" searchModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search" - productCommon "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" - productAPI "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" - botOpenAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api" - pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + productCommon "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common" + productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" + pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/base/pluginutil" diff --git a/backend/application/prompt/prompt.go b/backend/application/prompt/prompt.go index 14dc8fdd..3e9d1885 100644 --- a/backend/application/prompt/prompt.go +++ b/backend/application/prompt/prompt.go @@ -19,7 +19,7 @@ package prompt import ( "context" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/application/search" diff --git a/backend/application/search/project_pack.go b/backend/application/search/project_pack.go index fa3ca0b8..77843385 100644 --- a/backend/application/search/project_pack.go +++ b/backend/application/search/project_pack.go @@ -21,8 +21,8 @@ import ( "fmt" "strconv" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/domain/app/entity" appService "github.com/coze-dev/coze-studio/backend/domain/app/service" "github.com/coze-dev/coze-studio/backend/pkg/lang/conv" diff --git a/backend/application/search/project_search.go b/backend/application/search/project_search.go index a45300ad..7dc02b2b 100644 --- a/backend/application/search/project_search.go +++ b/backend/application/search/project_search.go @@ -22,12 +22,12 @@ import ( "sync" "time" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" search2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common" + "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity" "github.com/coze-dev/coze-studio/backend/pkg/errorx" diff --git a/backend/application/search/resource_pack.go b/backend/application/search/resource_pack.go index d39b5c1e..7ef269d9 100644 --- a/backend/application/search/resource_pack.go +++ b/backend/application/search/resource_pack.go @@ -21,8 +21,8 @@ import ( "fmt" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/api/model/resource/common" - "github.com/coze-dev/coze-studio/backend/api/model/table" "github.com/coze-dev/coze-studio/backend/domain/knowledge/service" dbservice "github.com/coze-dev/coze-studio/backend/domain/memory/database/service" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" diff --git a/backend/application/shortcutcmd/shortcut_cmd.go b/backend/application/shortcutcmd/shortcut_cmd.go index 0a30b486..825257e4 100644 --- a/backend/application/shortcutcmd/shortcut_cmd.go +++ b/backend/application/shortcutcmd/shortcut_cmd.go @@ -20,7 +20,7 @@ import ( "context" "strconv" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/entity" "github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/service" diff --git a/backend/application/singleagent/create.go b/backend/application/singleagent/create.go index 170fc52a..eaf81c61 100644 --- a/backend/application/singleagent/create.go +++ b/backend/application/singleagent/create.go @@ -20,10 +20,10 @@ import ( "context" "time" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent" - intelligence "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity" diff --git a/backend/application/singleagent/duplicate.go b/backend/application/singleagent/duplicate.go index 699b1828..373b3c18 100644 --- a/backend/application/singleagent/duplicate.go +++ b/backend/application/singleagent/duplicate.go @@ -19,9 +19,9 @@ package singleagent import ( "context" - intelligence "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossplugin" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" diff --git a/backend/application/singleagent/get.go b/backend/application/singleagent/get.go index a7e0369e..41ca6b1f 100644 --- a/backend/application/singleagent/get.go +++ b/backend/application/singleagent/get.go @@ -22,12 +22,13 @@ import ( "github.com/getkin/kin-openapi/openapi3" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + "github.com/coze-dev/coze-studio/backend/api/model/playground" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" + plugin_develop_common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" knowledge "github.com/coze-dev/coze-studio/backend/domain/knowledge/service" pluginEntity "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" @@ -318,7 +319,7 @@ func (s *SingleAgentApplicationService) pluginInfoDo2Vo(ctx context.Context, plu Description: ptr.Of(e.GetDesc()), PluginType: (*int64)(&e.PluginType), IconURL: &iconURL, - PluginStatus: (*int64)(ptr.Of(plugin_develop_common.PluginStatus_PUBLISHED)), + PluginStatus: (*int64)(ptr.Of(common.PluginStatus_PUBLISHED)), IsOfficial: func() *bool { if e.SpaceID == 0 { return ptr.Of(true) diff --git a/backend/application/singleagent/image.go b/backend/application/singleagent/image.go index c1625c3c..480a1d59 100644 --- a/backend/application/singleagent/image.go +++ b/backend/application/singleagent/image.go @@ -20,9 +20,9 @@ import ( "context" "strings" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/playground" ) func (s *SingleAgentApplicationService) GetUploadAuthToken(ctx context.Context, req *developer_api.GetUploadAuthTokenRequest) (*developer_api.GetUploadAuthTokenResponse, error) { diff --git a/backend/application/singleagent/publish.go b/backend/application/singleagent/publish.go index d66937e8..a231189b 100644 --- a/backend/application/singleagent/publish.go +++ b/backend/application/singleagent/publish.go @@ -23,10 +23,10 @@ import ( "sync" "time" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" search "github.com/coze-dev/coze-studio/backend/domain/search/entity" diff --git a/backend/application/singleagent/single_agent.go b/backend/application/singleagent/single_agent.go index c0b69924..91f51777 100644 --- a/backend/application/singleagent/single_agent.go +++ b/backend/application/singleagent/single_agent.go @@ -29,13 +29,14 @@ import ( "github.com/bytedance/sonic" "github.com/getkin/kin-openapi/openapi3" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - intelligence "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossdatabase" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" @@ -636,7 +637,7 @@ func (s *SingleAgentApplicationService) ReportUserBehavior(ctx context.Context, return &playground.ReportUserBehaviorResponse{}, nil } -func (s *SingleAgentApplicationService) GetAgentOnlineInfo(ctx context.Context, req *playground.GetBotOnlineInfoReq) (*bot_common.OpenAPIBotInfo, error) { +func (s *SingleAgentApplicationService) GetAgentOnlineInfo(ctx context.Context, req *bot_open_api.GetBotOnlineInfoReq) (*bot_common.OpenAPIBotInfo, error) { uid := ctxutil.MustGetUIDFromApiAuthCtx(ctx) diff --git a/backend/application/template/template.go b/backend/application/template/template.go index 7e76c466..cfeed407 100644 --- a/backend/application/template/template.go +++ b/backend/application/template/template.go @@ -19,7 +19,7 @@ package template import ( "context" - productAPI "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" + productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" "github.com/coze-dev/coze-studio/backend/domain/template/entity" "github.com/coze-dev/coze-studio/backend/domain/template/repository" "github.com/coze-dev/coze-studio/backend/infra/contract/storage" diff --git a/backend/application/upload/icon.go b/backend/application/upload/icon.go index a0ac89d5..baca6253 100644 --- a/backend/application/upload/icon.go +++ b/backend/application/upload/icon.go @@ -43,10 +43,11 @@ import ( "github.com/google/uuid" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" + dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" "github.com/coze-dev/coze-studio/backend/api/model/file/upload" - "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/upload/entity" "github.com/coze-dev/coze-studio/backend/infra/contract/cache" @@ -356,7 +357,7 @@ func (u *UploadService) GetShortcutIcons(ctx context.Context) ([]*playground.Fil return fileList, nil } -func parseMultipartFormData(ctx context.Context, req *playground.UploadFileOpenRequest) (*multipart.Form, error) { +func parseMultipartFormData(ctx context.Context, req *bot_open_api.UploadFileOpenRequest) (*multipart.Form, error) { _, params, err := mime.ParseMediaType(req.ContentType) if err != nil { return nil, errorx.New(errno.ErrUploadInvalidContentTypeCode, errorx.KV("content-type", req.ContentType)) @@ -382,9 +383,9 @@ func genObjName(name string, id string) string { ) } -func (u *UploadService) UploadFileOpen(ctx context.Context, req *playground.UploadFileOpenRequest) (*playground.UploadFileOpenResponse, error) { - resp := playground.UploadFileOpenResponse{} - resp.File = new(playground.File) +func (u *UploadService) UploadFileOpen(ctx context.Context, req *bot_open_api.UploadFileOpenRequest) (*bot_open_api.UploadFileOpenResponse, error) { + resp := bot_open_api.UploadFileOpenResponse{} + resp.File = new(bot_open_api.File) uid := ctxutil.MustGetUIDFromApiAuthCtx(ctx) if uid == 0 { return nil, errorx.New(errno.ErrKnowledgePermissionCode, errorx.KV("msg", "session required")) diff --git a/backend/application/user/user.go b/backend/application/user/user.go index 029577d3..fced66fe 100644 --- a/backend/application/user/user.go +++ b/backend/application/user/user.go @@ -24,9 +24,9 @@ import ( "strconv" "strings" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/api/model/passport" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/user/entity" user "github.com/coze-dev/coze-studio/backend/domain/user/service" diff --git a/backend/application/workflow/workflow.go b/backend/application/workflow/workflow.go index 399e9742..b324ea03 100644 --- a/backend/application/workflow/workflow.go +++ b/backend/application/workflow/workflow.go @@ -29,14 +29,14 @@ import ( "github.com/cloudwego/eino/schema" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" pluginmodel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" - pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/playground" + pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" appknowledge "github.com/coze-dev/coze-studio/backend/application/knowledge" appmemory "github.com/coze-dev/coze-studio/backend/application/memory" diff --git a/backend/crossdomain/contract/crossvariables/crossvaribales.go b/backend/crossdomain/contract/crossvariables/crossvaribales.go index 1e523dde..6bcbd1ac 100644 --- a/backend/crossdomain/contract/crossvariables/crossvaribales.go +++ b/backend/crossdomain/contract/crossvariables/crossvaribales.go @@ -20,7 +20,7 @@ import ( "context" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" ) type Variables interface { diff --git a/backend/crossdomain/impl/variables/variables.go b/backend/crossdomain/impl/variables/variables.go index 18b8aa0f..1f365e0e 100644 --- a/backend/crossdomain/impl/variables/variables.go +++ b/backend/crossdomain/impl/variables/variables.go @@ -20,7 +20,8 @@ import ( "context" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossvariables" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service" diff --git a/backend/crossdomain/workflow/database/database.go b/backend/crossdomain/workflow/database/database.go index 8e5beb48..89c0086d 100644 --- a/backend/crossdomain/workflow/database/database.go +++ b/backend/crossdomain/workflow/database/database.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/cast" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/memory/database/service" nodedatabase "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/database" diff --git a/backend/crossdomain/workflow/plugin/plugin.go b/backend/crossdomain/workflow/plugin/plugin.go index 7f4ea090..c21d0a2c 100644 --- a/backend/crossdomain/workflow/plugin/plugin.go +++ b/backend/crossdomain/workflow/plugin/plugin.go @@ -29,8 +29,8 @@ import ( "github.com/cloudwego/eino/schema" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - workflow3 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" + workflow3 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/pluginutil" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/service" diff --git a/backend/crossdomain/workflow/variable/variable.go b/backend/crossdomain/workflow/variable/variable.go index 2415d775..5e901306 100644 --- a/backend/crossdomain/workflow/variable/variable.go +++ b/backend/crossdomain/workflow/variable/variable.go @@ -27,8 +27,8 @@ import ( "github.com/cloudwego/eino/compose" variablesModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable" diff --git a/backend/domain/agent/singleagent/entity/agent_draft_display_info.go b/backend/domain/agent/singleagent/entity/agent_draft_display_info.go index fe3f319c..4a68d623 100644 --- a/backend/domain/agent/singleagent/entity/agent_draft_display_info.go +++ b/backend/domain/agent/singleagent/entity/agent_draft_display_info.go @@ -16,7 +16,7 @@ package entity -import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" +import "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" type AgentDraftDisplayInfo struct { AgentID int64 diff --git a/backend/domain/agent/singleagent/entity/publish.go b/backend/domain/agent/singleagent/entity/publish.go index 29a4e659..01da1dab 100644 --- a/backend/domain/agent/singleagent/entity/publish.go +++ b/backend/domain/agent/singleagent/entity/publish.go @@ -17,7 +17,7 @@ package entity import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/types/consts" ) diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_chat_model.go b/backend/domain/agent/singleagent/internal/agentflow/node_chat_model.go index b4ad5d78..3d7abb02 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_chat_model.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_chat_model.go @@ -23,7 +23,7 @@ import ( "github.com/cloudwego/eino-ext/components/model/deepseek" "github.com/cloudwego/eino-ext/libs/acl/openai" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/infra/contract/chatmodel" "github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr" "github.com/coze-dev/coze-studio/backend/pkg/errorx" diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_retriever.go b/backend/domain/agent/singleagent/internal/agentflow/node_retriever.go index 49c34228..4d42e0bf 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_retriever.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_retriever.go @@ -24,8 +24,8 @@ import ( "github.com/cloudwego/eino/schema" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossknowledge" knowledgeEntity "github.com/coze-dev/coze-studio/backend/domain/knowledge/entity" "github.com/coze-dev/coze-studio/backend/domain/knowledge/service" diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_suggest_graph.go b/backend/domain/agent/singleagent/internal/agentflow/node_suggest_graph.go index cab277c0..4fe2c638 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_suggest_graph.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_suggest_graph.go @@ -23,7 +23,7 @@ import ( "github.com/cloudwego/eino/compose" "github.com/cloudwego/eino/schema" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/infra/contract/chatmodel" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" ) diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_database.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_database.go index 3af89bfa..8f0758a6 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_database.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_database.go @@ -30,9 +30,9 @@ import ( "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossdatabase" "github.com/coze-dev/coze-studio/backend/domain/memory/database/service" "github.com/coze-dev/coze-studio/backend/infra/impl/sqlparser" diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go index f811d6ce..65328b70 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go @@ -27,7 +27,7 @@ import ( "github.com/cloudwego/eino/schema" "github.com/getkin/kin-openapi/openapi3" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossknowledge" knowledgeEntity "github.com/coze-dev/coze-studio/backend/domain/knowledge/entity" ) diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_plugin.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_plugin.go index d5a54c93..48352857 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_plugin.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_plugin.go @@ -25,8 +25,8 @@ import ( "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossplugin" pluginEntity "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/service" diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_variables.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_variables.go index fd3ba0df..6d3f5c74 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_variables.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_variables.go @@ -23,8 +23,8 @@ import ( "github.com/cloudwego/eino/components/tool/utils" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossvariables" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/pkg/lang/conv" diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_workflow.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_workflow.go index a237d40b..ff6bb20c 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_workflow.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_workflow.go @@ -19,7 +19,7 @@ package agentflow import ( "context" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossworkflow" "github.com/coze-dev/coze-studio/backend/domain/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" diff --git a/backend/domain/agent/singleagent/internal/dal/agent_display_info.go b/backend/domain/agent/singleagent/internal/dal/agent_display_info.go index 1ea95c7b..f3c0e9db 100644 --- a/backend/domain/agent/singleagent/internal/dal/agent_display_info.go +++ b/backend/domain/agent/singleagent/internal/dal/agent_display_info.go @@ -22,7 +22,7 @@ import ( "errors" "fmt" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/infra/contract/cache" "github.com/coze-dev/coze-studio/backend/pkg/errorx" diff --git a/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go b/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go index 8e552ae1..8a879f00 100644 --- a/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go @@ -1,3 +1,19 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. @@ -5,7 +21,7 @@ package model import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "gorm.io/gorm" ) diff --git a/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go b/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go index 4de3ed86..6fce8009 100644 --- a/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go @@ -1,3 +1,19 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. @@ -5,7 +21,7 @@ package model import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "gorm.io/gorm" ) diff --git a/backend/domain/agent/singleagent/service/count_info.go b/backend/domain/agent/singleagent/service/count_info.go index bf065e18..0956300a 100644 --- a/backend/domain/agent/singleagent/service/count_info.go +++ b/backend/domain/agent/singleagent/service/count_info.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" ) func makeAgentPopupInfoKey(uid, agentID int64, agentPopupType playground.BotPopupType) string { diff --git a/backend/domain/agent/singleagent/service/publish.go b/backend/domain/agent/singleagent/service/publish.go index 252d077c..24136fa3 100644 --- a/backend/domain/agent/singleagent/service/publish.go +++ b/backend/domain/agent/singleagent/service/publish.go @@ -21,7 +21,7 @@ import ( "sort" "time" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossconnector" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/pkg/lang/conv" diff --git a/backend/domain/agent/singleagent/service/single_agent.go b/backend/domain/agent/singleagent/service/single_agent.go index 3410a677..2026e2bb 100644 --- a/backend/domain/agent/singleagent/service/single_agent.go +++ b/backend/domain/agent/singleagent/service/single_agent.go @@ -21,7 +21,7 @@ import ( "github.com/cloudwego/eino/schema" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" ) diff --git a/backend/domain/agent/singleagent/service/single_agent_impl.go b/backend/domain/agent/singleagent/service/single_agent_impl.go index 29196068..c76b0b3f 100644 --- a/backend/domain/agent/singleagent/service/single_agent_impl.go +++ b/backend/domain/agent/singleagent/service/single_agent_impl.go @@ -26,7 +26,7 @@ import ( "github.com/cloudwego/eino/compose" "github.com/cloudwego/eino/schema" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossplugin" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/internal/agentflow" diff --git a/backend/domain/app/entity/app.go b/backend/domain/app/entity/app.go index cd2d13f8..5dfd12a0 100644 --- a/backend/domain/app/entity/app.go +++ b/backend/domain/app/entity/app.go @@ -17,8 +17,8 @@ package entity import ( - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" - publishAPI "github.com/coze-dev/coze-studio/backend/api/model/publish" + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" + publishAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish" resourceCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" ) diff --git a/backend/domain/app/entity/connector.go b/backend/domain/app/entity/connector.go index af1799c9..961d5529 100644 --- a/backend/domain/app/entity/connector.go +++ b/backend/domain/app/entity/connector.go @@ -17,7 +17,7 @@ package entity import ( - publishAPI "github.com/coze-dev/coze-studio/backend/api/model/publish" + publishAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish" "github.com/coze-dev/coze-studio/backend/types/consts" ) diff --git a/backend/domain/connector/entity/connector.go b/backend/domain/connector/entity/connector.go index 38875888..bd5533af 100644 --- a/backend/domain/connector/entity/connector.go +++ b/backend/domain/connector/entity/connector.go @@ -17,8 +17,8 @@ package entity import ( + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" "github.com/coze-dev/coze-studio/backend/pkg/lang/conv" ) diff --git a/backend/domain/knowledge/service/knowledge.go b/backend/domain/knowledge/service/knowledge.go index f1c5353a..8a7c1a25 100644 --- a/backend/domain/knowledge/service/knowledge.go +++ b/backend/domain/knowledge/service/knowledge.go @@ -34,9 +34,9 @@ import ( "github.com/bytedance/sonic" "gorm.io/gorm" + "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/knowledge/entity" "github.com/coze-dev/coze-studio/backend/domain/knowledge/internal/consts" diff --git a/backend/domain/memory/database/entity/database.go b/backend/domain/memory/database/entity/database.go index b0da5798..54803924 100644 --- a/backend/domain/memory/database/entity/database.go +++ b/backend/domain/memory/database/entity/database.go @@ -19,8 +19,8 @@ package entity import ( "github.com/xuri/excelize/v2" - "github.com/coze-dev/coze-studio/backend/api/model/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" ) type Database = database.Database @@ -54,16 +54,16 @@ type TableReaderMeta struct { StartLineIdx int64 ReaderMethod database.TableReadDataMethod ReadLineCnt int64 - Schema []*common.DocTableColumn + Schema []*knowledge.DocTableColumn } type TableReaderSheetData struct { - Columns []*common.DocTableColumn + Columns []*knowledge.DocTableColumn SampleData [][]string } type ExcelExtraInfo struct { - Sheets []*common.DocTableSheet + Sheets []*knowledge.DocTableSheet ExtensionName string // extension FileSize int64 // file size SourceFileID int64 @@ -80,7 +80,7 @@ type LocalTableMeta struct { } type ColumnInfo struct { - ColumnType common.ColumnType + ColumnType knowledge.ColumnType ContainsEmptyValue bool } diff --git a/backend/domain/memory/database/internal/convertor/database.go b/backend/domain/memory/database/internal/convertor/database.go index a8dfffde..c2655d18 100644 --- a/backend/domain/memory/database/internal/convertor/database.go +++ b/backend/domain/memory/database/internal/convertor/database.go @@ -19,7 +19,7 @@ package convertor import ( "fmt" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/infra/contract/rdb/entity" ) diff --git a/backend/domain/memory/database/internal/convertor/types.go b/backend/domain/memory/database/internal/convertor/types.go index 486d586d..1a90ab55 100644 --- a/backend/domain/memory/database/internal/convertor/types.go +++ b/backend/domain/memory/database/internal/convertor/types.go @@ -22,7 +22,7 @@ import ( "time" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/infra/contract/rdb/entity" ) diff --git a/backend/domain/memory/database/internal/dal/agent_to_database.go b/backend/domain/memory/database/internal/dal/agent_to_database.go index 0569dcc9..698a58bf 100644 --- a/backend/domain/memory/database/internal/dal/agent_to_database.go +++ b/backend/domain/memory/database/internal/dal/agent_to_database.go @@ -24,7 +24,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/query" "github.com/coze-dev/coze-studio/backend/infra/contract/idgen" diff --git a/backend/domain/memory/database/internal/dal/draft_database_info.go b/backend/domain/memory/database/internal/dal/draft_database_info.go index f5488b82..4d51c91c 100644 --- a/backend/domain/memory/database/internal/dal/draft_database_info.go +++ b/backend/domain/memory/database/internal/dal/draft_database_info.go @@ -27,7 +27,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/query" diff --git a/backend/domain/memory/database/internal/dal/online_database_info.go b/backend/domain/memory/database/internal/dal/online_database_info.go index ccfd7fda..86d80320 100644 --- a/backend/domain/memory/database/internal/dal/online_database_info.go +++ b/backend/domain/memory/database/internal/dal/online_database_info.go @@ -27,7 +27,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/query" diff --git a/backend/domain/memory/database/internal/physicaltable/physical.go b/backend/domain/memory/database/internal/physicaltable/physical.go index 6bfcd371..a230f9ec 100644 --- a/backend/domain/memory/database/internal/physicaltable/physical.go +++ b/backend/domain/memory/database/internal/physicaltable/physical.go @@ -22,7 +22,7 @@ import ( "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/convertor" "github.com/coze-dev/coze-studio/backend/infra/contract/rdb" entity3 "github.com/coze-dev/coze-studio/backend/infra/contract/rdb/entity" diff --git a/backend/domain/memory/database/internal/sheet/sheet.go b/backend/domain/memory/database/internal/sheet/sheet.go index f421e84e..45f90994 100644 --- a/backend/domain/memory/database/internal/sheet/sheet.go +++ b/backend/domain/memory/database/internal/sheet/sheet.go @@ -35,8 +35,8 @@ import ( "github.com/extrame/xls" "github.com/xuri/excelize/v2" - "github.com/coze-dev/coze-studio/backend/api/model/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/infra/contract/storage" "github.com/coze-dev/coze-studio/backend/pkg/errorx" @@ -47,8 +47,8 @@ import ( type CellTypeIdentifier struct { Priority int64 - IdentifyCellType func(cellValue string) *common.ColumnType - TargetColumnType common.ColumnType + IdentifyCellType func(cellValue string) *knowledge.ColumnType + TargetColumnType knowledge.ColumnType } var ( @@ -102,7 +102,7 @@ func (t *TosTableParser) GetTableDataBySheetIDx(ctx context.Context, rMeta entit return nil, nil, ocErr } for i := range meta.SheetsRowCount { - extra.Sheets = append(extra.Sheets, &common.DocTableSheet{ + extra.Sheets = append(extra.Sheets, &knowledge.DocTableSheet{ ID: int64(i), SheetName: meta.SheetsNameList[i], TotalRow: int64(meta.SheetsRowCount[i]), @@ -205,7 +205,7 @@ func (t *TosTableParser) getTableDataBySheetIdx(ctx context.Context, rMeta entit } res := &entity.TableReaderSheetData{ - Columns: make([]*common.DocTableColumn, 0), + Columns: make([]*knowledge.DocTableColumn, 0), } defer func() { if localMeta != nil && localMeta.ExcelFile != nil { @@ -226,7 +226,7 @@ func (t *TosTableParser) getTableDataBySheetIdx(ctx context.Context, rMeta entit } for colIndex, cell := range headLine { - res.Columns = append(res.Columns, &common.DocTableColumn{ + res.Columns = append(res.Columns, &knowledge.DocTableColumn{ ColumnName: cell, Sequence: int64(colIndex), }) @@ -454,10 +454,10 @@ func getXlsLocalSheetMetaWithTmpFileCallback(ctx context.Context, tmpFile string }, nil } -func (t *TosTableParser) PredictColumnType(columns []*common.DocTableColumn, sampleData [][]string, sheetIdx, startLineIdx int64) ([]*common.DocTableColumn, error) { +func (t *TosTableParser) PredictColumnType(columns []*knowledge.DocTableColumn, sampleData [][]string, sheetIdx, startLineIdx int64) ([]*knowledge.DocTableColumn, error) { if len(sampleData) == 0 { for _, column := range columns { - column.ColumnType = common.ColumnTypePtr(common.ColumnType_Text) // bottom line display + column.ColumnType = knowledge.ColumnTypePtr(knowledge.ColumnType_Text) // bottom line display column.ContainsEmptyValue = ptr.Of(true) } return columns, nil @@ -516,8 +516,8 @@ func transposeExcelContent(excelContent [][]string, columnCount int) [][]string return transposedExcelContent } -func predictColumnType(columnContent []string) (common.ColumnType, bool) { - columnType := common.ColumnType_Text +func predictColumnType(columnContent []string) (knowledge.ColumnType, bool) { + columnType := knowledge.ColumnType_Text containsEmptyValue := false for i, col := range columnContent { if col == "" { @@ -532,7 +532,7 @@ func predictColumnType(columnContent []string) (common.ColumnType, bool) { } if GetColumnTypeCategory(columnType) != GetColumnTypeCategory(cellType) { - return common.ColumnType_Text, containsEmptyValue + return knowledge.ColumnType_Text, containsEmptyValue } if GetColumnTypePriority(cellType) < GetColumnTypePriority(columnType) { @@ -542,7 +542,7 @@ func predictColumnType(columnContent []string) (common.ColumnType, bool) { return columnType, containsEmptyValue } -func GetColumnTypePriority(columnType common.ColumnType) int64 { +func GetColumnTypePriority(columnType knowledge.ColumnType) int64 { for _, identifier := range identifierChain { if identifier.TargetColumnType == columnType { return identifier.Priority @@ -551,16 +551,16 @@ func GetColumnTypePriority(columnType common.ColumnType) int64 { return 0 } -func GetColumnTypeCategory(columnType common.ColumnType) database.ColumnTypeCategory { - if columnType == common.ColumnType_Number || columnType == common.ColumnType_Float { +func GetColumnTypeCategory(columnType knowledge.ColumnType) database.ColumnTypeCategory { + if columnType == knowledge.ColumnType_Number || columnType == knowledge.ColumnType_Float { return database.ColumnTypeCategoryNumber } return database.ColumnTypeCategoryText } -func GetCellType(cellValue string) common.ColumnType { +func GetCellType(cellValue string) knowledge.ColumnType { InitIdentifier() - cellTypeResult := common.ColumnType_Text + cellTypeResult := knowledge.ColumnType_Text for _, identifier := range identifierChain { cellType := identifier.IdentifyCellType(cellValue) if cellType != nil { @@ -571,40 +571,40 @@ func GetCellType(cellValue string) common.ColumnType { return cellTypeResult } -func IdentifyNumber(cellValue string) *common.ColumnType { +func IdentifyNumber(cellValue string) *knowledge.ColumnType { _, err := strconv.ParseInt(cellValue, 10, 64) if err != nil { return nil } - return common.ColumnTypePtr(common.ColumnType_Number) + return knowledge.ColumnTypePtr(knowledge.ColumnType_Number) } -func IdentifyFloat(cellValue string) *common.ColumnType { +func IdentifyFloat(cellValue string) *knowledge.ColumnType { _, err := strconv.ParseFloat(cellValue, 64) if err != nil { return nil } - return common.ColumnTypePtr(common.ColumnType_Float) + return knowledge.ColumnTypePtr(knowledge.ColumnType_Float) } -func IdentifyBoolean(cellValue string) *common.ColumnType { +func IdentifyBoolean(cellValue string) *knowledge.ColumnType { lowerCellValue := strings.ToLower(cellValue) if lowerCellValue != "true" && lowerCellValue != "false" { return nil } - return common.ColumnTypePtr(common.ColumnType_Boolean) + return knowledge.ColumnTypePtr(knowledge.ColumnType_Boolean) } -func IdentifyDate(cellValue string) *common.ColumnType { +func IdentifyDate(cellValue string) *knowledge.ColumnType { matched, err := regexp.MatchString(dateTimePattern, cellValue) if err != nil || !matched { return nil } - return common.ColumnTypePtr(common.ColumnType_Date) + return knowledge.ColumnTypePtr(knowledge.ColumnType_Date) } -func IdentifyText(cellValue string) *common.ColumnType { - return common.ColumnTypePtr(common.ColumnType_Text) +func IdentifyText(cellValue string) *knowledge.ColumnType { + return knowledge.ColumnTypePtr(knowledge.ColumnType_Text) } func InitIdentifier() { @@ -613,27 +613,27 @@ func InitIdentifier() { { Priority: 5, IdentifyCellType: IdentifyNumber, - TargetColumnType: common.ColumnType_Number, + TargetColumnType: knowledge.ColumnType_Number, }, { Priority: 4, IdentifyCellType: IdentifyFloat, - TargetColumnType: common.ColumnType_Float, + TargetColumnType: knowledge.ColumnType_Float, }, { Priority: 3, IdentifyCellType: IdentifyBoolean, - TargetColumnType: common.ColumnType_Boolean, + TargetColumnType: knowledge.ColumnType_Boolean, }, { Priority: 2, IdentifyCellType: IdentifyDate, - TargetColumnType: common.ColumnType_Date, + TargetColumnType: knowledge.ColumnType_Date, }, { Priority: 1, IdentifyCellType: IdentifyText, - TargetColumnType: common.ColumnType_Text, + TargetColumnType: knowledge.ColumnType_Text, }, } @@ -686,7 +686,7 @@ func getDateTimeRegExp(datePatternList []string, timePatterList []string) string return fmt.Sprintf("^(%s)( +(%s))?$", datePattern, timePattern) } -func (t *TosTableParser) TransferPreviewData(ctx context.Context, columns []*common.DocTableColumn, sampleData [][]string, previewLine int) (previewData []map[int64]string, err error) { +func (t *TosTableParser) TransferPreviewData(ctx context.Context, columns []*knowledge.DocTableColumn, sampleData [][]string, previewLine int) (previewData []map[int64]string, err error) { previewData = make([]map[int64]string, 0) for idx, line := range sampleData { @@ -710,7 +710,7 @@ func (t *TosTableParser) TransferPreviewData(ctx context.Context, columns []*com return previewData, nil } -func CheckSheetIsValid(fields []*database.FieldItem, parsedColumns []*common.DocTableColumn, sheet *entity.ExcelExtraInfo) (bool, *string) { +func CheckSheetIsValid(fields []*database.FieldItem, parsedColumns []*knowledge.DocTableColumn, sheet *entity.ExcelExtraInfo) (bool, *string) { if len(fields) != len(parsedColumns) { return false, ptr.Of("field number not match") } diff --git a/backend/domain/memory/database/repository/repository.go b/backend/domain/memory/database/repository/repository.go index 2c326e1a..c4a8e597 100644 --- a/backend/domain/memory/database/repository/repository.go +++ b/backend/domain/memory/database/repository/repository.go @@ -22,7 +22,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal/query" diff --git a/backend/domain/memory/database/service/database.go b/backend/domain/memory/database/service/database.go index 8a0da15e..9852c64d 100644 --- a/backend/domain/memory/database/service/database.go +++ b/backend/domain/memory/database/service/database.go @@ -19,10 +19,10 @@ package service import ( "context" - "github.com/coze-dev/coze-studio/backend/api/model/common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge" "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" ) @@ -189,8 +189,8 @@ type GetDatabaseTableSchemaRequest struct { } type GetDatabaseTableSchemaResponse struct { - SheetList []*common.DocTableSheet - TableMeta []*common.DocTableColumn + SheetList []*knowledge.DocTableSheet + TableMeta []*knowledge.DocTableColumn PreviewData []map[int64]string } diff --git a/backend/domain/memory/database/service/database_impl.go b/backend/domain/memory/database/service/database_impl.go index 4808f433..d160dd67 100644 --- a/backend/domain/memory/database/service/database_impl.go +++ b/backend/domain/memory/database/service/database_impl.go @@ -33,9 +33,9 @@ import ( "github.com/coze-dev/coze-studio/backend/infra/contract/cache" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossvariables" entity2 "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/convertor" diff --git a/backend/domain/memory/database/service/database_impl_test.go b/backend/domain/memory/database/service/database_impl_test.go index 770b19b0..2f7fd9b5 100644 --- a/backend/domain/memory/database/service/database_impl_test.go +++ b/backend/domain/memory/database/service/database_impl_test.go @@ -31,7 +31,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" - "github.com/coze-dev/coze-studio/backend/api/model/table" + "github.com/coze-dev/coze-studio/backend/api/model/data/database/table" entity2 "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/database/internal/dal" "github.com/coze-dev/coze-studio/backend/domain/memory/database/repository" diff --git a/backend/domain/memory/variables/entity/sys_variables.go b/backend/domain/memory/variables/entity/sys_variables.go index 68bacf9e..0c6922d5 100644 --- a/backend/domain/memory/variables/entity/sys_variables.go +++ b/backend/domain/memory/variables/entity/sys_variables.go @@ -20,8 +20,8 @@ import ( "sort" "strings" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type SysConfVariables []*kvmemory.VariableInfo diff --git a/backend/domain/memory/variables/entity/variable_instance.go b/backend/domain/memory/variables/entity/variable_instance.go index d7ce33a9..43954bd8 100644 --- a/backend/domain/memory/variables/entity/variable_instance.go +++ b/backend/domain/memory/variables/entity/variable_instance.go @@ -25,8 +25,8 @@ import ( "time" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/pkg/errorx" "github.com/coze-dev/coze-studio/backend/types/errno" ) diff --git a/backend/domain/memory/variables/entity/variable_meta.go b/backend/domain/memory/variables/entity/variable_meta.go index daccc99e..15d6d115 100644 --- a/backend/domain/memory/variables/entity/variable_meta.go +++ b/backend/domain/memory/variables/entity/variable_meta.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type VariableMeta struct { diff --git a/backend/domain/memory/variables/entity/variables_meta.go b/backend/domain/memory/variables/entity/variables_meta.go index 6c368aa2..902f2f23 100644 --- a/backend/domain/memory/variables/entity/variables_meta.go +++ b/backend/domain/memory/variables/entity/variables_meta.go @@ -19,8 +19,8 @@ package entity import ( "fmt" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" ) type VariablesMeta struct { diff --git a/backend/domain/memory/variables/internal/dal/variable_instance.go b/backend/domain/memory/variables/internal/dal/variable_instance.go index 03946341..ee4b5c7a 100644 --- a/backend/domain/memory/variables/internal/dal/variable_instance.go +++ b/backend/domain/memory/variables/internal/dal/variable_instance.go @@ -22,7 +22,7 @@ import ( "gorm.io/gen" "gorm.io/gorm" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/internal/dal/query" diff --git a/backend/domain/memory/variables/internal/dal/variables_meta.go b/backend/domain/memory/variables/internal/dal/variables_meta.go index 8f659249..969398f8 100644 --- a/backend/domain/memory/variables/internal/dal/variables_meta.go +++ b/backend/domain/memory/variables/internal/dal/variables_meta.go @@ -23,7 +23,7 @@ import ( "gorm.io/gen" "gorm.io/gorm" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/internal/dal/query" diff --git a/backend/domain/memory/variables/repository/repository.go b/backend/domain/memory/variables/repository/repository.go index b4779766..5c7ed982 100644 --- a/backend/domain/memory/variables/repository/repository.go +++ b/backend/domain/memory/variables/repository/repository.go @@ -21,7 +21,7 @@ import ( "gorm.io/gorm" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/internal/dal" "github.com/coze-dev/coze-studio/backend/infra/contract/idgen" diff --git a/backend/domain/memory/variables/service/variables.go b/backend/domain/memory/variables/service/variables.go index 96b4b195..acc6559c 100644 --- a/backend/domain/memory/variables/service/variables.go +++ b/backend/domain/memory/variables/service/variables.go @@ -19,8 +19,8 @@ package service import ( "context" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" ) diff --git a/backend/domain/memory/variables/service/variables_impl.go b/backend/domain/memory/variables/service/variables_impl.go index d78fa3e3..2e77be43 100644 --- a/backend/domain/memory/variables/service/variables_impl.go +++ b/backend/domain/memory/variables/service/variables_impl.go @@ -22,8 +22,8 @@ import ( "sort" "time" - "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" "github.com/coze-dev/coze-studio/backend/domain/memory/variables/repository" "github.com/coze-dev/coze-studio/backend/pkg/errorx" diff --git a/backend/domain/plugin/conf/load_plugin.go b/backend/domain/plugin/conf/load_plugin.go index 9b31ee2a..30e8b1d0 100644 --- a/backend/domain/plugin/conf/load_plugin.go +++ b/backend/domain/plugin/conf/load_plugin.go @@ -29,7 +29,7 @@ import ( "gopkg.in/yaml.v3" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" "github.com/coze-dev/coze-studio/backend/pkg/logs" diff --git a/backend/domain/plugin/entity/plugin.go b/backend/domain/plugin/entity/plugin.go index c774104a..832a5170 100644 --- a/backend/domain/plugin/entity/plugin.go +++ b/backend/domain/plugin/entity/plugin.go @@ -25,7 +25,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/pkg/lang/ptr" "github.com/coze-dev/coze-studio/backend/pkg/logs" ) @@ -149,7 +149,7 @@ func NewDefaultPluginManifest() *PluginManifest { Auth: &model.AuthV2{ Type: model.AuthzTypeOfNone, }, - CommonParams: map[model.HTTPParamLocation][]*plugin_develop_common.CommonParamSchema{ + CommonParams: map[model.HTTPParamLocation][]*common.CommonParamSchema{ model.ParamInBody: {}, model.ParamInHeader: { { diff --git a/backend/domain/plugin/internal/dal/plugin.go b/backend/domain/plugin/internal/dal/plugin.go index 4204c950..7c519188 100644 --- a/backend/domain/plugin/internal/dal/plugin.go +++ b/backend/domain/plugin/internal/dal/plugin.go @@ -26,7 +26,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + plugin_develop_common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/query" diff --git a/backend/domain/plugin/internal/dal/plugin_draft.go b/backend/domain/plugin/internal/dal/plugin_draft.go index c4341b95..b231a312 100644 --- a/backend/domain/plugin/internal/dal/plugin_draft.go +++ b/backend/domain/plugin/internal/dal/plugin_draft.go @@ -26,7 +26,7 @@ import ( "gorm.io/gorm" pluginModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + plugin_develop_common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/conf" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/model" diff --git a/backend/domain/plugin/internal/dal/plugin_version.go b/backend/domain/plugin/internal/dal/plugin_version.go index 2f93ff40..c1acfd7a 100644 --- a/backend/domain/plugin/internal/dal/plugin_version.go +++ b/backend/domain/plugin/internal/dal/plugin_version.go @@ -25,7 +25,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + plugin_develop_common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/model" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/query" diff --git a/backend/domain/plugin/internal/dal/tool_draft.go b/backend/domain/plugin/internal/dal/tool_draft.go index dfb06355..e12746ce 100644 --- a/backend/domain/plugin/internal/dal/tool_draft.go +++ b/backend/domain/plugin/internal/dal/tool_draft.go @@ -26,7 +26,7 @@ import ( "gorm.io/gorm" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/conf" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal/model" diff --git a/backend/domain/plugin/repository/plugin_impl.go b/backend/domain/plugin/repository/plugin_impl.go index 1b67cff8..2c2949c5 100644 --- a/backend/domain/plugin/repository/plugin_impl.go +++ b/backend/domain/plugin/repository/plugin_impl.go @@ -26,7 +26,7 @@ import ( "gorm.io/gorm" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" pluginConf "github.com/coze-dev/coze-studio/backend/domain/plugin/conf" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/dal" diff --git a/backend/domain/plugin/service/exec_tool.go b/backend/domain/plugin/service/exec_tool.go index b02fa8a0..8ec69b50 100644 --- a/backend/domain/plugin/service/exec_tool.go +++ b/backend/domain/plugin/service/exec_tool.go @@ -35,8 +35,8 @@ import ( model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" - "github.com/coze-dev/coze-studio/backend/api/model/project_memory" + "github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossvariables" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/internal/encoder" diff --git a/backend/domain/plugin/service/plugin_draft.go b/backend/domain/plugin/service/plugin_draft.go index 89cd9a50..e7ab069f 100644 --- a/backend/domain/plugin/service/plugin_draft.go +++ b/backend/domain/plugin/service/plugin_draft.go @@ -30,8 +30,8 @@ import ( model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" searchModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" + plugin_develop_common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" diff --git a/backend/domain/plugin/service/plugin_oauth.go b/backend/domain/plugin/service/plugin_oauth.go index 6e756a0a..2c8b0597 100644 --- a/backend/domain/plugin/service/plugin_oauth.go +++ b/backend/domain/plugin/service/plugin_oauth.go @@ -28,7 +28,7 @@ import ( "golang.org/x/oauth2" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/conf" "github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" diff --git a/backend/domain/plugin/service/plugin_online.go b/backend/domain/plugin/service/plugin_online.go index 57e71fa0..044023ab 100644 --- a/backend/domain/plugin/service/plugin_online.go +++ b/backend/domain/plugin/service/plugin_online.go @@ -23,7 +23,7 @@ import ( model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" searchModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search" - pluginCommon "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + pluginCommon "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch" pluginConf "github.com/coze-dev/coze-studio/backend/domain/plugin/conf" diff --git a/backend/domain/plugin/service/plugin_release.go b/backend/domain/plugin/service/plugin_release.go index f90bffe6..3f0a8590 100644 --- a/backend/domain/plugin/service/plugin_release.go +++ b/backend/domain/plugin/service/plugin_release.go @@ -25,7 +25,7 @@ import ( "golang.org/x/mod/semver" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/domain/plugin/repository" "github.com/coze-dev/coze-studio/backend/pkg/errorx" diff --git a/backend/domain/plugin/service/service.go b/backend/domain/plugin/service/service.go index 22532c00..01ec2b94 100644 --- a/backend/domain/plugin/service/service.go +++ b/backend/domain/plugin/service/service.go @@ -25,7 +25,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" + common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common" "github.com/coze-dev/coze-studio/backend/domain/plugin/entity" "github.com/coze-dev/coze-studio/backend/pkg/errorx" "github.com/coze-dev/coze-studio/backend/types/errno" diff --git a/backend/domain/search/entity/project_doc.go b/backend/domain/search/entity/project_doc.go index 2868bbe5..064d4c8f 100644 --- a/backend/domain/search/entity/project_doc.go +++ b/backend/domain/search/entity/project_doc.go @@ -16,7 +16,7 @@ package entity -import "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" +import "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" type ProjectDocument struct { ID int64 `json:"id"` diff --git a/backend/domain/search/entity/search.go b/backend/domain/search/entity/search.go index 0a03fdac..b150bce9 100644 --- a/backend/domain/search/entity/search.go +++ b/backend/domain/search/entity/search.go @@ -17,8 +17,8 @@ package entity import ( + "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common" model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) const ( diff --git a/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go b/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go index d2904c43..29afbdf9 100644 --- a/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go +++ b/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go @@ -1,10 +1,26 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. package model -import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" +import "github.com/coze-dev/coze-studio/backend/api/model/playground" const TableNameShortcutCommand = "shortcut_command" diff --git a/backend/domain/template/internal/dal/model/template.gen.go b/backend/domain/template/internal/dal/model/template.gen.go index 49395d1f..57db3a45 100644 --- a/backend/domain/template/internal/dal/model/template.gen.go +++ b/backend/domain/template/internal/dal/model/template.gen.go @@ -1,10 +1,26 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. package model -import "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api" +import product_public_api "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api" const TableNameTemplate = "template" diff --git a/backend/domain/workflow/crossdomain/plugin/plugin.go b/backend/domain/workflow/crossdomain/plugin/plugin.go index 0801320b..2810048c 100644 --- a/backend/domain/workflow/crossdomain/plugin/plugin.go +++ b/backend/domain/workflow/crossdomain/plugin/plugin.go @@ -22,7 +22,7 @@ import ( "github.com/cloudwego/eino/components/tool" "github.com/cloudwego/eino/schema" - workflow3 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow3 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" "github.com/coze-dev/coze-studio/backend/domain/workflow/internal/execute" ) diff --git a/backend/domain/workflow/entity/interrupt_event.go b/backend/domain/workflow/entity/interrupt_event.go index 202d6fdd..39734fb8 100644 --- a/backend/domain/workflow/entity/interrupt_event.go +++ b/backend/domain/workflow/entity/interrupt_event.go @@ -22,7 +22,7 @@ import ( "github.com/bytedance/sonic" "github.com/cloudwego/eino/compose" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" ) diff --git a/backend/domain/workflow/entity/message.go b/backend/domain/workflow/entity/message.go index 12850f92..d24669ad 100644 --- a/backend/domain/workflow/entity/message.go +++ b/backend/domain/workflow/entity/message.go @@ -19,7 +19,7 @@ package entity import ( "github.com/cloudwego/eino/schema" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" ) diff --git a/backend/domain/workflow/entity/vo/canvas.go b/backend/domain/workflow/entity/vo/canvas.go index 5f410332..f8e04b52 100644 --- a/backend/domain/workflow/entity/vo/canvas.go +++ b/backend/domain/workflow/entity/vo/canvas.go @@ -17,7 +17,7 @@ package vo import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model" "github.com/coze-dev/coze-studio/backend/pkg/i18n" "github.com/coze-dev/coze-studio/backend/pkg/lang/ternary" diff --git a/backend/domain/workflow/entity/vo/meta.go b/backend/domain/workflow/entity/vo/meta.go index c262f263..a8897525 100644 --- a/backend/domain/workflow/entity/vo/meta.go +++ b/backend/domain/workflow/entity/vo/meta.go @@ -19,7 +19,7 @@ package vo import ( "time" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" ) type ContentType = workflow.WorkFlowType diff --git a/backend/domain/workflow/entity/vo/plugin_tool_info.go b/backend/domain/workflow/entity/vo/plugin_tool_info.go index ce577bc0..095514c6 100644 --- a/backend/domain/workflow/entity/vo/plugin_tool_info.go +++ b/backend/domain/workflow/entity/vo/plugin_tool_info.go @@ -17,7 +17,7 @@ package vo import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/pkg/sonic" ) diff --git a/backend/domain/workflow/entity/vo/workflow_info.go b/backend/domain/workflow/entity/vo/workflow_info.go index 4dddeab5..4dd1dfea 100644 --- a/backend/domain/workflow/entity/vo/workflow_info.go +++ b/backend/domain/workflow/entity/vo/workflow_info.go @@ -17,7 +17,7 @@ package vo import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/pkg/sonic" ) diff --git a/backend/domain/workflow/entity/vo/workflow_tool.go b/backend/domain/workflow/entity/vo/workflow_tool.go index 14d6066c..9055acac 100644 --- a/backend/domain/workflow/entity/vo/workflow_tool.go +++ b/backend/domain/workflow/entity/vo/workflow_tool.go @@ -16,7 +16,7 @@ package vo -import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" +import "github.com/coze-dev/coze-studio/backend/api/model/workflow" type WorkflowToolConfig struct { InputParametersConfig []*workflow.APIParameter diff --git a/backend/domain/workflow/entity/workflow.go b/backend/domain/workflow/entity/workflow.go index 384f7041..295a1e87 100644 --- a/backend/domain/workflow/entity/workflow.go +++ b/backend/domain/workflow/entity/workflow.go @@ -17,7 +17,7 @@ package entity import ( - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" ) diff --git a/backend/domain/workflow/entity/workflow_execution.go b/backend/domain/workflow/entity/workflow_execution.go index 7aeaf7e8..447aa82b 100644 --- a/backend/domain/workflow/entity/workflow_execution.go +++ b/backend/domain/workflow/entity/workflow_execution.go @@ -19,7 +19,7 @@ package entity import ( "time" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" ) diff --git a/backend/domain/workflow/interface.go b/backend/domain/workflow/interface.go index 72bd3c3c..b7a91097 100644 --- a/backend/domain/workflow/interface.go +++ b/backend/domain/workflow/interface.go @@ -21,8 +21,7 @@ import ( "github.com/cloudwego/eino/components/model" "github.com/cloudwego/eino/compose" - - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" "github.com/coze-dev/coze-studio/backend/infra/contract/idgen" diff --git a/backend/domain/workflow/internal/compose/state.go b/backend/domain/workflow/internal/compose/state.go index 2b85bcf0..f79c56de 100644 --- a/backend/domain/workflow/internal/compose/state.go +++ b/backend/domain/workflow/internal/compose/state.go @@ -26,7 +26,7 @@ import ( "github.com/cloudwego/eino/compose" "github.com/cloudwego/eino/schema" - workflow2 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow2 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" diff --git a/backend/domain/workflow/internal/execute/callback.go b/backend/domain/workflow/internal/execute/callback.go index b8674419..dc7e949e 100644 --- a/backend/domain/workflow/internal/execute/callback.go +++ b/backend/domain/workflow/internal/execute/callback.go @@ -35,7 +35,7 @@ import ( "github.com/cloudwego/eino/schema" callbacks2 "github.com/cloudwego/eino/utils/callbacks" - workflow2 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow2 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" diff --git a/backend/domain/workflow/internal/nodes/llm/llm.go b/backend/domain/workflow/internal/nodes/llm/llm.go index 7238cfd4..70ea763c 100644 --- a/backend/domain/workflow/internal/nodes/llm/llm.go +++ b/backend/domain/workflow/internal/nodes/llm/llm.go @@ -34,7 +34,7 @@ import ( callbacks2 "github.com/cloudwego/eino/utils/callbacks" "golang.org/x/exp/maps" - workflow3 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow3 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/knowledge" crossmodel "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model" diff --git a/backend/domain/workflow/internal/repo/repository.go b/backend/domain/workflow/internal/repo/repository.go index 9fe4fef6..6cb7ca7a 100644 --- a/backend/domain/workflow/internal/repo/repository.go +++ b/backend/domain/workflow/internal/repo/repository.go @@ -30,7 +30,7 @@ import ( "gorm.io/gen/field" "gorm.io/gorm" - workflow3 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow3 "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity" diff --git a/backend/domain/workflow/service/service_impl.go b/backend/domain/workflow/service/service_impl.go index 11e9abcb..58820be1 100644 --- a/backend/domain/workflow/service/service_impl.go +++ b/backend/domain/workflow/service/service_impl.go @@ -30,7 +30,7 @@ import ( "golang.org/x/sync/errgroup" "gorm.io/gorm" - cloudworkflow "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + cloudworkflow "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/application/base/ctxutil" "github.com/coze-dev/coze-studio/backend/domain/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/search" diff --git a/backend/domain/workflow/service/utils.go b/backend/domain/workflow/service/utils.go index 9665d430..18151d00 100644 --- a/backend/domain/workflow/service/utils.go +++ b/backend/domain/workflow/service/utils.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - cloudworkflow "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + cloudworkflow "github.com/coze-dev/coze-studio/backend/api/model/workflow" "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable" "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" "github.com/coze-dev/coze-studio/backend/domain/workflow/internal/canvas/adaptor" diff --git a/backend/infra/contract/chatmodel/protocol.go b/backend/infra/contract/chatmodel/protocol.go index c02a8736..715f95b9 100644 --- a/backend/infra/contract/chatmodel/protocol.go +++ b/backend/infra/contract/chatmodel/protocol.go @@ -16,7 +16,7 @@ package chatmodel -import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api" +import "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api" type Protocol string diff --git a/backend/internal/mock/domain/workflow/interface.go b/backend/internal/mock/domain/workflow/interface.go index 29fc1674..bc93e326 100644 --- a/backend/internal/mock/domain/workflow/interface.go +++ b/backend/internal/mock/domain/workflow/interface.go @@ -1,3 +1,19 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Code generated by MockGen. DO NOT EDIT. // Source: interface.go // @@ -16,7 +32,7 @@ import ( model "github.com/cloudwego/eino/components/model" compose "github.com/cloudwego/eino/compose" schema "github.com/cloudwego/eino/schema" - workflow "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow" + workflow "github.com/coze-dev/coze-studio/backend/api/model/workflow" workflow0 "github.com/coze-dev/coze-studio/backend/domain/workflow" entity "github.com/coze-dev/coze-studio/backend/domain/workflow/entity" vo "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" diff --git a/backend/types/ddl/gen_orm_query.go b/backend/types/ddl/gen_orm_query.go index 549e0230..be0004fc 100644 --- a/backend/types/ddl/gen_orm_query.go +++ b/backend/types/ddl/gen_orm_query.go @@ -30,11 +30,11 @@ import ( "gorm.io/gorm" "gorm.io/gorm/schema" + "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database" "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground" + "github.com/coze-dev/coze-studio/backend/api/model/playground" appEntity "github.com/coze-dev/coze-studio/backend/domain/app/entity" variableEntity "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity" ) diff --git a/frontend/infra/plugins/pkg-root-webpack-plugin/lib/index.d.ts b/frontend/infra/plugins/pkg-root-webpack-plugin/lib/index.d.ts index a371e44f..f13f0343 100644 --- a/frontend/infra/plugins/pkg-root-webpack-plugin/lib/index.d.ts +++ b/frontend/infra/plugins/pkg-root-webpack-plugin/lib/index.d.ts @@ -17,7 +17,7 @@ import OriginPkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin-origin'; type PkgRootWebpackPluginOptions = Record; declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin { - constructor(options?: Partial); + constructor(options?: Partial); } export default PkgRootWebpackPlugin; export { PkgRootWebpackPlugin }; diff --git a/frontend/packages/arch/api-schema/api.config.js b/frontend/packages/arch/api-schema/api.config.js index 49c6705e..2e1a5116 100644 --- a/frontend/packages/arch/api-schema/api.config.js +++ b/frontend/packages/arch/api-schema/api.config.js @@ -1,3 +1,19 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // apps/logistics/api.config.js const path = require('path'); @@ -7,8 +23,7 @@ const config = [ idlRoot: path.resolve(__dirname, '../../../../'), // IDL root directory entries: { passport: './idl/passport/passport.thrift', // Entry service name and path - explore: - './idl/flow/marketplace/flow_marketplace_product/public_api.thrift', + explore: './idl/marketplace/public_api.thrift', }, commonCodePath: path.resolve(__dirname, './src/api/config.ts'), // custom profile output: './src', // Product location diff --git a/frontend/packages/arch/api-schema/package.json b/frontend/packages/arch/api-schema/package.json index 5cc19f09..90c80b03 100644 --- a/frontend/packages/arch/api-schema/package.json +++ b/frontend/packages/arch/api-schema/package.json @@ -8,7 +8,7 @@ "exports": { ".": "./src/index.ts", "./passport": "./src/idl/passport/passport.ts", - "./marketplace": "./src/idl/flow/marketplace/flow_marketplace_product/public_api.ts" + "./marketplace": "./src/idl/marketplace/public_api.ts" }, "main": "src/index.ts", "typesVersions": { @@ -17,7 +17,7 @@ "./src/idl/passport/passport.ts" ], "marketplace": [ - "./src/idl/flow/marketplace/flow_marketplace_product/public_api.ts" + "./src/idl/marketplace/public_api.ts" ] } }, diff --git a/frontend/packages/arch/api-schema/src/_schemas.d.ts b/frontend/packages/arch/api-schema/src/_schemas.d.ts index 153c2e19..ce442385 100644 --- a/frontend/packages/arch/api-schema/src/_schemas.d.ts +++ b/frontend/packages/arch/api-schema/src/_schemas.d.ts @@ -16,3 +16,4 @@ declare const _schemas: any[]; export default _schemas; + \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/idl/base.ts b/frontend/packages/arch/api-schema/src/idl/base.ts index b1ddfb5c..9d2931a9 100644 --- a/frontend/packages/arch/api-schema/src/idl/base.ts +++ b/frontend/packages/arch/api-schema/src/idl/base.ts @@ -15,32 +15,32 @@ */ export interface TrafficEnv { - Open: boolean; - Env: string; + Open: boolean, + Env: string, } export interface Base { - LogID: string; - Caller: string; - Addr: string; - Client: string; - TrafficEnv?: TrafficEnv; + LogID: string, + Caller: string, + Addr: string, + Client: string, + TrafficEnv?: TrafficEnv, Extra?: { - [key: string | number]: string; - }; + [key: string | number]: string + }, } export interface BaseResp { - StatusMessage: string; - StatusCode: number; + StatusMessage: string, + StatusCode: number, Extra?: { - [key: string | number]: string; - }; + [key: string | number]: string + }, } export interface EmptyReq {} export interface EmptyData {} export interface EmptyResp { - code: number; - msg: string; - data: EmptyData; + code: number, + msg: string, + data: EmptyData, } export interface EmptyRpcReq {} -export interface EmptyRpcResp {} +export interface EmptyRpcResp {} \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/public_api.ts b/frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/public_api.ts deleted file mode 100644 index 4a1d4e95..00000000 --- a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/public_api.ts +++ /dev/null @@ -1,782 +0,0 @@ -/* - * Copyright 2025 coze-dev Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as marketplace_common from './../marketplace_common'; -export { marketplace_common }; -import * as product_common from './product_common'; -export { product_common }; -import * as base from './../../../base'; -export { base }; -import { createAPI } from './../../../../api/config'; -export const PublicGetProductList = /*#__PURE__*/ createAPI< - GetProductListRequest, - GetProductListResponse ->({ - url: '/api/marketplace/product/list', - method: 'GET', - name: 'PublicGetProductList', - reqType: 'GetProductListRequest', - reqMapping: { - body: [ - 'entity_type', - 'sort_type', - 'page_num', - 'page_size', - 'keyword', - 'publish_mode', - 'source', - 'current_entity_type', - 'preview_topic_id', - 'is_official', - 'need_extra', - 'entity_types', - 'is_free', - 'plugin_type', - ], - query: [ - 'category_id', - 'publish_platform_ids', - 'current_entity_id', - 'current_entity_version', - 'topic_id', - ], - header: ['Tt-Agw-Client-Ip'], - }, - resType: 'GetProductListResponse', - schemaRoot: - 'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api', - service: 'explore', -}); -export const PublicGetProductDetail = /*#__PURE__*/ createAPI< - GetProductDetailRequest, - GetProductDetailResponse ->({ - url: '/api/marketplace/product/detail', - method: 'GET', - name: 'PublicGetProductDetail', - reqType: 'GetProductDetailRequest', - reqMapping: { - query: ['product_id', 'entity_id'], - body: ['entity_type', 'need_audit_failed'], - header: ['Tt-Agw-Client-Ip'], - }, - resType: 'GetProductDetailResponse', - schemaRoot: - 'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api', - service: 'explore', -}); -export const PublicFavoriteProduct = /*#__PURE__*/ createAPI< - FavoriteProductRequest, - FavoriteProductResponse ->({ - url: '/api/marketplace/product/favorite', - method: 'POST', - name: 'PublicFavoriteProduct', - reqType: 'FavoriteProductRequest', - reqMapping: { - body: ['product_id', 'entity_type', 'is_cancel', 'entity_id', 'topic_id'], - header: ['Cookie'], - }, - resType: 'FavoriteProductResponse', - schemaRoot: - 'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api', - service: 'explore', -}); -export const PublicGetUserFavoriteListV2 = /*#__PURE__*/ createAPI< - GetUserFavoriteListV2Request, - GetUserFavoriteListV2Response ->({ - url: '/api/marketplace/product/favorite/list.v2', - method: 'GET', - name: 'PublicGetUserFavoriteListV2', - reqType: 'GetUserFavoriteListV2Request', - reqMapping: { - query: [ - 'cursor_id', - 'page_size', - 'entity_type', - 'sort_type', - 'keyword', - 'source', - 'need_user_trigger_config', - 'begin_at', - 'end_at', - 'entity_types', - 'organization_id', - ], - }, - resType: 'GetUserFavoriteListV2Response', - schemaRoot: - 'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api', - service: 'explore', -}); -export const PublicDuplicateProduct = /*#__PURE__*/ createAPI< - DuplicateProductRequest, - DuplicateProductResponse ->({ - url: '/api/marketplace/product/duplicate', - method: 'POST', - name: 'PublicDuplicateProduct', - reqType: 'DuplicateProductRequest', - reqMapping: { - body: ['product_id', 'entity_type', 'space_id', 'name'], - header: ['Cookie'], - }, - resType: 'DuplicateProductResponse', - schemaRoot: - 'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api', - service: 'explore', -}); -export interface FavoriteProductResponse { - code: number; - message: string; - is_first_favorite?: boolean; -} -export interface FavoriteProductRequest { - product_id?: string; - entity_type: product_common.ProductEntityType; - is_cancel?: boolean; - entity_id?: string; - topic_id?: string; - Cookie?: string; -} -export interface GetProductListRequest { - entity_type?: product_common.ProductEntityType; - category_id?: string; - sort_type: product_common.SortType; - page_num: number; - page_size: number; - /** 不为空则搜索 */ - keyword?: string; - /** 公开方式:1-开源;2-闭源 , // 公开方式 */ - publish_mode?: product_common.ProductPublishMode; - /** 发布渠道 */ - publish_platform_ids?: string[]; - /** 列表页 tab; 1-运营推荐 */ - source?: product_common.ProductListSource; - /** - * 个性化推荐场景, 传入当前的实体信息, 获取推荐的商品 - * 当前实体类型 - */ - current_entity_type?: product_common.ProductEntityType; - /** 当前实体 ID */ - current_entity_id?: string; - /** 当前实体版本 */ - current_entity_version?: string; - /** 专题场景 */ - topic_id?: string; - preview_topic_id?: string; - /** 是否需要过滤出官方商品 */ - is_official?: boolean; - /** 是否需要返回额外信息 */ - need_extra?: boolean; - /** 商品类型列表, 优先使用该参数,其次使用 EntityType */ - entity_types?: product_common.ProductEntityType[]; - /** true = 筛选免费的;false = 筛选付费的;不传则不区分免费和付费 */ - is_free?: boolean; - /** 插件类型 */ - plugin_type?: product_common.PluginType; - 'Tt-Agw-Client-Ip'?: string; -} -export interface GetProductListResponse { - code: number; - message: string; - data: GetProductListData; -} -export interface GetProductListData { - products?: ProductInfo[]; - has_more: boolean; - total: number; -} -export interface ProductInfo { - meta_info: ProductMetaInfo; - user_behavior?: UserBehaviorInfo; - commercial_setting?: product_common.CommercialSetting; - plugin_extra?: PluginExtraInfo; - bot_extra?: BotExtraInfo; - workflow_extra?: WorkflowExtraInfo; - social_scene_extra?: SocialSceneExtraInfo; - project_extra?: ProjectExtraInfo; -} -export interface SellerInfo { - id: string; - name: string; - avatar_url: string; -} -export interface ProductCategory { - id: string; - name: string; - icon_url: string; - active_icon_url: string; - index: number; - count: number; -} -export interface ProductLabel { - name: string; -} -export interface ProductMetaInfo { - id: string; - /** 商品/模板名称 */ - name: string; - /** 素材 ID,由 entity_type 来决定是 bot/plugin 的ID */ - entity_id: string; - /** 商品素材类型 */ - entity_type: product_common.ProductEntityType; - /** 商品/模板头像 */ - icon_url: string; - /** 热度:模板热度=复制量(用于卡片展示/排序);商品热度=不同商品有独立的计算逻辑(仅用于排序)—— heat的计算有一定延迟 */ - heat: number; - favorite_count: number; - /** 废弃,使用UserInfo代替 */ - seller: SellerInfo; - /** 商品描述 */ - description: string; - listed_at: string; - status: product_common.ProductStatus; - /** 商品/模板分类信息 */ - category?: ProductCategory; - /** 是否收藏 */ - is_favorited: boolean; - is_free: boolean; - /** 模板介绍/插件介绍(目前是富文本格式) */ - readme: string; - entity_version?: string; - labels?: ProductLabel[]; - user_info: product_common.UserInfo; - medium_icon_url: string; - origin_icon_url: string; - /** 模板封面 */ - covers?: product_common.ImageInfo[]; - /** 是否专业版特供 */ - is_professional?: boolean; - /** 是否为模板 */ - is_template: boolean; - /** 是否官方商品 */ - is_official: boolean; - /** 价格,当前只有模板有 */ - price?: marketplace_common.Price; -} -export interface UserBehaviorInfo { - /** - * 用户主页需要返回最近浏览/使用商品的时间 - * 最近浏览时间戳 - */ - viewed_at?: string; - /** 最近使用时间戳 */ - used_at?: string; -} -export enum PluginAuthMode { - /** 不需要授权 */ - NoAuth = 0, - /** 需要授权,但无授权配置 */ - Required = 1, - /** 需要授权,且已经配置 */ - Configured = 2, - /** 需要授权,但授权配置可能是用户级别,可由用户自己配置 */ - Supported = 3, -} -export interface PluginExtraInfo { - tools?: PluginToolInfo[]; - total_api_count: number; - bots_use_count: number; - /** 是否有隐私声明, 目前只有 PublicGetProductDetail 会取数据 */ - has_private_statement?: boolean; - /** 隐私声明, 目前只有 PublicGetProductDetail 会取数据 */ - private_statement?: string; - associated_bots_use_count: number; - is_premium: boolean; - is_official: boolean; - /** 调用量 */ - call_amount?: number; - /** 成功率 */ - success_rate?: number; - /** 平均执行时长 */ - avg_exec_time?: number; - is_default_icon?: boolean; - space_id?: string; - material_id?: string; - connectors: PluginConnectorInfo[]; - plugin_type?: product_common.PluginType; - /** for opencoze */ - auth_mode?: PluginAuthMode; -} -export interface ToolParameter { - name: string; - required: boolean; - description: string; - type: string; - sub_params: ToolParameter[]; -} -export interface CardInfo { - card_url: string; - /** 以下只有详情页返回 */ - card_id: string; - mapping_rule: string; - max_display_rows: string; - card_version: string; -} -export interface PluginToolExample { - req_example: string; - resp_example: string; -} -export enum PluginRunMode { - DefaultToSync = 0, - Sync = 1, - Async = 2, - Streaming = 3, -} -export interface PluginToolInfo { - id: string; - name: string; - description: string; - parameters?: ToolParameter[]; - card_info?: CardInfo; - example?: PluginToolExample; - /** 调用量 */ - call_amount?: number; - /** 成功率 */ - success_rate?: number; - /** 平均执行时长 */ - avg_exec_time?: number; - /** tool 被bot引用数 */ - bots_use_count?: number; - /** 运行模式 */ - run_mode?: PluginRunMode; -} -export interface PluginConnectorInfo { - id: string; - name: string; - icon: string; -} -export interface BotPublishPlatform { - id: string; - icon_url: string; - url: string; - name: string; -} -export interface ProductMaterial { - name: string; - icon_url: string; -} -export interface BotVoiceInfo { - id: string; - language_code: string; - language_name: string; - name: string; - style_id: string; - is_support_voice_call: boolean; -} -export enum TimeCapsuleMode { - Off = 0, - On = 1, -} -export enum FileboxInfoMode { - Off = 0, - On = 1, -} -export interface UserQueryCollectConf { - /** - * bot用户query收集配置 - * 是否开启收集开关 - */ - is_collected: boolean; - /** 隐私协议链接 */ - private_policy: string; -} -export interface BotConfig { - /** 模型 */ - models?: ProductMaterial[]; - /** 插件 */ - plugins?: ProductMaterial[]; - /** 知识库 */ - knowledges?: ProductMaterial[]; - /** 工作流 */ - workflows?: ProductMaterial[]; - /** 私有插件数量 */ - private_plugins_count?: number; - /** 私有知识库数量 */ - private_knowledges_count?: number; - /** 私有工作流数量 */ - private_workflows_count?: number; - /** 判断 multiagent 是否有 bot 节点 */ - has_bot_agent?: boolean; - /** bot 配置的声音列表 */ - bot_voices?: BotVoiceInfo[]; - /** 所有插件数量 */ - total_plugins_count?: number; - /** 所有知识库数量 */ - total_knowledges_count?: number; - /** 所有工作流数量 */ - total_workflows_count?: number; - /** 时间胶囊模式 */ - time_capsule_mode?: TimeCapsuleMode; - /** 文件盒模式 */ - filebox_mode?: FileboxInfoMode; - /** 私有图片工作流数量 */ - private_image_workflow_count?: number; - /** 用户qeury收集配置 */ - user_query_collect_conf?: UserQueryCollectConf; - /** 是否关闭语音通话(默认是打开) */ - is_close_voice_call?: boolean; -} -/** 消息涉及的bot信息,在home分享场景,消息属于多个bot */ -export interface ConversationRelateBot { - id: string; - name: string; - description: string; - icon_url: string; -} -/** 消息涉及的user信息,在home分享场景,消息属于多个user */ -export interface ConversationRelateUser { - user_info?: product_common.UserInfo; -} -export interface Conversation { - /** 对话示例 */ - snippets?: string[]; - /** 对话标题 */ - title?: string; - /** 对话ID,idGen生成 */ - id?: string; - /** 是否需要生成对话 */ - gen_title?: boolean; - /** 对话审核状态 */ - audit_status?: product_common.AuditStatus; - /** 开场白 */ - opening_dialog?: product_common.OpeningDialog; - /** 消息涉及的bot信息,key bot_id */ - relate_bots?: { - [key: string | number]: ConversationRelateBot; - }; - /** 消息涉及的user信息,key user_id */ - relate_users?: { - [key: string | number]: ConversationRelateUser; - }; -} -export interface BotExtraInfo { - /** 发布渠道 */ - publish_platforms: BotPublishPlatform[]; - /** 用户数 */ - user_count: number; - /** 公开方式 */ - publish_mode: product_common.ProductPublishMode; - /** - * 详情页特有 - * 对话示例, 废弃 - */ - conversation_snippets?: string[][]; - /** 配置 */ - config?: BotConfig; - /** 白名单 */ - is_inhouse_user?: boolean; - /** 复制创建 bot 数量 */ - duplicate_bot_count?: number; - /** 分享对话 */ - conversations?: Conversation[]; - /** 与 Bot 聊天的对话数 */ - chat_conversation_count?: string; - /** 关联商品数 */ - related_product_count?: string; -} -export interface WorkflowParameter { - name: string; - desc: string; - is_required: boolean; - input_type: product_common.InputType; - sub_parameters: WorkflowParameter[]; - /** 如果Type是数组,则有subtype */ - sub_type: product_common.InputType; - /** 如果入参是用户手输 就放这里 */ - value?: string; - format?: product_common.PluginParamTypeFormat; - from_node_id?: string; - from_output?: string[]; - /** InputType (+ AssistType) 定义一个变量的最终类型,仅需透传 */ - assist_type?: number; - /** 展示名称( store 独有的,用于详情页 GUI 展示参数) */ - show_name?: string; - /** 如果InputType是数组,则有subassisttype */ - sub_assist_type?: number; - /** 组件配置,由前端解析并渲染 */ - component_config?: string; - /** 组件配置类型,前端展示需要 */ - component_type?: string; -} -export interface WorkflowTerminatePlan { - /** 对应 workflow 结束节点的回答模式:1-返回变量,由Bot生成回答;2-使用设定的内容直接回答 */ - terminate_plan_type: number; - /** 对应 terminate_plan_type = 2 的场景配置的返回内容 */ - content: string; -} -export interface WorkflowNodeParam { - input_parameters?: WorkflowParameter[]; - terminate_plan?: WorkflowTerminatePlan; - output_parameters?: WorkflowParameter[]; -} -export interface WorkflowNodeInfo { - node_id: string; - node_type: product_common.WorkflowNodeType; - node_param?: WorkflowNodeParam; - /** 节点icon */ - node_icon_url: string; - /** 展示名称( store 独有的,用于详情页 GUI 展示消息节点的名称) */ - show_name?: string; -} -export interface WorkflowEntity { - /** 商品ID */ - product_id: string; - name: string; - entity_id: string; - entity_type: product_common.ProductEntityType; - entity_version: string; - icon_url: string; - entity_name: string; - readme: string; - category: ProductCategory; - /** 推荐分类 , */ - recommended_category?: ProductCategory; - nodes?: WorkflowNodeInfo[]; - desc: string; - /** 入参 图片icon */ - case_input_icon_url?: string; - /** 出参 图片icon */ - case_output_icon_url?: string; - latest_publish_commit_id?: string; -} -export interface WorkflowGUIConfig { - /** 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 */ - start_node: WorkflowNodeInfo; - end_node: WorkflowNodeInfo; - /** 消息节点会输出中间过程,也需要展示 */ - message_nodes?: WorkflowNodeInfo[]; -} -export interface WorkflowExtraInfo { - related_workflows: WorkflowEntity[]; - duplicate_count?: number; - /** workflow画布信息 */ - workflow_schema?: string; - /** - * api/workflowV2/query schema_json - * 推荐分类 - */ - recommended_category?: ProductCategory; - nodes?: WorkflowNodeInfo[]; - start_node?: WorkflowNodeInfo; - /** 实体名称(用于展示) */ - entity_name?: string; - /** 用例图入参 */ - case_input_icon_url?: string; - /** 用例图出参 */ - case_output_icon_url?: string; - /** 案例执行ID */ - case_execute_id?: string; - hover_text?: string; - latest_publish_commit_id?: string; - /** 试运行次数,从数仓取 */ - used_count?: number; - /** 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 */ - gui_config?: WorkflowGUIConfig; -} -export interface SocialScenePlayerInfo { - id: string; - name: string; - role_type: product_common.SocialSceneRoleType; -} -export interface SocialSceneExtraInfo { - /** 角色 */ - players?: SocialScenePlayerInfo[]; - /** 使用过的人数 */ - used_count: string; - /** 开始过的次数 */ - started_count: string; - /** 开闭源 */ - publish_mode: product_common.ProductPublishMode; -} -export interface ProjectConfig { - /** 插件数量 */ - plugin_count: number; - /** 工作流数量 */ - workflow_count: number; - /** 知识库数量 */ - knowledge_count: number; - /** 数据库数量 */ - database_count: number; -} -export interface ProjectExtraInfo { - /** Project 上架为模板前生成一个模板副本,使用或者复制模板,需要用 TemplateProjectID 和 TemplateProjectVersion */ - template_project_id: string; - template_project_version: string; - /** Project 绑定的 UI 支持的预览类型 */ - preview_types: product_common.UIPreviewType[]; - /** 用户数 */ - user_count: number; - /** 运行数 */ - execute_count: number; - /** 发布渠道 */ - publish_platforms: BotPublishPlatform[]; - /** 近实时复制量,从数仓接口获取(复制 - 上报埋点 - 数仓计算落库) */ - duplicate_count: number; - /** 配置 */ - config?: ProjectConfig; -} -export interface GetProductDetailRequest { - product_id?: string; - entity_type?: product_common.ProductEntityType; - entity_id?: string; - /** 是否查看最新的审核失败草稿 */ - need_audit_failed?: boolean; - 'Tt-Agw-Client-Ip'?: string; -} -export interface GetProductDetailResponse { - code: number; - message: string; - data: GetProductDetailData; -} -export interface Price { - value: number; - currency: string; - display_price: string; -} -export interface SKUInfo { - id: string; - /** 待废弃 */ - price: Price[]; - description: string; - price_v2: marketplace_common.Price[]; - charge_sku_info?: product_common.ChargeSKUExtra; -} -export interface SellAttrValue { - id: string; - value: string; -} -export interface SellAttr { - display_name: string; - key: string; - values: SellAttrValue[]; -} -export interface SellInfo { - skus: { - [key: string | number]: SKUInfo; - }; - attr: SellAttr[]; - /** Key 是 attrkey:attrvalue 路径,value 是 skuID */ - sku_attr_ref: { - [key: string | number]: string; - }; -} -export interface Topic { - id: string; - name: string; - description: string; - banner_url: string; - /** 背景小图,前端优先加载 */ - banner_url_small: string; - reason: string; - /** 运营提供的专题介绍文档,用户可见 */ - introduction_url: string; - /** 用户是否收藏专题 */ - is_favorite: boolean; -} -export interface ProductDataIndicator { - /** - * 数据分析指标,来源数仓,比如模板购买量、复制量等 - * 购买量 - */ - purchase_count?: number; -} -export interface GetProductDetailData { - /** 下架的商品只返回非 optional 字段 */ - meta_info: ProductMetaInfo; - /** 用以区分主/客态 */ - is_owner: boolean; - /** 审核状态,主态下返回需要关注,如果主态且审核中,需要展示审核中状态 */ - audit_status: product_common.ProductDraftStatus; - sell_info?: SellInfo; - space_id?: string; - /** 详情页返回 */ - topic?: Topic; - /** 详情页返回 */ - can_duplicate?: boolean; - commercial_setting?: product_common.CommercialSetting; - plugin_extra?: PluginExtraInfo; - bot_extra?: BotExtraInfo; - workflow_extra?: WorkflowExtraInfo; - social_scene_extra?: SocialSceneExtraInfo; - project_extra?: ProjectExtraInfo; - data_indicator?: ProductDataIndicator; -} -export interface GetUserFavoriteListV2Request { - /** 第一页不传,后续调用时传上一次返回的cursor_id */ - cursor_id?: string; - page_size: number; - entity_type?: product_common.ProductEntityType; - sort_type: product_common.SortType; - /** 不为空则搜索 */ - keyword?: string; - /** 列表页 tab */ - source?: product_common.FavoriteListSource; - /** 是否需要查询用户对Bot的触发器配置,为true时,才会返回EntityUserTriggerConfig */ - need_user_trigger_config?: boolean; - /** 筛选收藏时间 */ - begin_at?: string; - /** 筛选收藏时间 */ - end_at?: string; - entity_types?: product_common.ProductEntityType[]; - /** 组织ID,企业版想获取用户收藏的所有内容时需传递 */ - organization_id?: string; -} -export interface GetUserFavoriteListV2Response { - code: number; - message: string; - data?: GetUserFavoriteListDataV2; -} -export interface GetUserFavoriteListDataV2 { - favorite_entities: product_common.FavoriteEntity[]; - cursor_id: string; - has_more: boolean; - /** - * 用户定时任务配置,对应flow.bot.task服务的TriggerEnabled - * key: entity_id; value: UserTriggerConfig - */ - entity_user_trigger_config: { - [key: string | number]: UserTriggerConfig; - }; -} -export interface UserTriggerConfig { - trigger_enabled: TriggerEnable; -} -export enum TriggerEnable { - Init = 0, - Open = 1, - Close = 2, -} -export interface DuplicateProductRequest { - product_id: string; - entity_type: product_common.ProductEntityType; - space_id?: string; - name?: string; - Cookie?: string; -} -export interface DuplicateProductResponse { - code: number; - message: string; - data: DuplicateProductData; -} -export interface DuplicateProductData { - /** 复制后的新id */ - new_entity_id: string; - /** workflow对应的插件id */ - new_plugin_id?: string; -} diff --git a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/marketplace_common.ts b/frontend/packages/arch/api-schema/src/idl/marketplace/marketplace_common.ts similarity index 74% rename from frontend/packages/arch/api-schema/src/idl/flow/marketplace/marketplace_common.ts rename to frontend/packages/arch/api-schema/src/idl/marketplace/marketplace_common.ts index 49d68bde..a681d6ef 100644 --- a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/marketplace_common.ts +++ b/frontend/packages/arch/api-schema/src/idl/marketplace/marketplace_common.ts @@ -14,23 +14,23 @@ * limitations under the License. */ -import * as base from './../../base'; +import * as base from './../base'; export { base }; export interface Price { - /** 金额 */ - amount: string; - /** 币种,如USD、CNY */ - currency: string; - /** 小数位数 */ - decimal_num: number; + /** amount */ + amount: string, + /** Currencies such as USD and CNY */ + currency: string, + /** decimal places */ + decimal_num: number, } export enum FollowType { - /** 无关系 */ + /** Unknown */ Unknown = 0, - /** 关注 */ + /** followee */ Followee = 1, - /** 粉丝 */ + /** follower */ Follower = 2, - /** 互相关注 */ + /** MutualFollow */ MutualFollow = 3, -} +} \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/product_common.ts b/frontend/packages/arch/api-schema/src/idl/marketplace/product_common.ts similarity index 50% rename from frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/product_common.ts rename to frontend/packages/arch/api-schema/src/idl/marketplace/product_common.ts index f33ba660..449889c9 100644 --- a/frontend/packages/arch/api-schema/src/idl/flow/marketplace/flow_marketplace_product/product_common.ts +++ b/frontend/packages/arch/api-schema/src/idl/marketplace/product_common.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as marketplace_common from './../marketplace_common'; +import * as marketplace_common from './marketplace_common'; export { marketplace_common }; export enum ProductEntityType { Bot = 1, @@ -22,36 +22,36 @@ export enum ProductEntityType { /** Workflow = 3 , */ SocialScene = 4, Project = 6, - /** 历史工作流,后续不会再有(废弃) */ + /** History workflow, no more in the future (abandoned) */ WorkflowTemplate = 13, - /** 历史图像流模板,后续不会再有(废弃) */ + /** Historical image stream template, no more in the future (obsolete) */ ImageflowTemplate = 15, - /** 模板通用标识,仅用于绑定模板相关的配置,不绑定商品 */ + /** Template universal identification, only used to bind template-related configurations, not bind products */ TemplateCommon = 20, - /** Bot 模板 */ + /** Bot template */ BotTemplate = 21, - /** 工作流模板 */ + /** workflow template */ WorkflowTemplateV2 = 23, - /** 图像流模板(该类型已下线,合并入 workflow,但历史数据会保留,前端视作 workflow 展示) */ + /** Image stream template (this type has been offline and merged into workflow, but historical data will be preserved, and the front end will be treated as workflow display) */ ImageflowTemplateV2 = 25, - /** 项目模板 */ + /** project template */ ProjectTemplate = 26, - /** coze token 类商品,理论上只会有一个 */ + /** Coze token products, theoretically there will only be one */ CozeToken = 50, - /** 订阅 credit 的流量包,理论上只会有一个 */ + /** Subscribe to the traffic package of credit, theoretically there will only be one */ MsgCredit = 55, - /** 消息订阅类商品,理论上只有一个 */ + /** There is only one subscription product in theory */ SubsMsgCredit = 60, Common = 99, - /** 专题(兼容之前的设计) */ + /** Special Topics (Compatible with previous designs) */ Topic = 101, } export enum SortType { Heat = 1, Newest = 2, - /** 收藏时间 */ + /** collection time */ FavoriteTime = 3, - /** 相关性,只用于搜索场景 */ + /** Correlation, only for search scenarios */ Relative = 4, } export enum ProductPublishMode { @@ -59,9 +59,9 @@ export enum ProductPublishMode { ClosedSource = 2, } export enum ProductListSource { - /** 推荐列表页 */ + /** recommended list page */ Recommend = 1, - /** 个性化推荐 */ + /** personalized recommendation */ CustomizedRecommend = 2, } export enum PluginType { @@ -74,50 +74,50 @@ export enum ProductPaidType { Paid = 1, } export interface CommercialSetting { - commercial_type: ProductPaidType; + commercial_type: ProductPaidType } export enum ProductStatus { - /** 从未上架 */ + /** NeverListed */ NeverListed = 0, Listed = 1, Unlisted = 2, Banned = 3, } export interface UserLabel { - label_id: string; - label_name: string; - icon_uri: string; - icon_url: string; - jump_link: string; + label_id: string, + label_name: string, + icon_uri: string, + icon_url: string, + jump_link: string, } export interface UserInfo { - user_id: string; - user_name: string; - name: string; - avatar_url: string; - user_label?: UserLabel; - follow_type?: marketplace_common.FollowType; + user_id: string, + user_name: string, + name: string, + avatar_url: string, + user_label?: UserLabel, + follow_type?: marketplace_common.FollowType, } export interface ImageInfo { - uri: string; - url: string; + uri: string, + url: string, } export enum ProductDraftStatus { - /** 默认 */ + /** default */ Default = 0, - /** 审核中 */ + /** Under review. */ Pending = 1, - /** 审核通过 */ + /** approved */ Approved = 2, - /** 审核不通过 */ + /** The review failed. */ Rejected = 3, - /** 已废弃 */ + /** Abandoned */ Abandoned = 4, } export type AuditStatus = ProductDraftStatus; export interface OpeningDialog { - /** Bot开场白 */ - content: string; + /** Bot OpeningDialog */ + content: string } export enum InputType { String = 1, @@ -131,27 +131,27 @@ export enum PluginParamTypeFormat { ImageUrl = 1, } export enum WorkflowNodeType { - /** 开始 */ + /** start */ Start = 1, - /** 结束 */ + /** end */ End = 2, - /** 大模型 */ + /** Large model */ LLM = 3, - /** 插件 */ + /** plugin */ Api = 4, - /** 代码 */ + /** code */ Code = 5, - /** 知识库 */ + /** Knowledge Base */ Dataset = 6, - /** 选择器 */ + /** selector */ If = 8, - /** 工作流 */ + /** Workflow */ SubWorkflow = 9, - /** 变量 */ + /** variable */ Variable = 11, - /** 数据库 */ + /** database */ Database = 12, - /** 消息 */ + /** message */ Message = 13, } export enum SocialSceneRoleType { @@ -161,53 +161,53 @@ export enum SocialSceneRoleType { } export enum UIPreviewType { /** - * UI 预览类型,定义对齐 UI Builder,目前用于 Project - * 网页端 - */ + * UI preview type, defining alignment UI Builder, currently used in Project + * web page + */ Web = 1, - /** 移动端 */ + /** mobile end */ Client = 2, } export interface ChargeSKUExtra { - quantity: string; - is_self_define: boolean; + quantity: string, + is_self_define: boolean, } export enum FavoriteListSource { - /** 用户自己创建的 */ + /** Created by users themselves */ CreatedByMe = 1, } export interface FavoriteEntity { - entity_id: string; - entity_type: ProductEntityType; - name: string; - icon_url: string; - description: string; - /** 废弃,使用UserInfo */ - seller: SellerInfo; - /** 用于跳转到Bot编辑页 */ - space_id: string; - /** 用户是否有该实体所在Space的权限 */ - has_space_permission: boolean; - /** 收藏时间 */ - favorite_at: string; - product_extra?: FavoriteProductExtra; - user_info: UserInfo; - plugin_extra?: FavoritePluginExtra; + entity_id: string, + entity_type: ProductEntityType, + name: string, + icon_url: string, + description: string, + /** Abandoned, using UserInfo */ + seller: SellerInfo, + /** Use to jump to the bot edit page */ + space_id: string, + /** Does the user have permissions to the space where the entity is located? */ + has_space_permission: boolean, + /** collection time */ + favorite_at: string, + product_extra?: FavoriteProductExtra, + user_info: UserInfo, + plugin_extra?: FavoritePluginExtra, } export interface SellerInfo { - user_id: string; - user_name: string; - avatar_url: string; + user_id: string, + user_name: string, + avatar_url: string, } export interface FavoriteProductExtra { - product_id: string; - product_status: ProductStatus; + product_id: string, + product_status: ProductStatus, } export interface FavoritePluginExtra { - tools: PluginTool[]; + tools: PluginTool[] } export interface PluginTool { - id: string; - name: string; - description: string; -} + id: string, + name: string, + description: string, +} \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/idl/marketplace/public_api.ts b/frontend/packages/arch/api-schema/src/idl/marketplace/public_api.ts new file mode 100644 index 00000000..3ba776f2 --- /dev/null +++ b/frontend/packages/arch/api-schema/src/idl/marketplace/public_api.ts @@ -0,0 +1,729 @@ +/* + * Copyright 2025 coze-dev Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as marketplace_common from './marketplace_common'; +export { marketplace_common }; +import * as product_common from './product_common'; +export { product_common }; +import * as base from './../base'; +export { base }; +import { createAPI } from './../../api/config'; +export const PublicGetProductList = /*#__PURE__*/createAPI({ + "url": "/api/marketplace/product/list", + "method": "GET", + "name": "PublicGetProductList", + "reqType": "GetProductListRequest", + "reqMapping": { + "body": ["entity_type", "sort_type", "page_num", "page_size", "keyword", "publish_mode", "source", "current_entity_type", "preview_topic_id", "is_official", "need_extra", "entity_types", "is_free", "plugin_type"], + "query": ["category_id", "publish_platform_ids", "current_entity_id", "current_entity_version", "topic_id"], + "header": ["Tt-Agw-Client-Ip"] + }, + "resType": "GetProductListResponse", + "schemaRoot": "api://schemas/idl_marketplace_public_api", + "service": "explore" +}); +export const PublicGetProductDetail = /*#__PURE__*/createAPI({ + "url": "/api/marketplace/product/detail", + "method": "GET", + "name": "PublicGetProductDetail", + "reqType": "GetProductDetailRequest", + "reqMapping": { + "query": ["product_id", "entity_id"], + "body": ["entity_type", "need_audit_failed"], + "header": ["Tt-Agw-Client-Ip"] + }, + "resType": "GetProductDetailResponse", + "schemaRoot": "api://schemas/idl_marketplace_public_api", + "service": "explore" +}); +export const PublicFavoriteProduct = /*#__PURE__*/createAPI({ + "url": "/api/marketplace/product/favorite", + "method": "POST", + "name": "PublicFavoriteProduct", + "reqType": "FavoriteProductRequest", + "reqMapping": { + "body": ["product_id", "entity_type", "is_cancel", "entity_id", "topic_id"], + "header": ["Cookie"] + }, + "resType": "FavoriteProductResponse", + "schemaRoot": "api://schemas/idl_marketplace_public_api", + "service": "explore" +}); +export const PublicGetUserFavoriteListV2 = /*#__PURE__*/createAPI({ + "url": "/api/marketplace/product/favorite/list.v2", + "method": "GET", + "name": "PublicGetUserFavoriteListV2", + "reqType": "GetUserFavoriteListV2Request", + "reqMapping": { + "query": ["cursor_id", "page_size", "entity_type", "sort_type", "keyword", "source", "need_user_trigger_config", "begin_at", "end_at", "entity_types", "organization_id"] + }, + "resType": "GetUserFavoriteListV2Response", + "schemaRoot": "api://schemas/idl_marketplace_public_api", + "service": "explore" +}); +export const PublicDuplicateProduct = /*#__PURE__*/createAPI({ + "url": "/api/marketplace/product/duplicate", + "method": "POST", + "name": "PublicDuplicateProduct", + "reqType": "DuplicateProductRequest", + "reqMapping": { + "body": ["product_id", "entity_type", "space_id", "name"], + "header": ["Cookie"] + }, + "resType": "DuplicateProductResponse", + "schemaRoot": "api://schemas/idl_marketplace_public_api", + "service": "explore" +}); +export interface FavoriteProductResponse { + code: number, + message: string, + is_first_favorite?: boolean, +} +export interface FavoriteProductRequest { + product_id?: string, + entity_type: product_common.ProductEntityType, + is_cancel?: boolean, + entity_id?: string, + topic_id?: string, + Cookie?: string, +} +export interface GetProductListRequest { + entity_type?: product_common.ProductEntityType, + category_id?: string, + sort_type: product_common.SortType, + page_num: number, + page_size: number, + /** non-empty search */ + keyword?: string, + /** Open mode: 1-open source; 2-closed source,//open mode */ + publish_mode?: product_common.ProductPublishMode, + /** publish platforms */ + publish_platform_ids?: string[], + /** List tab; 1 - Operational recommendations */ + source?: product_common.ProductListSource, + /** + * Personalized recommendation scenarios, enter current entity information, and obtain recommended products + * Current entity type + */ + current_entity_type?: product_common.ProductEntityType, + /** Current entity ID */ + current_entity_id?: string, + /** Current entity version */ + current_entity_version?: string, + /** thematic scenario */ + topic_id?: string, + preview_topic_id?: string, + /** Do you need to filter out official products? */ + is_official?: boolean, + /** Do you need to return additional information? */ + need_extra?: boolean, + /** List of product types, use this parameter first, followed by EntityType */ + entity_types?: product_common.ProductEntityType[], + /** True = filter for free; false = filter for paid; if you don't pass it, you won't distinguish between free and paid. */ + is_free?: boolean, + /** plugin type */ + plugin_type?: product_common.PluginType, + "Tt-Agw-Client-Ip"?: string, +} +export interface GetProductListResponse { + code: number, + message: string, + data: GetProductListData, +} +export interface GetProductListData { + products?: ProductInfo[], + has_more: boolean, + total: number, +} +export interface ProductInfo { + meta_info: ProductMetaInfo, + user_behavior?: UserBehaviorInfo, + commercial_setting?: product_common.CommercialSetting, + plugin_extra?: PluginExtraInfo, + bot_extra?: BotExtraInfo, + workflow_extra?: WorkflowExtraInfo, + social_scene_extra?: SocialSceneExtraInfo, + project_extra?: ProjectExtraInfo, +} +export interface SellerInfo { + id: string, + name: string, + avatar_url: string, +} +export interface ProductCategory { + id: string, + name: string, + icon_url: string, + active_icon_url: string, + index: number, + count: number, +} +export interface ProductLabel { + name: string +} +export interface ProductMetaInfo { + id: string, + /** Product/Template Name */ + name: string, + /** Creature ID, determined by entity_type is the ID of the bot/plugin */ + entity_id: string, + /** Product material type */ + entity_type: product_common.ProductEntityType, + /** Product/template avatar */ + icon_url: string, + /** Heat: Template heat = copy volume (used for card display/sorting); product heat = different products have independent calculation logic (only used for sorting) - the calculation of heat has a certain delay */ + heat: number, + favorite_count: number, + /** Obsolete, use UserInfo instead */ + seller: SellerInfo, + /** Product description */ + description: string, + listed_at: string, + status: product_common.ProductStatus, + /** Product/template classification information */ + category?: ProductCategory, + /** Whether to collect */ + is_favorited: boolean, + is_free: boolean, + /** Template introduction/plugin introduction (currently in rich text format) */ + readme: string, + entity_version?: string, + labels?: ProductLabel[], + user_info: product_common.UserInfo, + medium_icon_url: string, + origin_icon_url: string, + /** Template cover */ + covers?: product_common.ImageInfo[], + /** Is the professional version specially available? */ + is_professional?: boolean, + /** Is it a template? */ + is_template: boolean, + /** Is it an official product? */ + is_official: boolean, + /** Price, currently only available in the template. */ + price?: marketplace_common.Price, +} +export interface UserBehaviorInfo { + /** + * The user homepage needs to return the most recently viewed/used product time. + * Latest Viewtimestamp + */ + viewed_at?: string, + /** Recently used timestamp */ + used_at?: string, +} +export enum PluginAuthMode { + /** No authorization required. */ + NoAuth = 0, + /** Authorization required, but no authorization configuration */ + Required = 1, + /** Authorization is required and has been configured */ + Configured = 2, + /** Authorization is required, but the authorization configuration may be user-level and can be configured by the user himself */ + Supported = 3, +} +export interface PluginExtraInfo { + tools?: PluginToolInfo[], + total_api_count: number, + bots_use_count: number, + /** Is there a privacy statement, currently only PublicGetProductDetail will take the data */ + has_private_statement?: boolean, + /** Privacy statement, currently only PublicGetProductDetail will access data */ + private_statement?: string, + associated_bots_use_count: number, + is_premium: boolean, + is_official: boolean, + /** call amount */ + call_amount?: number, + /** success rate */ + success_rate?: number, + /** average execution time */ + avg_exec_time?: number, + is_default_icon?: boolean, + space_id?: string, + material_id?: string, + connectors: PluginConnectorInfo[], + plugin_type?: product_common.PluginType, + /** for opencoze */ + auth_mode?: PluginAuthMode, +} +export interface ToolParameter { + name: string, + required: boolean, + description: string, + type: string, + sub_params: ToolParameter[], +} +export interface CardInfo { + card_url: string, + /** Only the details page returns */ + card_id: string, + mapping_rule: string, + max_display_rows: string, + card_version: string, +} +export interface PluginToolExample { + req_example: string, + resp_example: string, +} +export enum PluginRunMode { + DefaultToSync = 0, + Sync = 1, + Async = 2, + Streaming = 3, +} +export interface PluginToolInfo { + id: string, + name: string, + description: string, + parameters?: ToolParameter[], + card_info?: CardInfo, + example?: PluginToolExample, + /** call amount */ + call_amount?: number, + /** success rate */ + success_rate?: number, + /** average execution time */ + avg_exec_time?: number, + /** Number of tool bot references */ + bots_use_count?: number, + /** operating mode */ + run_mode?: PluginRunMode, +} +export interface PluginConnectorInfo { + id: string, + name: string, + icon: string, +} +export interface BotPublishPlatform { + id: string, + icon_url: string, + url: string, + name: string, +} +export interface ProductMaterial { + name: string, + icon_url: string, +} +export interface BotVoiceInfo { + id: string, + language_code: string, + language_name: string, + name: string, + style_id: string, + is_support_voice_call: boolean, +} +export enum TimeCapsuleMode { + Off = 0, + On = 1, +} +export enum FileboxInfoMode { + Off = 0, + On = 1, +} +export interface UserQueryCollectConf { + /** + * Bot user query collection configuration + * Whether to turn on the collection switch + */ + is_collected: boolean, + /** Privacy Policy Link */ + private_policy: string, +} +export interface BotConfig { + /** model */ + models?: ProductMaterial[], + /** plugin */ + plugins?: ProductMaterial[], + /** Knowledge Base */ + knowledges?: ProductMaterial[], + /** Workflow */ + workflows?: ProductMaterial[], + /** number of private plugins */ + private_plugins_count?: number, + /** Number of private repositories */ + private_knowledges_count?: number, + /** number of private workflows */ + private_workflows_count?: number, + /** Determine if the multiagent has a bot node */ + has_bot_agent?: boolean, + /** List of sounds configured by bot */ + bot_voices?: BotVoiceInfo[], + /** Number of all plugins */ + total_plugins_count?: number, + /** Number of all knowledge bases */ + total_knowledges_count?: number, + /** Number of all workflows */ + total_workflows_count?: number, + /** Time Capsule Mode */ + time_capsule_mode?: TimeCapsuleMode, + /** File box mode */ + filebox_mode?: FileboxInfoMode, + /** Number of private image workflows */ + private_image_workflow_count?: number, + /** User qeury collection configuration */ + user_query_collect_conf?: UserQueryCollectConf, + /** Whether to turn off voice calls (the default is on) */ + is_close_voice_call?: boolean, +} +/** The bot information involved in the message, sharing the scene in the home, the message belongs to multiple bots */ +export interface ConversationRelateBot { + id: string, + name: string, + description: string, + icon_url: string, +} +/** The user information involved in the message, sharing the scene in the home, the message belongs to multiple users */ +export interface ConversationRelateUser { + user_info?: product_common.UserInfo +} +export interface Conversation { + /** conversation example */ + snippets?: string[], + /** conversation title */ + title?: string, + /** Conversation ID, generated by idGen */ + id?: string, + /** Do you need to generate a conversation? */ + gen_title?: boolean, + /** conversation moderation status */ + audit_status?: product_common.AuditStatus, + /** opening statement */ + opening_dialog?: product_common.OpeningDialog, + /** The bot information involved in the message, key bot_id */ + relate_bots?: { + [key: string | number]: ConversationRelateBot + }, + /** The user information involved in the message, key user_id */ + relate_users?: { + [key: string | number]: ConversationRelateUser + }, +} +export interface BotExtraInfo { + /** publish platforms */ + publish_platforms: BotPublishPlatform[], + /** user count */ + user_count: number, + /** public method */ + publish_mode: product_common.ProductPublishMode, + /** + * Details page unique + * Dialogue example, abandoned + */ + conversation_snippets?: string[][], + /** configuration */ + config?: BotConfig, + /** whitelist */ + is_inhouse_user?: boolean, + /** Number of copy-created bots */ + duplicate_bot_count?: number, + /** Share the conversation */ + conversations?: Conversation[], + /** Number of conversations with Bot */ + chat_conversation_count?: string, + /** number of related products */ + related_product_count?: string, +} +export interface WorkflowParameter { + name: string, + desc: string, + is_required: boolean, + input_type: product_common.InputType, + sub_parameters: WorkflowParameter[], + /** If Type is an array, there is a subtype */ + sub_type: product_common.InputType, + /** If the imported parameter is the user's hand input, put it here */ + value?: string, + format?: product_common.PluginParamTypeFormat, + from_node_id?: string, + from_output?: string[], + /** InputType (+ AssistType) defines the final type of a variable, which only needs to be passed through */ + assist_type?: number, + /** Display name (unique to the store, used for details page GUI display parameters) */ + show_name?: string, + /** If the InputType is an array, there is a subassistant type */ + sub_assist_type?: number, + /** Component configuration, parsed and rendered by the front end */ + component_config?: string, + /** Component configuration type, required for front-end display */ + component_type?: string, +} +export interface WorkflowTerminatePlan { + /** The answer mode corresponding to the end node of the workflow: 1 - Return the variable, and the Bot generates the answer; 2 - Use the set content to answer directly */ + terminate_plan_type: number, + /** Return content of scene configuration corresponding to terminate_plan_type = 2 */ + content: string, +} +export interface WorkflowNodeParam { + input_parameters?: WorkflowParameter[], + terminate_plan?: WorkflowTerminatePlan, + output_parameters?: WorkflowParameter[], +} +export interface WorkflowNodeInfo { + node_id: string, + node_type: product_common.WorkflowNodeType, + node_param?: WorkflowNodeParam, + /** Node icon */ + node_icon_url: string, + /** Presentation name (unique to the store, the name used for the details page GUI display message node) */ + show_name?: string, +} +export interface WorkflowEntity { + /** Product ID */ + product_id: string, + name: string, + entity_id: string, + entity_type: product_common.ProductEntityType, + entity_version: string, + icon_url: string, + entity_name: string, + readme: string, + category: ProductCategory, + /** Recommended categories, */ + recommended_category?: ProductCategory, + nodes?: WorkflowNodeInfo[], + desc: string, + /** Imported parameters Picture icon */ + case_input_icon_url?: string, + /** Exported parameters Image icon */ + case_output_icon_url?: string, + latest_publish_commit_id?: string, +} +export interface WorkflowGUIConfig { + /** Used to convert the input/output/intermediate message node of a workflow into a user visual configuration */ + start_node: WorkflowNodeInfo, + end_node: WorkflowNodeInfo, + /** The message node will output the intermediate process, which also needs to be displayed. */ + message_nodes?: WorkflowNodeInfo[], +} +export interface WorkflowExtraInfo { + related_workflows: WorkflowEntity[], + duplicate_count?: number, + /** Workflow canvas information */ + workflow_schema?: string, + /** + * api/workflowV2/query schema_json + * recommended classification + */ + recommended_category?: ProductCategory, + nodes?: WorkflowNodeInfo[], + start_node?: WorkflowNodeInfo, + /** Entity name (for presentation) */ + entity_name?: string, + /** Use case diagrams imported parameters */ + case_input_icon_url?: string, + /** Use case diagram exported parameters */ + case_output_icon_url?: string, + /** case execution ID */ + case_execute_id?: string, + hover_text?: string, + latest_publish_commit_id?: string, + /** Practice running times, take from the number of warehouses */ + used_count?: number, + /** Used to convert the input/output/intermediate message node of a workflow into a user visual configuration */ + gui_config?: WorkflowGUIConfig, +} +export interface SocialScenePlayerInfo { + id: string, + name: string, + role_type: product_common.SocialSceneRoleType, +} +export interface SocialSceneExtraInfo { + /** role */ + players?: SocialScenePlayerInfo[], + /** Number of people used */ + used_count: string, + /** number of times started */ + started_count: string, + /** publish_mode */ + publish_mode: product_common.ProductPublishMode, +} +export interface ProjectConfig { + /** number of plugins */ + plugin_count: number, + /** number of workflows */ + workflow_count: number, + /** Number of knowledge bases */ + knowledge_count: number, + /** Number of databases */ + database_count: number, +} +export interface ProjectExtraInfo { + /** Generate a copy of the template before Project is put on the shelves. To use or copy the template, you need to use TemplateProjectID and TemplateProjectVersion */ + template_project_id: string, + template_project_version: string, + /** Project-bound UI supported preview types */ + preview_types: product_common.UIPreviewType[], + /** user count */ + user_count: number, + /** number of runs */ + execute_count: number, + /** publish platforms */ + publish_platforms: BotPublishPlatform[], + /** Near real-time copy volume, obtained from the data warehouse interface (copy-report event tracking-data warehouse calculation drop library) */ + duplicate_count: number, + /** configuration */ + config?: ProjectConfig, +} +export interface GetProductDetailRequest { + product_id?: string, + entity_type?: product_common.ProductEntityType, + entity_id?: string, + /** Whether to check the latest audit failure draft */ + need_audit_failed?: boolean, + "Tt-Agw-Client-Ip"?: string, +} +export interface GetProductDetailResponse { + code: number, + message: string, + data: GetProductDetailData, +} +export interface Price { + value: number, + currency: string, + display_price: string, +} +export interface SKUInfo { + id: string, + /** to be abandoned */ + price: Price[], + description: string, + price_v2: marketplace_common.Price[], + charge_sku_info?: product_common.ChargeSKUExtra, +} +export interface SellAttrValue { + id: string, + value: string, +} +export interface SellAttr { + display_name: string, + key: string, + values: SellAttrValue[], +} +export interface SellInfo { + skus: { + [key: string | number]: SKUInfo + }, + attr: SellAttr[], + /** Key is attrkey: attrvalue path, value is skuID */ + sku_attr_ref: { + [key: string | number]: string + }, +} +export interface Topic { + id: string, + name: string, + description: string, + banner_url: string, + /** Small background image, front-end priority loading */ + banner_url_small: string, + reason: string, + /** The presentation document provided by the operation is visible to users */ + introduction_url: string, + /** Does the user collect the topic? */ + is_favorite: boolean, +} +export interface ProductDataIndicator { + /** + * Data analytics metrics, source number, such as template purchases, replicas, etc + * purchase volume + */ + purchase_count?: number +} +export interface GetProductDetailData { + /** Products removed from the shelves only return non-optional fields */ + meta_info: ProductMetaInfo, + /** To distinguish between host and guest states */ + is_owner: boolean, + /** Audit status, return in the main state, you need to pay attention. If the main state is under review, you need to show the status under review. */ + audit_status: product_common.ProductDraftStatus, + sell_info?: SellInfo, + space_id?: string, + /** Details page Back */ + topic?: Topic, + /** Details page Back */ + can_duplicate?: boolean, + commercial_setting?: product_common.CommercialSetting, + plugin_extra?: PluginExtraInfo, + bot_extra?: BotExtraInfo, + workflow_extra?: WorkflowExtraInfo, + social_scene_extra?: SocialSceneExtraInfo, + project_extra?: ProjectExtraInfo, + data_indicator?: ProductDataIndicator, +} +export interface GetUserFavoriteListV2Request { + /** The first page is not passed, and the last returned cursor_id is passed when subsequent calls are made */ + cursor_id?: string, + page_size: number, + entity_type?: product_common.ProductEntityType, + sort_type: product_common.SortType, + /** Search keyword,optional */ + keyword?: string, + /** List page tab */ + source?: product_common.FavoriteListSource, + /** Whether you need to query the user's trigger configuration for the Bot, when true, it will return EntityUserTriggerConfig */ + need_user_trigger_config?: boolean, + /** Filter collection time */ + begin_at?: string, + /** Filter collection time */ + end_at?: string, + entity_types?: product_common.ProductEntityType[], + /** Organization ID, Enterprise Edition needs to be passed when you want to get all the content in the user's collection */ + organization_id?: string, +} +export interface GetUserFavoriteListV2Response { + code: number, + message: string, + data?: GetUserFavoriteListDataV2, +} +export interface GetUserFavoriteListDataV2 { + favorite_entities: product_common.FavoriteEntity[], + cursor_id: string, + has_more: boolean, + /** + * User timed task configuration, corresponding to flow.bot TriggerEnabled of the task service + * key: entity_id; value: UserTriggerConfig + */ + entity_user_trigger_config: { + [key: string | number]: UserTriggerConfig + }, +} +export interface UserTriggerConfig { + trigger_enabled: TriggerEnable +} +export enum TriggerEnable { + Init = 0, + Open = 1, + Close = 2, +} +export interface DuplicateProductRequest { + product_id: string, + entity_type: product_common.ProductEntityType, + space_id?: string, + name?: string, + Cookie?: string, +} +export interface DuplicateProductResponse { + code: number, + message: string, + data: DuplicateProductData, +} +export interface DuplicateProductData { + /** New ID after copy */ + new_entity_id: string, + /** Plugin ID for workflow */ + new_plugin_id?: string, +} \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/idl/passport/passport.ts b/frontend/packages/arch/api-schema/src/idl/passport/passport.ts index 906c1347..136a1bbb 100644 --- a/frontend/packages/arch/api-schema/src/idl/passport/passport.ts +++ b/frontend/packages/arch/api-schema/src/idl/passport/passport.ts @@ -16,186 +16,165 @@ import { createAPI } from './../../api/config'; export interface AppUserInfo { - user_unique_name: string; + user_unique_name: string } export interface User { - /** 与原接口字段名对齐 */ - user_id_str: string; - name: string; - user_unique_name: string; - email: string; - description: string; - avatar_url: string; - screen_name?: string; - app_user_info?: AppUserInfo; - locale?: string; + /** Align with the original interface field name */ + user_id_str: string, + name: string, + user_unique_name: string, + email: string, + description: string, + avatar_url: string, + screen_name?: string, + app_user_info?: AppUserInfo, + locale?: string, /** unix timestamp in seconds */ - user_create_time: number; + user_create_time: number, } export interface PassportWebEmailRegisterV2PostRequest { - password: string; - email: string; + password: string, + email: string, } export interface PassportWebEmailRegisterV2PostResponse { - data: User; - code: number; - msg: string; + data: User, + code: number, + msg: string, } export interface PassportWebLogoutGetRequest {} export interface PassportWebLogoutGetResponse { - redirect_url: string; - code: number; - msg: string; + redirect_url: string, + code: number, + msg: string, } export interface PassportWebEmailLoginPostRequest { - email: string; - password: string; + email: string, + password: string, } export interface PassportWebEmailLoginPostResponse { - data: User; - code: number; - msg: string; + data: User, + code: number, + msg: string, } export interface PassportWebEmailPasswordResetGetRequest { - password: string; - code: string; - email: string; + password: string, + code: string, + email: string, } export interface PassportWebEmailPasswordResetGetResponse { - code: number; - msg: string; + code: number, + msg: string, } export interface PassportAccountInfoV2Request {} export interface PassportAccountInfoV2Response { - data: User; - code: number; - msg: string; + data: User, + code: number, + msg: string, } export interface UserUpdateAvatarRequest { - avatar: Blob; + avatar: Blob } export interface UserUpdateAvatarResponseData { - web_uri: string; + web_uri: string } export interface UserUpdateAvatarResponse { - data: UserUpdateAvatarResponseData; - code: number; - msg: string; + data: UserUpdateAvatarResponseData, + code: number, + msg: string, } export interface UserUpdateProfileRequest { - name?: string; - user_unique_name?: string; - description?: string; - locale?: string; + name?: string, + user_unique_name?: string, + description?: string, + locale?: string, } export interface UserUpdateProfileResponse { - code: number; - msg: string; + code: number, + msg: string, } -/** 邮箱密码注册 */ -export const PassportWebEmailRegisterV2Post = /*#__PURE__*/ createAPI< - PassportWebEmailRegisterV2PostRequest, - PassportWebEmailRegisterV2PostResponse ->({ - url: '/api/passport/web/email/register/v2/', - method: 'POST', - name: 'PassportWebEmailRegisterV2Post', - reqType: 'PassportWebEmailRegisterV2PostRequest', - reqMapping: { - body: ['password', 'email'], +/** Email password registration */ +export const PassportWebEmailRegisterV2Post = /*#__PURE__*/createAPI({ + "url": "/api/passport/web/email/register/v2/", + "method": "POST", + "name": "PassportWebEmailRegisterV2Post", + "reqType": "PassportWebEmailRegisterV2PostRequest", + "reqMapping": { + "body": ["password", "email"] }, - resType: 'PassportWebEmailRegisterV2PostResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', + "resType": "PassportWebEmailRegisterV2PostResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" }); -/** 退出登录 */ -export const PassportWebLogoutGet = /*#__PURE__*/ createAPI< - PassportWebLogoutGetRequest, - PassportWebLogoutGetResponse ->({ - url: '/api/passport/web/logout/', - method: 'GET', - name: 'PassportWebLogoutGet', - reqType: 'PassportWebLogoutGetRequest', - reqMapping: {}, - resType: 'PassportWebLogoutGetResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', +/** log out */ +export const PassportWebLogoutGet = /*#__PURE__*/createAPI({ + "url": "/api/passport/web/logout/", + "method": "GET", + "name": "PassportWebLogoutGet", + "reqType": "PassportWebLogoutGetRequest", + "reqMapping": {}, + "resType": "PassportWebLogoutGetResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" }); -/** 邮箱帐密登录 */ -export const PassportWebEmailLoginPost = /*#__PURE__*/ createAPI< - PassportWebEmailLoginPostRequest, - PassportWebEmailLoginPostResponse ->({ - url: '/api/passport/web/email/login/', - method: 'POST', - name: 'PassportWebEmailLoginPost', - reqType: 'PassportWebEmailLoginPostRequest', - reqMapping: { - body: ['email', 'password'], +/** Email account password login */ +export const PassportWebEmailLoginPost = /*#__PURE__*/createAPI({ + "url": "/api/passport/web/email/login/", + "method": "POST", + "name": "PassportWebEmailLoginPost", + "reqType": "PassportWebEmailLoginPostRequest", + "reqMapping": { + "body": ["email", "password"] }, - resType: 'PassportWebEmailLoginPostResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', + "resType": "PassportWebEmailLoginPostResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" }); -/** 通过邮箱重置密码 */ -export const PassportWebEmailPasswordResetGet = /*#__PURE__*/ createAPI< - PassportWebEmailPasswordResetGetRequest, - PassportWebEmailPasswordResetGetResponse ->({ - url: '/api/passport/web/email/password/reset/', - method: 'GET', - name: 'PassportWebEmailPasswordResetGet', - reqType: 'PassportWebEmailPasswordResetGetRequest', - reqMapping: { - query: ['password', 'code', 'email'], +/** Reset password via email */ +export const PassportWebEmailPasswordResetGet = /*#__PURE__*/createAPI({ + "url": "/api/passport/web/email/password/reset/", + "method": "GET", + "name": "PassportWebEmailPasswordResetGet", + "reqType": "PassportWebEmailPasswordResetGetRequest", + "reqMapping": { + "query": ["password", "code", "email"] }, - resType: 'PassportWebEmailPasswordResetGetResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', + "resType": "PassportWebEmailPasswordResetGetResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" }); -/** 账号信息 */ -export const PassportAccountInfoV2 = /*#__PURE__*/ createAPI< - PassportAccountInfoV2Request, - PassportAccountInfoV2Response ->({ - url: '/api/passport/account/info/v2/', - method: 'POST', - name: 'PassportAccountInfoV2', - reqType: 'PassportAccountInfoV2Request', - reqMapping: {}, - resType: 'PassportAccountInfoV2Response', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', +/** account information */ +export const PassportAccountInfoV2 = /*#__PURE__*/createAPI({ + "url": "/api/passport/account/info/v2/", + "method": "POST", + "name": "PassportAccountInfoV2", + "reqType": "PassportAccountInfoV2Request", + "reqMapping": {}, + "resType": "PassportAccountInfoV2Response", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" }); -export const UserUpdateAvatar = /*#__PURE__*/ createAPI< - UserUpdateAvatarRequest, - UserUpdateAvatarResponse ->({ - url: '/api/web/user/update/upload_avatar/', - method: 'POST', - name: 'UserUpdateAvatar', - reqType: 'UserUpdateAvatarRequest', - reqMapping: { - body: ['avatar'], +export const UserUpdateAvatar = /*#__PURE__*/createAPI({ + "url": "/api/web/user/update/upload_avatar/", + "method": "POST", + "name": "UserUpdateAvatar", + "reqType": "UserUpdateAvatarRequest", + "reqMapping": { + "body": ["avatar"] }, - resType: 'UserUpdateAvatarResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', - serializer: 'form', + "resType": "UserUpdateAvatarResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport", + "serializer": "form" }); -export const UserUpdateProfile = /*#__PURE__*/ createAPI< - UserUpdateProfileRequest, - UserUpdateProfileResponse ->({ - url: '/api/user/update_profile', - method: 'POST', - name: 'UserUpdateProfile', - reqType: 'UserUpdateProfileRequest', - reqMapping: { - body: ['name', 'user_unique_name', 'description', 'locale'], +export const UserUpdateProfile = /*#__PURE__*/createAPI({ + "url": "/api/user/update_profile", + "method": "POST", + "name": "UserUpdateProfile", + "reqType": "UserUpdateProfileRequest", + "reqMapping": { + "body": ["name", "user_unique_name", "description", "locale"] }, - resType: 'UserUpdateProfileResponse', - schemaRoot: 'api://schemas/idl_passport_passport', - service: 'passport', -}); + "resType": "UserUpdateProfileResponse", + "schemaRoot": "api://schemas/idl_passport_passport", + "service": "passport" +}); \ No newline at end of file diff --git a/frontend/packages/arch/api-schema/src/index.ts b/frontend/packages/arch/api-schema/src/index.ts index cbf3402c..5870c4a2 100644 --- a/frontend/packages/arch/api-schema/src/index.ts +++ b/frontend/packages/arch/api-schema/src/index.ts @@ -15,4 +15,4 @@ */ export * as passport from './idl/passport/passport'; -export * as explore from './idl/flow/marketplace/flow_marketplace_product/public_api'; +export * as explore from './idl/marketplace/public_api'; diff --git a/frontend/packages/arch/bot-env-adapter/src/typings.d.ts b/frontend/packages/arch/bot-env-adapter/src/typings.d.ts index 10372d50..ee098e11 100644 --- a/frontend/packages/arch/bot-env-adapter/src/typings.d.ts +++ b/frontend/packages/arch/bot-env-adapter/src/typings.d.ts @@ -15,7 +15,7 @@ */ /* eslint-disable */ /* prettier-ignore */ -// Automatically generated based on src/index.ts, do not modify manually +// Automatically generated based on src/index.ts, do not modify manually declare const APP_ID: number; declare const APP_KEY: string; declare const AWEME_ORIGIN: string; @@ -24,15 +24,7 @@ declare const AWEME_PLATFORM_ID: number; declare const BOT_BRAND_NAME: string; declare const BUILD_BRANCH: string; declare const BUILD_TYPE: 'local' | 'online' | 'offline' | 'test'; -declare const BYTE_UPLOADER_REGION: - | 'cn-north-1' - | 'us-east-1' - | 'ap-singapore-1' - | 'us-east-red' - | 'boe' - | 'boei18n' - | 'US-TTP' - | 'gcp'; +declare const BYTE_UPLOADER_REGION: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1' | 'us-east-red' | 'boe' | 'boei18n' | 'US-TTP' | 'gcp'; declare const CARD_BUILDER_ENV_STR: string; declare const CDN: string | undefined; declare const CDN_PATH_PREFIX: string; @@ -116,3 +108,4 @@ declare const VOLCANO_PLATFORM_APP_KEY: string | null; declare const VOLCANO_PLATFORM_ID: number | null; declare const VOLC_PRIVATE_POLICY: string; declare const VOLC_TERMS_OF_SERVICE: string; + \ No newline at end of file diff --git a/idl/api.thrift b/idl/api.thrift index d54fb316..5451ff3f 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -1,26 +1,19 @@ include "./plugin/plugin_develop.thrift" -include "./flow/marketplace/flow_marketplace_product/public_api.thrift" -include "./data_engine/dataset/dataset.thrift" -include "./data_engine/dataset/flow_dataengine_dataset.thrift" -include "./data_engine/dataset/document.thrift" -include "./data_engine/dataset/slice.thrift" -include "./bot_platform/ocean_cloud_workflow/workflow.thrift" -include "./bot_platform/ocean_cloud_workflow/trace.thrift" -include "./flow/devops/debugger/flow.devops.debugger.coze.thrift" -include "./intelligence/intelligence.thrift" -include "./developer/developer_api.thrift" +include "./marketplace/public_api.thrift" +include "./data/knowledge/knowledge_svc.thrift" +include "./app/intelligence.thrift" +include "./app/developer_api.thrift" include "./playground/playground.thrift" -include "./data_engine/ocean_cloud_memory/table/table.thrift" -include "./memory/database.thrift" +include "./data/database/database_svc.thrift" include "./permission/openapiauth_service.thrift" include "./conversation/conversation_service.thrift" include "./conversation/message_service.thrift" include "./conversation/agentrun_service.thrift" -include "./data_engine/ocean_cloud_memory/ocean_cloud_memory.thrift" +include "./data/variable/variable_svc.thrift" include "./resource/resource.thrift" include "./passport/passport.thrift" -include "./bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift" -include "./bot_open_api/bot_open_api.thrift" +include "./workflow/workflow_svc.thrift" +include "./app/bot_open_api.thrift" include "./upload/upload.thrift" @@ -31,15 +24,15 @@ service ConversationService extends conversation_service.ConversationService {} service MessageService extends message_service.MessageService {} service AgentRunService extends agentrun_service.AgentRunService {} service OpenAPIAuthService extends openapiauth_service.OpenAPIAuthService {} -service MemoryService extends ocean_cloud_memory.MemoryService {} +service MemoryService extends variable_svc.MemoryService {} service PluginDevelopService extends plugin_develop.PluginDevelopService {} service PublicProductService extends public_api.PublicProductService {} service DeveloperApiService extends developer_api.DeveloperApiService {} service PlaygroundService extends playground.PlaygroundService {} -service DatabaseService extends database.DatabaseService {} +service DatabaseService extends database_svc.DatabaseService {} service ResourceService extends resource.ResourceService {} service PassportService extends passport.PassportService {} -service WorkflowService extends ocean_cloud_workflow.WorkflowService {} -service KnowledgeService extends flow_dataengine_dataset.DatasetService {} +service WorkflowService extends workflow_svc.WorkflowService {} +service KnowledgeService extends knowledge_svc.DatasetService {} service BotOpenApiService extends bot_open_api.BotOpenApiService {} service UploadService extends upload.UploadService {} diff --git a/idl/bot_common/bot_common.thrift b/idl/app/bot_common.thrift similarity index 99% rename from idl/bot_common/bot_common.thrift rename to idl/app/bot_common.thrift index 993fae75..cee9667a 100644 --- a/idl/bot_common/bot_common.thrift +++ b/idl/app/bot_common.thrift @@ -1,4 +1,4 @@ -namespace go ocean.cloud.bot_common +namespace go app.bot_common struct AuthToken { diff --git a/idl/app/bot_open_api.thrift b/idl/app/bot_open_api.thrift new file mode 100644 index 00000000..2bec82ab --- /dev/null +++ b/idl/app/bot_open_api.thrift @@ -0,0 +1,56 @@ +namespace go app.bot_open_api +include "../base.thrift" +include "bot_common.thrift" + +struct OauthAuthorizationCodeReq { + 1: string code (api.query='code') , + 2: string state (api.query='state'), +} + +struct OauthAuthorizationCodeResp { + 255: required base.BaseResp BaseResp, +} + +struct GetBotOnlineInfoReq { + 1 : required i64 bot_id (api.js_conv="true") // botId + 2: optional string connector_id // Keep it first, don't expose it, and don't use the field + 3 : optional string version // bot version, get the latest version if you don't pass it on. +} + +struct UploadFileOpenRequest { + 1: required string ContentType (api.header = "Content-Type", agw.source = "header", agw.key = "Content-Type"), // file type + 2: required binary Data (api.raw_body = ""), // binary data + 255: base.Base Base +} + + +struct UploadFileOpenResponse { + 1: optional File File (api.body = "data") + 253: required i64 code + 254: required string msg + 255: base.BaseResp BaseResp +} + +struct File{ + 1: string URI (api.body = "uri"), // 文件URI + 2: i64 Bytes (api.body = "bytes"), // 文件字节数 + 3: i64 CreatedAt (agw.key = "created_at"), // 上传时间戳,单位s + 4: string FileName (api.body = "file_name"), // 文件名 + 5: string URL (api.body = "url") +} + +// resp +struct GetBotOnlineInfoResp { + 1: required i32 code + 2: required string msg + 3: required bot_common.OpenAPIBotInfo data +} + +service BotOpenApiService { + OauthAuthorizationCodeResp OauthAuthorizationCode(1: OauthAuthorizationCodeReq request)(api.get='/api/oauth/authorization_code', api.category="oauth", api.gen_path="oauth") + + //openapi + GetBotOnlineInfoResp GetBotOnlineInfo(1: GetBotOnlineInfoReq request)(api.get='/v1/bot/get_online_info', api.category="bot", api.tag="openapi", api.gen_path="personal_api") + // File related OpenAPI + UploadFileOpenResponse UploadFileOpen(1: UploadFileOpenRequest request)(api.post = "/v1/files/upload", api.category="file", api.tag="openapi", agw.preserve_base="true") +} \ No newline at end of file diff --git a/idl/intelligence/common_struct/common_struct.thrift b/idl/app/common_struct/common_struct.thrift similarity index 98% rename from idl/intelligence/common_struct/common_struct.thrift rename to idl/app/common_struct/common_struct.thrift index 5c51a7f7..6985657d 100644 --- a/idl/intelligence/common_struct/common_struct.thrift +++ b/idl/app/common_struct/common_struct.thrift @@ -1,4 +1,4 @@ -namespace go intelligence.common +namespace go app.intelligence.common struct UserLabel { 1: string label_id , diff --git a/idl/intelligence/common_struct/intelligence_common_struct.thrift b/idl/app/common_struct/intelligence_common_struct.thrift similarity index 96% rename from idl/intelligence/common_struct/intelligence_common_struct.thrift rename to idl/app/common_struct/intelligence_common_struct.thrift index 1578c727..5ba06760 100644 --- a/idl/intelligence/common_struct/intelligence_common_struct.thrift +++ b/idl/app/common_struct/intelligence_common_struct.thrift @@ -1,4 +1,4 @@ -namespace go intelligence.common +namespace go app.intelligence.common enum IntelligenceStatus { Using = 1, diff --git a/idl/intelligence/common_struct/task_struct.thrift b/idl/app/common_struct/task_struct.thrift similarity index 71% rename from idl/intelligence/common_struct/task_struct.thrift rename to idl/app/common_struct/task_struct.thrift index 97ade0b5..3ea0efad 100644 --- a/idl/intelligence/common_struct/task_struct.thrift +++ b/idl/app/common_struct/task_struct.thrift @@ -1,3 +1,5 @@ +namespace go app.intelligence.common + struct ProjectInnerTaskInfo { 1: i64 task_id (agw.js_conv="str",api.js_conv="true") // Task ID } \ No newline at end of file diff --git a/idl/developer/developer_api.thrift b/idl/app/developer_api.thrift similarity index 99% rename from idl/developer/developer_api.thrift rename to idl/app/developer_api.thrift index e8f2ec82..af7c2959 100644 --- a/idl/developer/developer_api.thrift +++ b/idl/app/developer_api.thrift @@ -1,8 +1,8 @@ include "../base.thrift" -include "../bot_common/bot_common.thrift" +include "bot_common.thrift" include "../playground/shortcut_command.thrift" -namespace go ocean.cloud.developer_api +namespace go app.developer_api struct DraftBotCreateRequest { diff --git a/idl/intelligence/intelligence.thrift b/idl/app/intelligence.thrift similarity index 98% rename from idl/intelligence/intelligence.thrift rename to idl/app/intelligence.thrift index 8ed53392..a156d2e6 100644 --- a/idl/intelligence/intelligence.thrift +++ b/idl/app/intelligence.thrift @@ -2,11 +2,11 @@ include "../base.thrift" include "search.thrift" include "common_struct/intelligence_common_struct.thrift" include "common_struct/common_struct.thrift" -include "./project.thrift" +include "project.thrift" include "publish.thrift" include "task.thrift" -namespace go intelligence +namespace go app.intelligence service IntelligenceService { project.DraftProjectCreateResponse DraftProjectCreate(1: project.DraftProjectCreateRequest request)(api.post='/api/intelligence_api/draft_project/create', api.category="draft_project",agw.preserve_base="true") diff --git a/idl/intelligence/project.thrift b/idl/app/project.thrift similarity index 98% rename from idl/intelligence/project.thrift rename to idl/app/project.thrift index c7792a45..e21d6d51 100644 --- a/idl/intelligence/project.thrift +++ b/idl/app/project.thrift @@ -1,3 +1,4 @@ +namespace go app.intelligence.project include "../base.thrift" include "common_struct/intelligence_common_struct.thrift" include "common_struct/common_struct.thrift" diff --git a/idl/intelligence/publish.thrift b/idl/app/publish.thrift similarity index 99% rename from idl/intelligence/publish.thrift rename to idl/app/publish.thrift index 6061fbc2..2fe57b0d 100644 --- a/idl/intelligence/publish.thrift +++ b/idl/app/publish.thrift @@ -1,3 +1,4 @@ +namespace go app.intelligence.publish include "../base.thrift" include "common_struct/common_struct.thrift" include "common_struct/intelligence_common_struct.thrift" diff --git a/idl/intelligence/search.thrift b/idl/app/search.thrift similarity index 99% rename from idl/intelligence/search.thrift rename to idl/app/search.thrift index da7cfd33..06169ff0 100644 --- a/idl/intelligence/search.thrift +++ b/idl/app/search.thrift @@ -1,9 +1,8 @@ +namespace go app.intelligence include "../base.thrift" include "common_struct/intelligence_common_struct.thrift" include "common_struct/common_struct.thrift" -namespace go intelligence - enum OrderBy { UpdateTime = 0 CreateTime = 1 diff --git a/idl/intelligence/task.thrift b/idl/app/task.thrift similarity index 93% rename from idl/intelligence/task.thrift rename to idl/app/task.thrift index 95c8acaf..21bdca67 100644 --- a/idl/intelligence/task.thrift +++ b/idl/app/task.thrift @@ -1,3 +1,4 @@ +namespace go app.intelligence.task include "../base.thrift" include "common_struct/task_struct.thrift" diff --git a/idl/bot_open_api/bot_open_api.thrift b/idl/bot_open_api/bot_open_api.thrift deleted file mode 100644 index 0e8b1449..00000000 --- a/idl/bot_open_api/bot_open_api.thrift +++ /dev/null @@ -1,15 +0,0 @@ -include "../base.thrift" -namespace go ocean.cloud.bot_open_api - -struct OauthAuthorizationCodeReq { - 1: string code (api.query='code') , - 2: string state (api.query='state'), -} - -struct OauthAuthorizationCodeResp { - 255: required base.BaseResp BaseResp, -} - -service BotOpenApiService { - OauthAuthorizationCodeResp OauthAuthorizationCode(1: OauthAuthorizationCodeReq request)(api.get='/api/oauth/authorization_code', api.category="oauth", api.gen_path="oauth") -} \ No newline at end of file diff --git a/idl/memory/database.thrift b/idl/data/database/database_svc.thrift similarity index 90% rename from idl/memory/database.thrift rename to idl/data/database/database_svc.thrift index fe6a48f9..4a9aa7dd 100644 --- a/idl/memory/database.thrift +++ b/idl/data/database/database_svc.thrift @@ -1,7 +1,7 @@ -include "../data_engine/ocean_cloud_memory/table/table.thrift" -include "../data_engine/ocean_cloud_memory/knowledge/kdocument.thrift" +include "table.thrift" +include "../knowledge/document.thrift" -namespace go database +namespace go data.database service DatabaseService { table.ListDatabaseResponse ListDatabase(1: table.ListDatabaseRequest req)(api.post='/api/memory/database/list', api.category="memory",agw.preserve_base="true") @@ -19,7 +19,7 @@ service DatabaseService { table.GetSpaceConnectorListResponse GetConnectorName(1:table.GetSpaceConnectorListRequest req)(api.post='/api/memory/database/get_connector_name', api.category="memory",agw.preserve_base="true") table.GetBotTableResponse GetBotDatabase(1: table.GetBotTableRequest req)(api.post='/api/memory/database/table/list_new', api.category="memory",agw.preserve_base="true") table.UpdateDatabaseBotSwitchResponse UpdateDatabaseBotSwitch(1:table.UpdateDatabaseBotSwitchRequest req)(api.post='/api/memory/database/update_bot_switch', api.category="memory",agw.preserve_base="true") - kdocument.GetTableSchemaInfoResponse GetDatabaseTableSchema(1:table.GetTableSchemaRequest req)(api.post='/api/memory/table_schema/get', api.category="memory",agw.preserve_base="true") + document.GetTableSchemaInfoResponse GetDatabaseTableSchema(1:table.GetTableSchemaRequest req)(api.post='/api/memory/table_schema/get', api.category="memory",agw.preserve_base="true") table.ValidateTableSchemaResponse ValidateDatabaseTableSchema(1:table.ValidateTableSchemaRequest req)(api.post='/api/memory/table_schema/validate', api.category="memory",agw.preserve_base="true") table.SubmitDatabaseInsertResponse SubmitDatabaseInsertTask(1:table.SubmitDatabaseInsertRequest req)(api.post='/api/memory/table_file/submit', api.category="memory",agw.preserve_base="true") table.GetDatabaseFileProgressResponse DatabaseFileProgressData(1:table.GetDatabaseFileProgressRequest req)(api.post='/api/memory/table_file/get_progress', api.category="memory",agw.preserve_base="true") diff --git a/idl/data_engine/ocean_cloud_memory/table/table.thrift b/idl/data/database/table.thrift similarity index 97% rename from idl/data_engine/ocean_cloud_memory/table/table.thrift rename to idl/data/database/table.thrift index 802ddc2d..df53f908 100644 --- a/idl/data_engine/ocean_cloud_memory/table/table.thrift +++ b/idl/data/database/table.thrift @@ -1,5 +1,5 @@ -include "../../../base.thrift" - +include "../../base.thrift" +namespace go data.database.table enum RefType { NoRef = 0 Bot = 1 @@ -362,27 +362,6 @@ struct GetNL2SQLResponse { 255: optional base.BaseResp BaseResp } -struct GetModeConfigRequest { - 1: required i64 bot_id // bot id - 2: optional i64 connector_id // line of business id - 3: optional string connector_uid // line of business user id - - 255: optional base.Base Base -} - -struct GetModeConfigResponse { - 1: i32 code - 2: string msg - 3: string mode - 4: i64 bot_id - 5: i64 max_table_num - 6: i64 max_column_num - 7: i64 max_capacity_kb - 8: i64 max_row_num - - 255: optional base.BaseResp BaseResp -} - struct ResetBotTableRequest { 1: optional i64 creator_id (api.js_conv="str", api.key="creator_id") 2: optional i64 bot_id (api.js_conv="str", api.key="bot_id") @@ -770,12 +749,6 @@ enum TableDataType { OnlyPreview = 2 // Just preview the data } -struct DocTableSheet { - 1: i64 id; // Number of sheet - 2: string sheet_name; // Sheet name - 3: i64 total_row; // total number of rows -} - struct TableColumn { 1: i64 id(api.js_conv="str", api.key="id") // Column ID 2: string column_name // column_name diff --git a/idl/data_engine/dataset/common.thrift b/idl/data/knowledge/common.thrift similarity index 77% rename from idl/data_engine/dataset/common.thrift rename to idl/data/knowledge/common.thrift index cd76f17c..c3e7c60d 100644 --- a/idl/data_engine/dataset/common.thrift +++ b/idl/data/knowledge/common.thrift @@ -1,4 +1,4 @@ -namespace go flow.dataengine.dataset +namespace go data.knowledge // type enum FormatType { @@ -95,4 +95,25 @@ enum ReviewStatus { Enable = 1 // Completed. Failed = 2 // fail ForceStop = 3 // fail +} + +// Table column information +struct DocTableColumn { + 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id"); // Column ID + 2: string column_name; // column_name + 3: bool is_semantic; // Is it a semantically matched column? + 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence"); // List the serial number originally in excel + 5: optional ColumnType column_type; // column type + 6: optional bool contains_empty_value + 7: optional string desc; // describe +} + +enum ColumnType { + Unknown = 0 + Text = 1 // Text + Number = 2 // number + Date = 3 // time + Float = 4 // float + Boolean = 5 // bool + Image = 6 // picture } \ No newline at end of file diff --git a/idl/data_engine/dataset/document.thrift b/idl/data/knowledge/document.thrift similarity index 91% rename from idl/data_engine/dataset/document.thrift rename to idl/data/knowledge/document.thrift index eb796109..afe3772b 100644 --- a/idl/data_engine/dataset/document.thrift +++ b/idl/data/knowledge/document.thrift @@ -1,7 +1,7 @@ include "../../base.thrift" include "common.thrift" -namespace go flow.dataengine.dataset +namespace go data.knowledge struct ListDocumentRequest { 1: required i64 dataset_id(agw.js_conv='str', api.js_conv='true') @@ -60,22 +60,11 @@ struct TableColumn { 2: string column_name // column_name 3: bool is_semantic // Is it a semantically matched column? 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence")// List the serial number originally in excel - 5: optional ColumnType column_type // column type + 5: optional common.ColumnType column_type // column type 6: optional bool contains_empty_value 7: optional string desc // describe } - -enum ColumnType { - Unknown = 0 - Text = 1 // Text - Number = 2 // number - Date = 3 // time - Float = 4 // float - Boolean = 5 // bool - Image = 6 // picture -} - struct DeleteDocumentRequest { 2: list document_ids // List of document IDs to delete @@ -335,3 +324,30 @@ struct ExtractPhotoCaptionResponse { 254: required string msg 255: required base.BaseResp BaseResp(api.none="true") } + +struct GetDocumentTableInfoRequest { + 2: optional string tos_uri; // If the table is uploaded for the first local file, pass the value + 3: optional i64 document_id(agw.js_conv="str", api.js_conv="true", api.body="document_id"); // If it is a document with an existing table, pass the value + 4: i64 creator_id; // Creator [http interface does not need to be passed] + 255: optional base.Base Base +} + +struct GetDocumentTableInfoResponse { + 1: i32 code + 2: string msg + 3: list sheet_list + 4: map> table_meta(api.body="table_meta") // key: sheet_id -> list + 5: map>> preview_data(api.body="preview_data") // key: sheet_id -> list_preview_data + + 255: required base.BaseResp BaseResp(api.none="true") +} + +struct GetTableSchemaInfoResponse { + 1: i32 code + 2: string msg + 3: list sheet_list + 4: list table_meta // The schema of the selected sheet, not selected to return the first sheet by default + 5: list> preview_data(agw.js_conv="str", agw.key="preview_data") // The knowledge table will return + + 255: optional base.BaseResp BaseResp(api.none="true") +} diff --git a/idl/data_engine/dataset/dataset.thrift b/idl/data/knowledge/knowledge.thrift similarity index 91% rename from idl/data_engine/dataset/dataset.thrift rename to idl/data/knowledge/knowledge.thrift index 7c5e6357..0f13d8aa 100644 --- a/idl/data_engine/dataset/dataset.thrift +++ b/idl/data/knowledge/knowledge.thrift @@ -2,7 +2,7 @@ include "../../base.thrift" include "common.thrift" -namespace go flow.dataengine.dataset +namespace go data.knowledge struct CreateDatasetRequest { 1: string name // Knowledge base name, no more than 100 characters in length @@ -160,5 +160,26 @@ struct GetIconResponse { 253: required i64 code 254: required string msg + 255: optional base.BaseResp BaseResp +} + +struct GetModeConfigRequest { + 1: required i64 bot_id // bot id + 2: optional i64 connector_id // line of business id + 3: optional string connector_uid // line of business user id + + 255: optional base.Base Base +} + +struct GetModeConfigResponse { + 1: i32 code + 2: string msg + 3: string mode + 4: i64 bot_id + 5: i64 max_table_num + 6: i64 max_column_num + 7: i64 max_capacity_kb + 8: i64 max_row_num + 255: optional base.BaseResp BaseResp } \ No newline at end of file diff --git a/idl/data_engine/dataset/flow_dataengine_dataset.thrift b/idl/data/knowledge/knowledge_svc.thrift similarity index 71% rename from idl/data_engine/dataset/flow_dataengine_dataset.thrift rename to idl/data/knowledge/knowledge_svc.thrift index 0dead4f9..786111ec 100644 --- a/idl/data_engine/dataset/flow_dataengine_dataset.thrift +++ b/idl/data/knowledge/knowledge_svc.thrift @@ -1,19 +1,20 @@ include "slice.thrift" -include "dataset.thrift" +include "knowledge.thrift" include "document.thrift" include "common.thrift" include "review.thrift" -namespace go flow.dataengine.dataset +namespace go data.knowledge service DatasetService { // Knowledge base related - dataset.GetIconResponse GetIconForDataset(1:dataset.GetIconRequest req) (api.post='/api/knowledge/icon/get', api.category="knowledge",agw.preserve_base="true") - dataset.CreateDatasetResponse CreateDataset(1:dataset.CreateDatasetRequest req) (api.post='/api/knowledge/create', api.category="knowledge",agw.preserve_base="true") - dataset.DatasetDetailResponse DatasetDetail(1:dataset.DatasetDetailRequest req) (api.post='/api/knowledge/detail', api.category="knowledge",agw.preserve_base="true") - dataset.ListDatasetResponse ListDataset(1:dataset.ListDatasetRequest req) (api.post='/api/knowledge/list', api.category="knowledge",agw.preserve_base="true") - dataset.DeleteDatasetResponse DeleteDataset(1:dataset.DeleteDatasetRequest req) (api.post='/api/knowledge/delete', api.category="knowledge",agw.preserve_base="true") - dataset.UpdateDatasetResponse UpdateDataset(1:dataset.UpdateDatasetRequest req) (api.post='/api/knowledge/update', api.category="knowledge",agw.preserve_base="true") + knowledge.GetIconResponse GetIconForDataset(1:knowledge.GetIconRequest req) (api.post='/api/knowledge/icon/get', api.category="knowledge",agw.preserve_base="true") + knowledge.CreateDatasetResponse CreateDataset(1:knowledge.CreateDatasetRequest req) (api.post='/api/knowledge/create', api.category="knowledge",agw.preserve_base="true") + knowledge.DatasetDetailResponse DatasetDetail(1:knowledge.DatasetDetailRequest req) (api.post='/api/knowledge/detail', api.category="knowledge",agw.preserve_base="true") + knowledge.ListDatasetResponse ListDataset(1:knowledge.ListDatasetRequest req) (api.post='/api/knowledge/list', api.category="knowledge",agw.preserve_base="true") + knowledge.DeleteDatasetResponse DeleteDataset(1:knowledge.DeleteDatasetRequest req) (api.post='/api/knowledge/delete', api.category="knowledge",agw.preserve_base="true") + knowledge.UpdateDatasetResponse UpdateDataset(1:knowledge.UpdateDatasetRequest req) (api.post='/api/knowledge/update', api.category="knowledge",agw.preserve_base="true") + knowledge.GetModeConfigResponse GetModeConfig(1:knowledge.GetModeConfigRequest req)(api.get='/api/memory/table_mode_config', api.category="memory", agw.preserve_base="true") // Document related document.CreateDocumentResponse CreateDocument(1:document.CreateDocumentRequest req) (api.post='/api/knowledge/document/create', api.category="knowledge",agw.preserve_base="true") document.ListDocumentResponse ListDocument(1:document.ListDocumentRequest req) (api.post='/api/knowledge/document/list', api.category="knowledge",agw.preserve_base="true") @@ -27,7 +28,7 @@ service DatasetService { document.ExtractPhotoCaptionResponse ExtractPhotoCaption(1:document.ExtractPhotoCaptionRequest req) (api.post='/api/knowledge/photo/extract_caption', api.category="knowledge",agw.preserve_base="true") document.GetTableSchemaResponse GetTableSchema(1:document.GetTableSchemaRequest req) (api.post='/api/knowledge/table_schema/get', api.category="knowledge",agw.preserve_base="true") document.ValidateTableSchemaResponse ValidateTableSchema(1:document.ValidateTableSchemaRequest req) (api.post='/api/knowledge/table_schema/validate', api.category="knowledge",agw.preserve_base="true") - + document.GetDocumentTableInfoResponse GetDocumentTableInfo(1:document.GetDocumentTableInfoRequest req) (api.get='/api/memory/doc_table_info', api.category="memory", agw.preserve_base="true") // Slice related slice.DeleteSliceResponse DeleteSlice(1:slice.DeleteSliceRequest req) (api.post='/api/knowledge/slice/delete', api.category="knowledge",agw.preserve_base="true") slice.CreateSliceResponse CreateSlice(1:slice.CreateSliceRequest req) (api.post='/api/knowledge/slice/create', api.category="knowledge",agw.preserve_base="true") diff --git a/idl/data_engine/dataset/review.thrift b/idl/data/knowledge/review.thrift similarity index 97% rename from idl/data_engine/dataset/review.thrift rename to idl/data/knowledge/review.thrift index e82dc6bc..cea32c09 100644 --- a/idl/data_engine/dataset/review.thrift +++ b/idl/data/knowledge/review.thrift @@ -1,7 +1,7 @@ include "../../base.thrift" include "common.thrift" -namespace go flow.dataengine.dataset +namespace go data.knowledge struct ReviewInput { 1: string document_name diff --git a/idl/data_engine/dataset/slice.thrift b/idl/data/knowledge/slice.thrift similarity index 98% rename from idl/data_engine/dataset/slice.thrift rename to idl/data/knowledge/slice.thrift index 10e19cad..9d190da6 100644 --- a/idl/data_engine/dataset/slice.thrift +++ b/idl/data/knowledge/slice.thrift @@ -1,7 +1,7 @@ include "../../base.thrift" include "common.thrift" -namespace go flow.dataengine.dataset +namespace go data.knowledge struct DeleteSliceRequest { 4: optional list slice_ids (api.body="slice_ids") // List of sharding IDs to delete diff --git a/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift b/idl/data/variable/kvmemory.thrift similarity index 96% rename from idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift rename to idl/data/variable/kvmemory.thrift index 90a60e2c..89086944 100644 --- a/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift +++ b/idl/data/variable/kvmemory.thrift @@ -1,7 +1,9 @@ -include "../../../base.thrift" -include "../table/table.thrift" +include "../../base.thrift" +include "../database/table.thrift" include "./project_memory.thrift" +namespace go data.variable.kvmemory + struct KVItem { 1: string keyword 2: string value diff --git a/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift b/idl/data/variable/project_memory.thrift similarity index 96% rename from idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift rename to idl/data/variable/project_memory.thrift index b31f0e32..4011829a 100644 --- a/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift +++ b/idl/data/variable/project_memory.thrift @@ -1,4 +1,6 @@ -include "../../../base.thrift" +include "../../base.thrift" + +namespace go data.variable.project_memory enum VariableType{ KVVariable = 1 diff --git a/idl/data_engine/ocean_cloud_memory/ocean_cloud_memory.thrift b/idl/data/variable/variable_svc.thrift similarity index 71% rename from idl/data_engine/ocean_cloud_memory/ocean_cloud_memory.thrift rename to idl/data/variable/variable_svc.thrift index 806a177b..b5ee5dfe 100644 --- a/idl/data_engine/ocean_cloud_memory/ocean_cloud_memory.thrift +++ b/idl/data/variable/variable_svc.thrift @@ -1,9 +1,7 @@ -include "kvmemory/kvmemory.thrift" -include "kvmemory/project_memory.thrift" -include "knowledge/kdocument.thrift" -include "table/table.thrift" +include "kvmemory.thrift" +include "project_memory.thrift" -namespace go ocean.cloud.memory +namespace go data.variable service MemoryService { // --- variable @@ -15,10 +13,4 @@ service MemoryService { kvmemory.GetSysVariableConfResponse GetSysVariableConf(1:kvmemory.GetSysVariableConfRequest req)(api.get='/api/memory/sys_variable_conf', api.category="memory") kvmemory.SetKvMemoryResp SetKvMemory(1: kvmemory.SetKvMemoryReq req)(api.post='/api/memory/variable/upsert', api.category="memory",agw.preserve_base="true") // --- - - table.GetModeConfigResponse GetModeConfig(1:table.GetModeConfigRequest req)(api.get='/api/memory/table_mode_config', api.category="memory", agw.preserve_base="true") - - - - kdocument.GetDocumentTableInfoResponse GetDocumentTableInfo(1:kdocument.GetDocumentTableInfoRequest req) (api.get='/api/memory/doc_table_info', api.category="memory", agw.preserve_base="true") } diff --git a/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift b/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift deleted file mode 100644 index af71f208..00000000 --- a/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift +++ /dev/null @@ -1,26 +0,0 @@ -struct DocTableSheet { - 1: i64 id; // Number of sheet - 2: string sheet_name; // Sheet name - 3: i64 total_row; // total number of rows -} - -enum ColumnType { - Unknown = 0 - Text = 1 // Text - Number = 2 // number - Date = 3 // time - Float = 4 // float - Boolean = 5 // bool - Image = 6 // picture -} - -// Table column information -struct DocTableColumn { - 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id"); // Column ID - 2: string column_name; // column_name - 3: bool is_semantic; // Is it a semantically matched column? - 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence"); // List the serial number originally in excel - 5: optional ColumnType column_type; // column type - 6: optional bool contains_empty_value - 7: optional string desc; // describe -} \ No newline at end of file diff --git a/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift b/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift deleted file mode 100644 index 0f8ae5aa..00000000 --- a/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift +++ /dev/null @@ -1,33 +0,0 @@ -include "../../../base.thrift" -include "common.thrift" - -namespace go knowledge.document - -// Get table structure, preview data -struct GetDocumentTableInfoRequest { - 2: optional string tos_uri; // If the table is uploaded for the first local file, pass the value - 3: optional i64 document_id(agw.js_conv="str", api.js_conv="true", api.body="document_id"); // If it is a document with an existing table, pass the value - 4: i64 creator_id; // Creator [http interface does not need to be passed] - 255: optional base.Base Base -} - -struct GetDocumentTableInfoResponse { - 1: i32 code - 2: string msg - 3: list sheet_list - 4: map> table_meta(api.body="table_meta") // key: sheet_id -> list - 5: map>> preview_data(api.body="preview_data") // key: sheet_id -> list_preview_data - - 255: required base.BaseResp BaseResp(api.none="true") -} - -struct GetTableSchemaInfoResponse { - 1: i32 code - 2: string msg - 3: list sheet_list - 4: list table_meta // The schema of the selected sheet, not selected to return the first sheet by default - 5: list> preview_data(agw.js_conv="str", agw.key="preview_data") // The knowledge table will return - - 255: optional base.BaseResp BaseResp(api.none="true") -} - diff --git a/idl/flow/devops/debugger/domain/infra.thrift b/idl/flow/devops/debugger/domain/infra.thrift deleted file mode 100644 index 042b34c6..00000000 --- a/idl/flow/devops/debugger/domain/infra.thrift +++ /dev/null @@ -1,70 +0,0 @@ -namespace go flow.devops.debugger.domain.infra -// ComponentType Supports component types -enum ComponentType { - Undefined = 0 - CozePlugin = 10000 // Coze Plugin - CozeTool = 10001 // Coze Tool - CozeWorkflow = 10002 // Coze Workflow - CozeSubWorkflow = 10003 // Coze SubWorkflow, which is referenced in Workflow. - CozeLLMNode = 10004 // LLM nodes in Coze workflow - CozeCodeNode = 10005 // Coding nodes in a Coze workflow - CozeKnowledgeNode = 10006 // Knowledge nodes in Coze workflow - CozeToolNode = 10007 // Tools nodes in Coze workflow - CozeStartNode = 10008 // Coze workflow start node - CozeVariableNode = 10009 // Cozing variable nodes in workflow - - CozeVariableBot = 20000 // Coze virtual nodes to identify variable dependent bots - CozeVariableChat = 20001 // Coze virtual nodes to identify variable dependent chats -} - - -// TrafficScene traffic request scenario -enum TrafficScene { - Undefined = 0 - CozeSingleAgentDebug = 10000 // Single Agent Debug Page - CozeMultiAgentDebug = 10001 // Multi-Agent Debug Page - CozeToolDebug = 10002 // Tool Debug Page - CozeWorkflowDebug = 10003 // Workflow debugging page -} - -// ComponentMappingType Component Mapping Types -enum ComponentMappingType { - Undefined = 0 - MockSet = 1 -} - -// BizCtx Business Context -struct BizCtx { - 1: optional string connectorID // connectorID - 2: optional string connectorUID // User ID under connector - 3: optional TrafficScene trafficScene // business scenario - 4: optional string trafficCallerID // Business Scenario Component ID, such as Bot Debug Page, where trafficSceneID is BotID - 5: optional string bizSpaceID // Line of business SpaceID for access control - 6: optional map ext // Additional information -} - -// Secondary structure of the ComponentSubject business component -struct ComponentSubject { - 1: optional string componentID // Component IDs, such as Tool ID, Node ID, etc - 2: optional ComponentType componentType // component type - 3: optional string parentComponentID // Parent component ID, e.g. Tool- > Plugin, Node- > Workflow - 4: optional ComponentType parentComponentType // Parent component type -} - -enum OrderBy { - UpdateTime = 1 -} - -struct Creator { - 1: optional string ID - 2: optional string name - 3: optional string avatarUrl -} - -enum DebugScene { - Debug = 0 // Default play ground Debug scene -} - -enum CozeChannel { - Coze = 0 // Default to Coze, expand to other channels in the future -} \ No newline at end of file diff --git a/idl/flow/devops/debugger/domain/testcase.thrift b/idl/flow/devops/debugger/domain/testcase.thrift deleted file mode 100644 index 455fbed4..00000000 --- a/idl/flow/devops/debugger/domain/testcase.thrift +++ /dev/null @@ -1,21 +0,0 @@ -namespace go flow.devops.debugger.domain.testcase - -include "infra.thrift" - -struct CaseDataBase { - 1: optional i64 caseID (go.tag="json:\"caseID,string\"")// Do not fill in when adding, fill in when updating - 2: optional string name - 3: optional string description - 4: optional string input // Input information in JSON format - 5: optional bool isDefault -} - - -struct CaseDataDetail{ - 1: optional CaseDataBase caseBase - 2: optional string creatorID - 3: optional i64 createTimeInSec - 4: optional i64 updateTimeInSec - 5: optional bool schemaIncompatible // Schema incompatibility - 6: optional infra.Creator updater, -} \ No newline at end of file diff --git a/idl/flow/devops/debugger/flow.devops.debugger.coze.thrift b/idl/flow/devops/debugger/flow.devops.debugger.coze.thrift deleted file mode 100644 index 5f45f90f..00000000 --- a/idl/flow/devops/debugger/flow.devops.debugger.coze.thrift +++ /dev/null @@ -1,70 +0,0 @@ -namespace go flow.devops.debugger.coze - -include "../../../base.thrift" -include "./domain/infra.thrift" -include "./domain/testcase.thrift" - -// ========== TestCase =========== // -struct SaveCaseDataReq { - 1: optional infra.BizCtx bizCtx // business information - 2: optional infra.ComponentSubject bizComponentSubject - 3: optional testcase.CaseDataBase caseBase // Case basic data - - 255: optional base.Base Base -} - -struct SaveCaseDataResp { - 1: optional testcase.CaseDataDetail caseDetail - - 253: optional i32 code - 254: optional string msg - 255: optional base.BaseResp BaseResp -} - -struct DeleteCaseDataReq { - 1: optional infra.BizCtx bizCtx // business information - 2: optional list caseIDs // A single maximum of 20 - - 255: optional base.Base Base -} - -struct DeleteCaseDataResp { - 1: optional list deletedCaseIDS - - 253: optional i32 code - 254: optional string msg - 255: optional base.BaseResp BaseResp -} - -struct CheckCaseDuplicateReq { - 1: optional infra.BizCtx bizCtx - 2: optional string caseName // Case name - 3: optional infra.ComponentSubject bizComponentSubject - - 255: optional base.Base Base -} - -struct CheckCaseDuplicateResp { - 1: optional bool isPass - 2: optional string failReason // When pass = false, give the specific reason why the check failed - 3: optional i32 failCode - - 253: optional i32 code - 254: optional string msg - 255: optional base.BaseResp BaseResp -} - -struct GetSchemaByIDReq { - 1: optional infra.BizCtx bizCtx // business information - 2: optional infra.ComponentSubject bizComponentSubject - - 255: optional base.Base Base -} - -struct GetSchemaByIDResp { - 1: optional string schemaJson // Component input information in JSON format, consistent with Input JSON Schema, does not contain Value information - - 253: optional i32 code - 254: optional string msg - 255: optional base.BaseResp BaseResp -} \ No newline at end of file diff --git a/idl/flow/marketplace/marketplace_common.thrift b/idl/marketplace/marketplace_common.thrift similarity index 88% rename from idl/flow/marketplace/marketplace_common.thrift rename to idl/marketplace/marketplace_common.thrift index c921fdce..489aa90b 100644 --- a/idl/flow/marketplace/marketplace_common.thrift +++ b/idl/marketplace/marketplace_common.thrift @@ -1,5 +1,5 @@ -include "../../base.thrift" -namespace go flow.marketplace.marketplace_common +include "../base.thrift" +namespace go marketplace.marketplace_common struct Price { 1: i64 Amount (agw.key = "amount",agw.js_conv="str",api.js_conv="true",agw.cli_conv="str",api.body= "amount"), // amount diff --git a/idl/flow/marketplace/flow_marketplace_product/product_common.thrift b/idl/marketplace/product_common.thrift similarity index 98% rename from idl/flow/marketplace/flow_marketplace_product/product_common.thrift rename to idl/marketplace/product_common.thrift index ad1cad81..3eca639e 100644 --- a/idl/flow/marketplace/flow_marketplace_product/product_common.thrift +++ b/idl/marketplace/product_common.thrift @@ -1,6 +1,6 @@ -include "../marketplace_common.thrift" +include "marketplace_common.thrift" -namespace go flow.marketplace.product_common +namespace go marketplace.product_common enum ProductEntityType { Bot = 1 , diff --git a/idl/flow/marketplace/flow_marketplace_product/public_api.thrift b/idl/marketplace/public_api.thrift similarity index 99% rename from idl/flow/marketplace/flow_marketplace_product/public_api.thrift rename to idl/marketplace/public_api.thrift index 0bfc3771..ca4b1a46 100644 --- a/idl/flow/marketplace/flow_marketplace_product/public_api.thrift +++ b/idl/marketplace/public_api.thrift @@ -1,8 +1,8 @@ -include "../../../base.thrift" +include "../base.thrift" include "product_common.thrift" -include "../marketplace_common.thrift" +include "marketplace_common.thrift" -namespace go flow.marketplace.product_public_api +namespace go marketplace.product_public_api service PublicProductService { GetProductListResponse PublicGetProductList(1: GetProductListRequest req)(api.get = "/api/marketplace/product/list", api.category = "PublicAPI") diff --git a/idl/playground/playground.thrift b/idl/playground/playground.thrift index d939f09c..42a9f05b 100644 --- a/idl/playground/playground.thrift +++ b/idl/playground/playground.thrift @@ -1,9 +1,9 @@ include "../base.thrift" -include "../bot_common/bot_common.thrift" +include "../app/bot_common.thrift" include "shortcut_command.thrift" include "prompt_resource.thrift" -namespace go ocean.cloud.playground +namespace go playground struct UpdateDraftBotInfoAgwResponse { 1: required UpdateDraftBotInfoAgwData data, @@ -447,20 +447,6 @@ struct GetFileUrlsResponse { 255: base.BaseResp BaseResp } -struct UploadFileOpenRequest { - 1: required string ContentType (api.header = "Content-Type", agw.source = "header", agw.key = "Content-Type"), // file type - 2: required binary Data (api.raw_body = ""), // binary data - 255: base.Base Base -} - - -struct UploadFileOpenResponse { - 1: optional File File (api.body = "data") - 253: required i64 code - 254: required string msg - 255: base.BaseResp BaseResp -} - struct File{ 1: string URI (api.body = "uri"), // File URI 2: i64 Bytes (api.body = "bytes"), // file bytes @@ -469,18 +455,6 @@ struct File{ 5: string URL (api.body = "url") } -struct GetBotOnlineInfoReq { - 1 : required i64 bot_id (api.js_conv="true") // botId - 2: optional string connector_id // Keep it first, don't expose it, and don't use the field - 3 : optional string version // bot version, get the latest version if you don't pass it on. -} - -// resp -struct GetBotOnlineInfoResp { - 1: required i32 code - 2: required string msg - 3: required bot_common.OpenAPIBotInfo data -} service PlaygroundService { UpdateDraftBotInfoAgwResponse UpdateDraftBotInfoAgw(1:UpdateDraftBotInfoAgwRequest request)(api.post='/api/playground_api/draftbot/update_draft_bot_info', api.category="draftbot",agw.preserve_base="true") @@ -506,9 +480,4 @@ service PlaygroundService { GetSpaceListV2Response GetSpaceListV2(1:GetSpaceListV2Request request)(api.post='/api/playground_api/space/list', api.category="space",agw.preserve_base="true") MGetUserBasicInfoResponse MGetUserBasicInfo(1: MGetUserBasicInfoRequest request) (api.post='/api/playground_api/mget_user_info', api.category="playground_api",agw.preserve_base="true") - //openapi - GetBotOnlineInfoResp GetBotOnlineInfo(1: GetBotOnlineInfoReq request)(api.get='/v1/bot/get_online_info', api.category="bot", api.tag="openapi", api.gen_path="personal_api") - - // File related OpenAPI - UploadFileOpenResponse UploadFileOpen(1: UploadFileOpenRequest request)(api.post = "/v1/files/upload", api.category="file", api.tag="openapi", agw.preserve_base="true") } diff --git a/idl/playground/prompt_resource.thrift b/idl/playground/prompt_resource.thrift index 7092ae37..c8fbbc8c 100644 --- a/idl/playground/prompt_resource.thrift +++ b/idl/playground/prompt_resource.thrift @@ -1,4 +1,4 @@ -namespace go ocean.cloud.playground +namespace go playground include "../base.thrift" struct GetOfficialPromptResourceListRequest { diff --git a/idl/playground/shortcut_command.thrift b/idl/playground/shortcut_command.thrift index 88a4107f..9c93c1a1 100644 --- a/idl/playground/shortcut_command.thrift +++ b/idl/playground/shortcut_command.thrift @@ -1,4 +1,4 @@ -namespace go ocean.cloud.playground +namespace go playground include "../base.thrift" struct CreateShortcutCommandRequest { diff --git a/idl/plugin/plugin_develop.thrift b/idl/plugin/plugin_develop.thrift index f7fa0905..363898a3 100644 --- a/idl/plugin/plugin_develop.thrift +++ b/idl/plugin/plugin_develop.thrift @@ -1,7 +1,7 @@ include "../base.thrift" include "./plugin_develop_common.thrift" -namespace go ocean.cloud.plugin_develop +namespace go plugin_develop service PluginDevelopService { GetOAuthSchemaResponse GetOAuthSchema(1: GetOAuthSchemaRequest request)(api.post='/api/plugin/get_oauth_schema', api.category="plugin", api.gen_path="plugin") diff --git a/idl/plugin/plugin_develop_common.thrift b/idl/plugin/plugin_develop_common.thrift index 332dd672..e94561d8 100644 --- a/idl/plugin/plugin_develop_common.thrift +++ b/idl/plugin/plugin_develop_common.thrift @@ -1,4 +1,4 @@ - +namespace go plugin_develop.common enum OnlineStatus { OFFLINE = 0, ONLINE = 1, diff --git a/idl/upload/upload.thrift b/idl/upload/upload.thrift index 7ab406ab..7ef322b7 100644 --- a/idl/upload/upload.thrift +++ b/idl/upload/upload.thrift @@ -1,5 +1,5 @@ include "../base.thrift" -include "../bot_common/bot_common.thrift" +include "../app/bot_common.thrift" namespace go file.upload struct CommonUploadRequest { 1: optional binary ByteData (api.raw_body = "") diff --git a/idl/bot_platform/ocean_cloud_workflow/trace.thrift b/idl/workflow/trace.thrift similarity index 99% rename from idl/bot_platform/ocean_cloud_workflow/trace.thrift rename to idl/workflow/trace.thrift index c95c8564..0747297d 100644 --- a/idl/bot_platform/ocean_cloud_workflow/trace.thrift +++ b/idl/workflow/trace.thrift @@ -1,6 +1,6 @@ -include "../../base.thrift" +include "../base.thrift" -namespace go ocean.cloud.workflow +namespace go workflow enum FrontedTagType { TEXT = 0 // Text diff --git a/idl/bot_platform/ocean_cloud_workflow/workflow.thrift b/idl/workflow/workflow.thrift similarity index 99% rename from idl/bot_platform/ocean_cloud_workflow/workflow.thrift rename to idl/workflow/workflow.thrift index ade4dddf..ca22e219 100644 --- a/idl/bot_platform/ocean_cloud_workflow/workflow.thrift +++ b/idl/workflow/workflow.thrift @@ -1,6 +1,6 @@ -include "../../base.thrift" +include "../base.thrift" -namespace go ocean.cloud.workflow +namespace go workflow enum PersistenceModel { DB = 1, diff --git a/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift b/idl/workflow/workflow_svc.thrift similarity index 98% rename from idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift rename to idl/workflow/workflow_svc.thrift index 3ef80b7c..a20312d6 100644 --- a/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift +++ b/idl/workflow/workflow_svc.thrift @@ -1,10 +1,10 @@ -include "../../base.thrift" +include "../base.thrift" include "workflow.thrift" -include "../../resource/resource.thrift" +include "../resource/resource.thrift" include "trace.thrift" -include "../../resource/resource_common.thrift" +include "../resource/resource_common.thrift" -namespace go ocean.cloud.workflow +namespace go workflow service WorkflowService { // Create process