From 3d56a4d3b9a57027d691bbac49d3c5cb8e15699d Mon Sep 17 00:00:00 2001 From: "wangluming.wlm" Date: Wed, 7 Jan 2026 20:26:56 +0800 Subject: [PATCH 1/5] feat:prompt_release --- backend/modules/prompt/domain/repo/manage.go | 1 + .../prompt/domain/repo/mocks/manage_repo.go | 15 +++++++++++ backend/modules/prompt/infra/repo/manage.go | 27 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/backend/modules/prompt/domain/repo/manage.go b/backend/modules/prompt/domain/repo/manage.go index 4ecf0e7a4..87261c11a 100644 --- a/backend/modules/prompt/domain/repo/manage.go +++ b/backend/modules/prompt/domain/repo/manage.go @@ -23,6 +23,7 @@ type IManageRepo interface { CommitDraft(ctx context.Context, param CommitDraftParam) (err error) ListCommitInfo(ctx context.Context, param ListCommitInfoParam) (result *ListCommitResult, err error) MGetVersionsByPromptID(ctx context.Context, promptID int64) (versions []string, err error) + BatchGetPrompt(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) } type GetPromptParam struct { diff --git a/backend/modules/prompt/domain/repo/mocks/manage_repo.go b/backend/modules/prompt/domain/repo/mocks/manage_repo.go index 09a65463d..984bf1c51 100644 --- a/backend/modules/prompt/domain/repo/mocks/manage_repo.go +++ b/backend/modules/prompt/domain/repo/mocks/manage_repo.go @@ -42,6 +42,21 @@ func (m *MockIManageRepo) EXPECT() *MockIManageRepoMockRecorder { return m.recorder } +// BatchGetPrompt mocks base method. +func (m *MockIManageRepo) BatchGetPrompt(ctx context.Context, promptIDs []int64) (map[int64]*entity.Prompt, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BatchGetPrompt", ctx, promptIDs) + ret0, _ := ret[0].(map[int64]*entity.Prompt) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BatchGetPrompt indicates an expected call of BatchGetPrompt. +func (mr *MockIManageRepoMockRecorder) BatchGetPrompt(ctx, promptIDs any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetPrompt", reflect.TypeOf((*MockIManageRepo)(nil).BatchGetPrompt), ctx, promptIDs) +} + // CommitDraft mocks base method. func (m *MockIManageRepo) CommitDraft(ctx context.Context, param repo.CommitDraftParam) error { m.ctrl.T.Helper() diff --git a/backend/modules/prompt/infra/repo/manage.go b/backend/modules/prompt/infra/repo/manage.go index 561ccbc3c..d7b450c5f 100644 --- a/backend/modules/prompt/infra/repo/manage.go +++ b/backend/modules/prompt/infra/repo/manage.go @@ -1082,3 +1082,30 @@ func (d *ManageRepoImpl) ListParentPrompt(ctx context.Context, param repo.ListPa return result, nil } + +func (d *ManageRepoImpl) BatchGetPrompt(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) { + if len(promptIDs) == 0 { + return make(map[int64]*entity.Prompt), nil + } + promptParams := make([]repo.GetPromptParam, 0) + for _, promptID := range promptIDs { + getParam := repo.GetPromptParam{ + PromptID: promptID, + WithCommit: true, + WithDraft: true, + } + promptParams = append(promptParams, getParam) + } + promptRepoMap, err := d.MGetPrompt(ctx, promptParams) + if err != nil { + return nil, err + } + promptMap := make(map[int64]*entity.Prompt, len(promptIDs)) + for _, prompt := range promptRepoMap { + if prompt == nil { + continue + } + promptMap[prompt.ID] = prompt + } + return promptMap, nil +} From d775c3f7b45422d7ba048b6bc0eaa909971dc338 Mon Sep 17 00:00:00 2001 From: "wangluming.wlm" Date: Mon, 12 Jan 2026 15:15:29 +0800 Subject: [PATCH 2/5] feat:prompt_release --- backend/modules/prompt/domain/repo/manage.go | 2 +- .../modules/prompt/domain/repo/mocks/manage_repo.go | 12 ++++++------ backend/modules/prompt/infra/repo/manage.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/modules/prompt/domain/repo/manage.go b/backend/modules/prompt/domain/repo/manage.go index 87261c11a..6454e96b8 100644 --- a/backend/modules/prompt/domain/repo/manage.go +++ b/backend/modules/prompt/domain/repo/manage.go @@ -23,7 +23,7 @@ type IManageRepo interface { CommitDraft(ctx context.Context, param CommitDraftParam) (err error) ListCommitInfo(ctx context.Context, param ListCommitInfoParam) (result *ListCommitResult, err error) MGetVersionsByPromptID(ctx context.Context, promptID int64) (versions []string, err error) - BatchGetPrompt(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) + BatchGetPromptBasic(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) } type GetPromptParam struct { diff --git a/backend/modules/prompt/domain/repo/mocks/manage_repo.go b/backend/modules/prompt/domain/repo/mocks/manage_repo.go index 984bf1c51..02bcfe412 100644 --- a/backend/modules/prompt/domain/repo/mocks/manage_repo.go +++ b/backend/modules/prompt/domain/repo/mocks/manage_repo.go @@ -42,19 +42,19 @@ func (m *MockIManageRepo) EXPECT() *MockIManageRepoMockRecorder { return m.recorder } -// BatchGetPrompt mocks base method. -func (m *MockIManageRepo) BatchGetPrompt(ctx context.Context, promptIDs []int64) (map[int64]*entity.Prompt, error) { +// BatchGetPromptBasic mocks base method. +func (m *MockIManageRepo) BatchGetPromptBasic(ctx context.Context, promptIDs []int64) (map[int64]*entity.Prompt, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BatchGetPrompt", ctx, promptIDs) + ret := m.ctrl.Call(m, "BatchGetPromptBasic", ctx, promptIDs) ret0, _ := ret[0].(map[int64]*entity.Prompt) ret1, _ := ret[1].(error) return ret0, ret1 } -// BatchGetPrompt indicates an expected call of BatchGetPrompt. -func (mr *MockIManageRepoMockRecorder) BatchGetPrompt(ctx, promptIDs any) *gomock.Call { +// BatchGetPromptBasic indicates an expected call of BatchGetPromptBasic. +func (mr *MockIManageRepoMockRecorder) BatchGetPromptBasic(ctx, promptIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetPrompt", reflect.TypeOf((*MockIManageRepo)(nil).BatchGetPrompt), ctx, promptIDs) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetPromptBasic", reflect.TypeOf((*MockIManageRepo)(nil).BatchGetPromptBasic), ctx, promptIDs) } // CommitDraft mocks base method. diff --git a/backend/modules/prompt/infra/repo/manage.go b/backend/modules/prompt/infra/repo/manage.go index d7b450c5f..d741724ec 100644 --- a/backend/modules/prompt/infra/repo/manage.go +++ b/backend/modules/prompt/infra/repo/manage.go @@ -1083,7 +1083,7 @@ func (d *ManageRepoImpl) ListParentPrompt(ctx context.Context, param repo.ListPa return result, nil } -func (d *ManageRepoImpl) BatchGetPrompt(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) { +func (d *ManageRepoImpl) BatchGetPromptBasic(ctx context.Context, promptIDs []int64) (promptDOMap map[int64]*entity.Prompt, err error) { if len(promptIDs) == 0 { return make(map[int64]*entity.Prompt), nil } @@ -1091,8 +1091,8 @@ func (d *ManageRepoImpl) BatchGetPrompt(ctx context.Context, promptIDs []int64) for _, promptID := range promptIDs { getParam := repo.GetPromptParam{ PromptID: promptID, - WithCommit: true, - WithDraft: true, + WithCommit: false, + WithDraft: false, } promptParams = append(promptParams, getParam) } From d845e800c7be109499604f4075965aa8933a971a Mon Sep 17 00:00:00 2001 From: "wangluming.wlm" Date: Mon, 19 Jan 2026 11:20:46 +0800 Subject: [PATCH 3/5] feat:prompt_release --- .../loop/apis/promptmanageservice/client.go | 6 + .../promptmanageservice.go | 36 + .../expt/coze.loop.evaluation.expt.go | 2 +- .../prompt/manage/coze.loop.prompt.manage.go | 1839 +++++++++++++---- .../coze.loop.prompt.manage_validator.go | 22 + .../manage/k-coze.loop.prompt.manage.go | 694 +++++++ .../manage/promptmanageservice/client.go | 6 + .../promptmanageservice.go | 36 + .../loop/prompt/promptmanageservice/client.go | 6 + .../promptmanageservice.go | 36 + .../lomanage/local_promptmanageservice.go | 21 + backend/modules/prompt/application/manage.go | 25 + .../prompt/coze.loop.prompt.manage.thrift | 14 + 13 files changed, 2334 insertions(+), 409 deletions(-) diff --git a/backend/kitex_gen/coze/loop/apis/promptmanageservice/client.go b/backend/kitex_gen/coze/loop/apis/promptmanageservice/client.go index 3e7b1c158..aaec1bad2 100644 --- a/backend/kitex_gen/coze/loop/apis/promptmanageservice/client.go +++ b/backend/kitex_gen/coze/loop/apis/promptmanageservice/client.go @@ -18,6 +18,7 @@ type Client interface { BatchGetPrompt(ctx context.Context, request *manage.BatchGetPromptRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptResponse, err error) ListPrompt(ctx context.Context, request *manage.ListPromptRequest, callOptions ...callopt.Option) (r *manage.ListPromptResponse, err error) ListParentPrompt(ctx context.Context, request *manage.ListParentPromptRequest, callOptions ...callopt.Option) (r *manage.ListParentPromptResponse, err error) + BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) SaveDraft(ctx context.Context, request *manage.SaveDraftRequest, callOptions ...callopt.Option) (r *manage.SaveDraftResponse, err error) CreateLabel(ctx context.Context, request *manage.CreateLabelRequest, callOptions ...callopt.Option) (r *manage.CreateLabelResponse, err error) @@ -93,6 +94,11 @@ func (p *kPromptManageServiceClient) ListParentPrompt(ctx context.Context, reque return p.kClient.ListParentPrompt(ctx, request) } +func (p *kPromptManageServiceClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.BatchGetPromptBasic(ctx, request) +} + func (p *kPromptManageServiceClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.UpdatePrompt(ctx, request) diff --git a/backend/kitex_gen/coze/loop/apis/promptmanageservice/promptmanageservice.go b/backend/kitex_gen/coze/loop/apis/promptmanageservice/promptmanageservice.go index 331bb3c02..f3917260f 100644 --- a/backend/kitex_gen/coze/loop/apis/promptmanageservice/promptmanageservice.go +++ b/backend/kitex_gen/coze/loop/apis/promptmanageservice/promptmanageservice.go @@ -63,6 +63,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "BatchGetPromptBasic": kitex.NewMethodInfo( + batchGetPromptBasicHandler, + newPromptManageServiceBatchGetPromptBasicArgs, + newPromptManageServiceBatchGetPromptBasicResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "UpdatePrompt": kitex.NewMethodInfo( updatePromptHandler, newPromptManageServiceUpdatePromptArgs, @@ -292,6 +299,25 @@ func newPromptManageServiceListParentPromptResult() interface{} { return manage.NewPromptManageServiceListParentPromptResult() } +func batchGetPromptBasicHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*manage.PromptManageServiceBatchGetPromptBasicArgs) + realResult := result.(*manage.PromptManageServiceBatchGetPromptBasicResult) + success, err := handler.(manage.PromptManageService).BatchGetPromptBasic(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newPromptManageServiceBatchGetPromptBasicArgs() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicArgs() +} + +func newPromptManageServiceBatchGetPromptBasicResult() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicResult() +} + func updatePromptHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*manage.PromptManageServiceUpdatePromptArgs) realResult := result.(*manage.PromptManageServiceUpdatePromptResult) @@ -545,6 +571,16 @@ func (p *kClient) ListParentPrompt(ctx context.Context, request *manage.ListPare return _result.GetSuccess(), nil } +func (p *kClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest) (r *manage.BatchGetPromptBasicResponse, err error) { + var _args manage.PromptManageServiceBatchGetPromptBasicArgs + _args.Request = request + var _result manage.PromptManageServiceBatchGetPromptBasicResult + if err = p.c.Call(ctx, "BatchGetPromptBasic", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest) (r *manage.UpdatePromptResponse, err error) { var _args manage.PromptManageServiceUpdatePromptArgs _args.Request = request diff --git a/backend/kitex_gen/coze/loop/evaluation/expt/coze.loop.evaluation.expt.go b/backend/kitex_gen/coze/loop/evaluation/expt/coze.loop.evaluation.expt.go index 6e11ef3b8..6e69b37d2 100644 --- a/backend/kitex_gen/coze/loop/evaluation/expt/coze.loop.evaluation.expt.go +++ b/backend/kitex_gen/coze/loop/evaluation/expt/coze.loop.evaluation.expt.go @@ -12322,7 +12322,7 @@ func (p *BatchGetExperimentAggrResultResponse) Field255DeepEqual(src *base.BaseR type CalculateExperimentAggrResultRequest struct { WorkspaceID int64 `thrift:"workspace_id,1,required" frugal:"1,required,i64" form:"workspace_id,required" json:"workspace_id,string,required"` - ExptID int64 `thrift:"expt_id,2,required" frugal:"2,required,i64" json:"expt_id,required" path:"expt_id,required"` + ExptID int64 `thrift:"expt_id,2,required" frugal:"2,required,i64" json:"expt_id,string,required" path:"expt_id,required"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } diff --git a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go index 64dca1a7f..5ac6b1591 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go @@ -13138,6 +13138,625 @@ func (p *ListParentPromptResponse) Field255DeepEqual(src *base.BaseResp) bool { return true } +type BatchGetPromptBasicRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + PromptIds []int64 `thrift:"prompt_ids,2,optional" frugal:"2,optional,list" form:"prompt_ids" json:"prompt_ids,omitempty" query:"prompt_ids"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewBatchGetPromptBasicRequest() *BatchGetPromptBasicRequest { + return &BatchGetPromptBasicRequest{} +} + +func (p *BatchGetPromptBasicRequest) InitDefault() { +} + +var BatchGetPromptBasicRequest_WorkspaceID_DEFAULT int64 + +func (p *BatchGetPromptBasicRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return BatchGetPromptBasicRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var BatchGetPromptBasicRequest_PromptIds_DEFAULT []int64 + +func (p *BatchGetPromptBasicRequest) GetPromptIds() (v []int64) { + if p == nil { + return + } + if !p.IsSetPromptIds() { + return BatchGetPromptBasicRequest_PromptIds_DEFAULT + } + return p.PromptIds +} + +var BatchGetPromptBasicRequest_Base_DEFAULT *base.Base + +func (p *BatchGetPromptBasicRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return BatchGetPromptBasicRequest_Base_DEFAULT + } + return p.Base +} +func (p *BatchGetPromptBasicRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *BatchGetPromptBasicRequest) SetPromptIds(val []int64) { + p.PromptIds = val +} +func (p *BatchGetPromptBasicRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_BatchGetPromptBasicRequest = map[int16]string{ + 1: "workspace_id", + 2: "prompt_ids", + 255: "Base", +} + +func (p *BatchGetPromptBasicRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *BatchGetPromptBasicRequest) IsSetPromptIds() bool { + return p.PromptIds != nil +} + +func (p *BatchGetPromptBasicRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *BatchGetPromptBasicRequest) 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.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_BatchGetPromptBasicRequest[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 *BatchGetPromptBasicRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *BatchGetPromptBasicRequest) 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.PromptIds = _field + return nil +} +func (p *BatchGetPromptBasicRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *BatchGetPromptBasicRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetPromptBasicRequest"); 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 *BatchGetPromptBasicRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); 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 *BatchGetPromptBasicRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPromptIds() { + if err = oprot.WriteFieldBegin("prompt_ids", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.I64, len(p.PromptIds)); err != nil { + return err + } + for _, v := range p.PromptIds { + 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 *BatchGetPromptBasicRequest) 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 *BatchGetPromptBasicRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BatchGetPromptBasicRequest(%+v)", *p) + +} + +func (p *BatchGetPromptBasicRequest) DeepEqual(ano *BatchGetPromptBasicRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.PromptIds) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *BatchGetPromptBasicRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *BatchGetPromptBasicRequest) Field2DeepEqual(src []int64) bool { + + if len(p.PromptIds) != len(src) { + return false + } + for i, v := range p.PromptIds { + _src := src[i] + if v != _src { + return false + } + } + return true +} +func (p *BatchGetPromptBasicRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type BatchGetPromptBasicResponse struct { + Prompts []*prompt.Prompt `thrift:"prompts,1,optional" frugal:"1,optional,list" form:"prompts" json:"prompts,omitempty" query:"prompts"` + BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" frugal:"255,optional,base.BaseResp" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` +} + +func NewBatchGetPromptBasicResponse() *BatchGetPromptBasicResponse { + return &BatchGetPromptBasicResponse{} +} + +func (p *BatchGetPromptBasicResponse) InitDefault() { +} + +var BatchGetPromptBasicResponse_Prompts_DEFAULT []*prompt.Prompt + +func (p *BatchGetPromptBasicResponse) GetPrompts() (v []*prompt.Prompt) { + if p == nil { + return + } + if !p.IsSetPrompts() { + return BatchGetPromptBasicResponse_Prompts_DEFAULT + } + return p.Prompts +} + +var BatchGetPromptBasicResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *BatchGetPromptBasicResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return BatchGetPromptBasicResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *BatchGetPromptBasicResponse) SetPrompts(val []*prompt.Prompt) { + p.Prompts = val +} +func (p *BatchGetPromptBasicResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_BatchGetPromptBasicResponse = map[int16]string{ + 1: "prompts", + 255: "BaseResp", +} + +func (p *BatchGetPromptBasicResponse) IsSetPrompts() bool { + return p.Prompts != nil +} + +func (p *BatchGetPromptBasicResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *BatchGetPromptBasicResponse) 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 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_BatchGetPromptBasicResponse[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 *BatchGetPromptBasicResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*prompt.Prompt, 0, size) + values := make([]prompt.Prompt, 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.Prompts = _field + return nil +} +func (p *BatchGetPromptBasicResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *BatchGetPromptBasicResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetPromptBasicResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + 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 *BatchGetPromptBasicResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetPrompts() { + if err = oprot.WriteFieldBegin("prompts", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Prompts)); err != nil { + return err + } + for _, v := range p.Prompts { + 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *BatchGetPromptBasicResponse) 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 *BatchGetPromptBasicResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BatchGetPromptBasicResponse(%+v)", *p) + +} + +func (p *BatchGetPromptBasicResponse) DeepEqual(ano *BatchGetPromptBasicResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Prompts) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *BatchGetPromptBasicResponse) Field1DeepEqual(src []*prompt.Prompt) bool { + + if len(p.Prompts) != len(src) { + return false + } + for i, v := range p.Prompts { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *BatchGetPromptBasicResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + type PromptManageService interface { // --------------- Prompt管理 --------------- // // 增 @@ -13154,6 +13773,8 @@ type PromptManageService interface { ListPrompt(ctx context.Context, request *ListPromptRequest) (r *ListPromptResponse, err error) // 查询片段的引用记录 ListParentPrompt(ctx context.Context, request *ListParentPromptRequest) (r *ListParentPromptResponse, err error) + + BatchGetPromptBasic(ctx context.Context, request *BatchGetPromptBasicRequest) (r *BatchGetPromptBasicResponse, err error) // 改 UpdatePrompt(ctx context.Context, request *UpdatePromptRequest) (r *UpdatePromptResponse, err error) @@ -13264,6 +13885,15 @@ func (p *PromptManageServiceClient) ListParentPrompt(ctx context.Context, reques } return _result.GetSuccess(), nil } +func (p *PromptManageServiceClient) BatchGetPromptBasic(ctx context.Context, request *BatchGetPromptBasicRequest) (r *BatchGetPromptBasicResponse, err error) { + var _args PromptManageServiceBatchGetPromptBasicArgs + _args.Request = request + var _result PromptManageServiceBatchGetPromptBasicResult + if err = p.Client_().Call(ctx, "BatchGetPromptBasic", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} func (p *PromptManageServiceClient) UpdatePrompt(ctx context.Context, request *UpdatePromptRequest) (r *UpdatePromptResponse, err error) { var _args PromptManageServiceUpdatePromptArgs _args.Request = request @@ -13373,6 +14003,7 @@ func NewPromptManageServiceProcessor(handler PromptManageService) *PromptManageS self.AddToProcessorMap("BatchGetPrompt", &promptManageServiceProcessorBatchGetPrompt{handler: handler}) self.AddToProcessorMap("ListPrompt", &promptManageServiceProcessorListPrompt{handler: handler}) self.AddToProcessorMap("ListParentPrompt", &promptManageServiceProcessorListParentPrompt{handler: handler}) + self.AddToProcessorMap("BatchGetPromptBasic", &promptManageServiceProcessorBatchGetPromptBasic{handler: handler}) self.AddToProcessorMap("UpdatePrompt", &promptManageServiceProcessorUpdatePrompt{handler: handler}) self.AddToProcessorMap("SaveDraft", &promptManageServiceProcessorSaveDraft{handler: handler}) self.AddToProcessorMap("CreateLabel", &promptManageServiceProcessorCreateLabel{handler: handler}) @@ -13738,6 +14369,54 @@ func (p *promptManageServiceProcessorListParentPrompt) Process(ctx context.Conte return true, err } +type promptManageServiceProcessorBatchGetPromptBasic struct { + handler PromptManageService +} + +func (p *promptManageServiceProcessorBatchGetPromptBasic) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PromptManageServiceBatchGetPromptBasicArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetPromptBasic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := PromptManageServiceBatchGetPromptBasicResult{} + var retval *BatchGetPromptBasicResponse + if retval, err2 = p.handler.BatchGetPromptBasic(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetPromptBasic: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetPromptBasic", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetPromptBasic", 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 promptManageServiceProcessorUpdatePrompt struct { handler PromptManageService } @@ -14008,7 +14687,103 @@ func (p *promptManageServiceProcessorListCommit) Process(ctx context.Context, se } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ListCommit", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("ListCommit", 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 promptManageServiceProcessorCommitDraft struct { + handler PromptManageService +} + +func (p *promptManageServiceProcessorCommitDraft) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PromptManageServiceCommitDraftArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CommitDraft", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := PromptManageServiceCommitDraftResult{} + var retval *CommitDraftResponse + if retval, err2 = p.handler.CommitDraft(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CommitDraft: "+err2.Error()) + oprot.WriteMessageBegin("CommitDraft", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("CommitDraft", 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 promptManageServiceProcessorRevertDraftFromCommit struct { + handler PromptManageService +} + +func (p *promptManageServiceProcessorRevertDraftFromCommit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PromptManageServiceRevertDraftFromCommitArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := PromptManageServiceRevertDraftFromCommitResult{} + var retval *RevertDraftFromCommitResponse + if retval, err2 = p.handler.RevertDraftFromCommit(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RevertDraftFromCommit: "+err2.Error()) + oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -14026,16 +14801,16 @@ func (p *promptManageServiceProcessorListCommit) Process(ctx context.Context, se return true, err } -type promptManageServiceProcessorCommitDraft struct { +type promptManageServiceProcessorUpdateCommitLabels struct { handler PromptManageService } -func (p *promptManageServiceProcessorCommitDraft) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PromptManageServiceCommitDraftArgs{} +func (p *promptManageServiceProcessorUpdateCommitLabels) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PromptManageServiceUpdateCommitLabelsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CommitDraft", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("UpdateCommitLabels", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -14044,11 +14819,11 @@ func (p *promptManageServiceProcessorCommitDraft) Process(ctx context.Context, s iprot.ReadMessageEnd() var err2 error - result := PromptManageServiceCommitDraftResult{} - var retval *CommitDraftResponse - if retval, err2 = p.handler.CommitDraft(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CommitDraft: "+err2.Error()) - oprot.WriteMessageBegin("CommitDraft", thrift.EXCEPTION, seqId) + result := PromptManageServiceUpdateCommitLabelsResult{} + var retval *UpdateCommitLabelsResponse + if retval, err2 = p.handler.UpdateCommitLabels(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UpdateCommitLabels: "+err2.Error()) + oprot.WriteMessageBegin("UpdateCommitLabels", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -14056,7 +14831,7 @@ func (p *promptManageServiceProcessorCommitDraft) Process(ctx context.Context, s } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("CommitDraft", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("UpdateCommitLabels", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -14068,143 +14843,391 @@ func (p *promptManageServiceProcessorCommitDraft) Process(ctx context.Context, s if err2 = oprot.Flush(ctx); err == nil && err2 != nil { err = err2 } - if err != nil { - return + if err != nil { + return + } + return true, err +} + +type PromptManageServiceCreatePromptArgs struct { + Request *CreatePromptRequest `thrift:"request,1" frugal:"1,default,CreatePromptRequest"` +} + +func NewPromptManageServiceCreatePromptArgs() *PromptManageServiceCreatePromptArgs { + return &PromptManageServiceCreatePromptArgs{} +} + +func (p *PromptManageServiceCreatePromptArgs) InitDefault() { +} + +var PromptManageServiceCreatePromptArgs_Request_DEFAULT *CreatePromptRequest + +func (p *PromptManageServiceCreatePromptArgs) GetRequest() (v *CreatePromptRequest) { + if p == nil { + return + } + if !p.IsSetRequest() { + return PromptManageServiceCreatePromptArgs_Request_DEFAULT + } + return p.Request +} +func (p *PromptManageServiceCreatePromptArgs) SetRequest(val *CreatePromptRequest) { + p.Request = val +} + +var fieldIDToName_PromptManageServiceCreatePromptArgs = map[int16]string{ + 1: "request", +} + +func (p *PromptManageServiceCreatePromptArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *PromptManageServiceCreatePromptArgs) 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_PromptManageServiceCreatePromptArgs[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 *PromptManageServiceCreatePromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreatePromptRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *PromptManageServiceCreatePromptArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreatePrompt_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 *PromptManageServiceCreatePromptArgs) 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 *PromptManageServiceCreatePromptArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PromptManageServiceCreatePromptArgs(%+v)", *p) + +} + +func (p *PromptManageServiceCreatePromptArgs) DeepEqual(ano *PromptManageServiceCreatePromptArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *PromptManageServiceCreatePromptArgs) Field1DeepEqual(src *CreatePromptRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type PromptManageServiceCreatePromptResult struct { + Success *CreatePromptResponse `thrift:"success,0,optional" frugal:"0,optional,CreatePromptResponse"` +} + +func NewPromptManageServiceCreatePromptResult() *PromptManageServiceCreatePromptResult { + return &PromptManageServiceCreatePromptResult{} +} + +func (p *PromptManageServiceCreatePromptResult) InitDefault() { +} + +var PromptManageServiceCreatePromptResult_Success_DEFAULT *CreatePromptResponse + +func (p *PromptManageServiceCreatePromptResult) GetSuccess() (v *CreatePromptResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return PromptManageServiceCreatePromptResult_Success_DEFAULT + } + return p.Success +} +func (p *PromptManageServiceCreatePromptResult) SetSuccess(x interface{}) { + p.Success = x.(*CreatePromptResponse) +} + +var fieldIDToName_PromptManageServiceCreatePromptResult = map[int16]string{ + 0: "success", +} + +func (p *PromptManageServiceCreatePromptResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *PromptManageServiceCreatePromptResult) 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 true, err -} -type promptManageServiceProcessorRevertDraftFromCommit struct { - handler PromptManageService + 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_PromptManageServiceCreatePromptResult[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 *promptManageServiceProcessorRevertDraftFromCommit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PromptManageServiceRevertDraftFromCommitArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *PromptManageServiceCreatePromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreatePromptResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := PromptManageServiceRevertDraftFromCommitResult{} - var retval *RevertDraftFromCommitResponse - if retval, err2 = p.handler.RevertDraftFromCommit(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RevertDraftFromCommit: "+err2.Error()) - oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("RevertDraftFromCommit", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *PromptManageServiceCreatePromptResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreatePrompt_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err != nil { - return + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - return true, err + 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) } -type promptManageServiceProcessorUpdateCommitLabels struct { - handler PromptManageService +func (p *PromptManageServiceCreatePromptResult) 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 *promptManageServiceProcessorUpdateCommitLabels) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PromptManageServiceUpdateCommitLabelsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UpdateCommitLabels", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *PromptManageServiceCreatePromptResult) String() string { + if p == nil { + return "" } + return fmt.Sprintf("PromptManageServiceCreatePromptResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := PromptManageServiceUpdateCommitLabelsResult{} - var retval *UpdateCommitLabelsResponse - if retval, err2 = p.handler.UpdateCommitLabels(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UpdateCommitLabels: "+err2.Error()) - oprot.WriteMessageBegin("UpdateCommitLabels", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("UpdateCommitLabels", 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 +} + +func (p *PromptManageServiceCreatePromptResult) DeepEqual(ano *PromptManageServiceCreatePromptResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if !p.Field0DeepEqual(ano.Success) { + return false } - if err != nil { - return + return true +} + +func (p *PromptManageServiceCreatePromptResult) Field0DeepEqual(src *CreatePromptResponse) bool { + + if !p.Success.DeepEqual(src) { + return false } - return true, err + return true } -type PromptManageServiceCreatePromptArgs struct { - Request *CreatePromptRequest `thrift:"request,1" frugal:"1,default,CreatePromptRequest"` +type PromptManageServiceClonePromptArgs struct { + Request *ClonePromptRequest `thrift:"request,1" frugal:"1,default,ClonePromptRequest"` } -func NewPromptManageServiceCreatePromptArgs() *PromptManageServiceCreatePromptArgs { - return &PromptManageServiceCreatePromptArgs{} +func NewPromptManageServiceClonePromptArgs() *PromptManageServiceClonePromptArgs { + return &PromptManageServiceClonePromptArgs{} } -func (p *PromptManageServiceCreatePromptArgs) InitDefault() { +func (p *PromptManageServiceClonePromptArgs) InitDefault() { } -var PromptManageServiceCreatePromptArgs_Request_DEFAULT *CreatePromptRequest +var PromptManageServiceClonePromptArgs_Request_DEFAULT *ClonePromptRequest -func (p *PromptManageServiceCreatePromptArgs) GetRequest() (v *CreatePromptRequest) { +func (p *PromptManageServiceClonePromptArgs) GetRequest() (v *ClonePromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceCreatePromptArgs_Request_DEFAULT + return PromptManageServiceClonePromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceCreatePromptArgs) SetRequest(val *CreatePromptRequest) { +func (p *PromptManageServiceClonePromptArgs) SetRequest(val *ClonePromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceCreatePromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceClonePromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceCreatePromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceClonePromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceCreatePromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14249,7 +15272,7 @@ ReadStructBeginError: 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_PromptManageServiceCreatePromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceClonePromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14259,8 +15282,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceCreatePromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCreatePromptRequest() +func (p *PromptManageServiceClonePromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewClonePromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14268,9 +15291,9 @@ func (p *PromptManageServiceCreatePromptArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *PromptManageServiceCreatePromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreatePrompt_args"); err != nil { + if err = oprot.WriteStructBegin("ClonePrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14296,7 +15319,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceCreatePromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14313,15 +15336,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceCreatePromptArgs) String() string { +func (p *PromptManageServiceClonePromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceCreatePromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceClonePromptArgs(%+v)", *p) } -func (p *PromptManageServiceCreatePromptArgs) DeepEqual(ano *PromptManageServiceCreatePromptArgs) bool { +func (p *PromptManageServiceClonePromptArgs) DeepEqual(ano *PromptManageServiceClonePromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14333,7 +15356,7 @@ func (p *PromptManageServiceCreatePromptArgs) DeepEqual(ano *PromptManageService return true } -func (p *PromptManageServiceCreatePromptArgs) Field1DeepEqual(src *CreatePromptRequest) bool { +func (p *PromptManageServiceClonePromptArgs) Field1DeepEqual(src *ClonePromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -14341,41 +15364,41 @@ func (p *PromptManageServiceCreatePromptArgs) Field1DeepEqual(src *CreatePromptR return true } -type PromptManageServiceCreatePromptResult struct { - Success *CreatePromptResponse `thrift:"success,0,optional" frugal:"0,optional,CreatePromptResponse"` +type PromptManageServiceClonePromptResult struct { + Success *ClonePromptResponse `thrift:"success,0,optional" frugal:"0,optional,ClonePromptResponse"` } -func NewPromptManageServiceCreatePromptResult() *PromptManageServiceCreatePromptResult { - return &PromptManageServiceCreatePromptResult{} +func NewPromptManageServiceClonePromptResult() *PromptManageServiceClonePromptResult { + return &PromptManageServiceClonePromptResult{} } -func (p *PromptManageServiceCreatePromptResult) InitDefault() { +func (p *PromptManageServiceClonePromptResult) InitDefault() { } -var PromptManageServiceCreatePromptResult_Success_DEFAULT *CreatePromptResponse +var PromptManageServiceClonePromptResult_Success_DEFAULT *ClonePromptResponse -func (p *PromptManageServiceCreatePromptResult) GetSuccess() (v *CreatePromptResponse) { +func (p *PromptManageServiceClonePromptResult) GetSuccess() (v *ClonePromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceCreatePromptResult_Success_DEFAULT + return PromptManageServiceClonePromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceCreatePromptResult) SetSuccess(x interface{}) { - p.Success = x.(*CreatePromptResponse) +func (p *PromptManageServiceClonePromptResult) SetSuccess(x interface{}) { + p.Success = x.(*ClonePromptResponse) } -var fieldIDToName_PromptManageServiceCreatePromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceClonePromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceCreatePromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceClonePromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceCreatePromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14420,7 +15443,7 @@ ReadStructBeginError: 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_PromptManageServiceCreatePromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceClonePromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14429,9 +15452,9 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - -func (p *PromptManageServiceCreatePromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCreatePromptResponse() + +func (p *PromptManageServiceClonePromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewClonePromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14439,9 +15462,9 @@ func (p *PromptManageServiceCreatePromptResult) ReadField0(iprot thrift.TProtoco return nil } -func (p *PromptManageServiceCreatePromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreatePrompt_result"); err != nil { + if err = oprot.WriteStructBegin("ClonePrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14467,7 +15490,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceCreatePromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceClonePromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14486,15 +15509,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceCreatePromptResult) String() string { +func (p *PromptManageServiceClonePromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceCreatePromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceClonePromptResult(%+v)", *p) } -func (p *PromptManageServiceCreatePromptResult) DeepEqual(ano *PromptManageServiceCreatePromptResult) bool { +func (p *PromptManageServiceClonePromptResult) DeepEqual(ano *PromptManageServiceClonePromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14506,7 +15529,7 @@ func (p *PromptManageServiceCreatePromptResult) DeepEqual(ano *PromptManageServi return true } -func (p *PromptManageServiceCreatePromptResult) Field0DeepEqual(src *CreatePromptResponse) bool { +func (p *PromptManageServiceClonePromptResult) Field0DeepEqual(src *ClonePromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -14514,41 +15537,41 @@ func (p *PromptManageServiceCreatePromptResult) Field0DeepEqual(src *CreatePromp return true } -type PromptManageServiceClonePromptArgs struct { - Request *ClonePromptRequest `thrift:"request,1" frugal:"1,default,ClonePromptRequest"` +type PromptManageServiceDeletePromptArgs struct { + Request *DeletePromptRequest `thrift:"request,1" frugal:"1,default,DeletePromptRequest"` } -func NewPromptManageServiceClonePromptArgs() *PromptManageServiceClonePromptArgs { - return &PromptManageServiceClonePromptArgs{} +func NewPromptManageServiceDeletePromptArgs() *PromptManageServiceDeletePromptArgs { + return &PromptManageServiceDeletePromptArgs{} } -func (p *PromptManageServiceClonePromptArgs) InitDefault() { +func (p *PromptManageServiceDeletePromptArgs) InitDefault() { } -var PromptManageServiceClonePromptArgs_Request_DEFAULT *ClonePromptRequest +var PromptManageServiceDeletePromptArgs_Request_DEFAULT *DeletePromptRequest -func (p *PromptManageServiceClonePromptArgs) GetRequest() (v *ClonePromptRequest) { +func (p *PromptManageServiceDeletePromptArgs) GetRequest() (v *DeletePromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceClonePromptArgs_Request_DEFAULT + return PromptManageServiceDeletePromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceClonePromptArgs) SetRequest(val *ClonePromptRequest) { +func (p *PromptManageServiceDeletePromptArgs) SetRequest(val *DeletePromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceClonePromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceDeletePromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceClonePromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceDeletePromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceClonePromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14593,7 +15616,7 @@ ReadStructBeginError: 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_PromptManageServiceClonePromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceDeletePromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14603,8 +15626,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceClonePromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewClonePromptRequest() +func (p *PromptManageServiceDeletePromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeletePromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14612,9 +15635,9 @@ func (p *PromptManageServiceClonePromptArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *PromptManageServiceClonePromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ClonePrompt_args"); err != nil { + if err = oprot.WriteStructBegin("DeletePrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14640,7 +15663,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceClonePromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14657,15 +15680,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceClonePromptArgs) String() string { +func (p *PromptManageServiceDeletePromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceClonePromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceDeletePromptArgs(%+v)", *p) } -func (p *PromptManageServiceClonePromptArgs) DeepEqual(ano *PromptManageServiceClonePromptArgs) bool { +func (p *PromptManageServiceDeletePromptArgs) DeepEqual(ano *PromptManageServiceDeletePromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14677,7 +15700,7 @@ func (p *PromptManageServiceClonePromptArgs) DeepEqual(ano *PromptManageServiceC return true } -func (p *PromptManageServiceClonePromptArgs) Field1DeepEqual(src *ClonePromptRequest) bool { +func (p *PromptManageServiceDeletePromptArgs) Field1DeepEqual(src *DeletePromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -14685,41 +15708,41 @@ func (p *PromptManageServiceClonePromptArgs) Field1DeepEqual(src *ClonePromptReq return true } -type PromptManageServiceClonePromptResult struct { - Success *ClonePromptResponse `thrift:"success,0,optional" frugal:"0,optional,ClonePromptResponse"` +type PromptManageServiceDeletePromptResult struct { + Success *DeletePromptResponse `thrift:"success,0,optional" frugal:"0,optional,DeletePromptResponse"` } -func NewPromptManageServiceClonePromptResult() *PromptManageServiceClonePromptResult { - return &PromptManageServiceClonePromptResult{} +func NewPromptManageServiceDeletePromptResult() *PromptManageServiceDeletePromptResult { + return &PromptManageServiceDeletePromptResult{} } -func (p *PromptManageServiceClonePromptResult) InitDefault() { +func (p *PromptManageServiceDeletePromptResult) InitDefault() { } -var PromptManageServiceClonePromptResult_Success_DEFAULT *ClonePromptResponse +var PromptManageServiceDeletePromptResult_Success_DEFAULT *DeletePromptResponse -func (p *PromptManageServiceClonePromptResult) GetSuccess() (v *ClonePromptResponse) { +func (p *PromptManageServiceDeletePromptResult) GetSuccess() (v *DeletePromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceClonePromptResult_Success_DEFAULT + return PromptManageServiceDeletePromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceClonePromptResult) SetSuccess(x interface{}) { - p.Success = x.(*ClonePromptResponse) +func (p *PromptManageServiceDeletePromptResult) SetSuccess(x interface{}) { + p.Success = x.(*DeletePromptResponse) } -var fieldIDToName_PromptManageServiceClonePromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceDeletePromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceClonePromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceDeletePromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceClonePromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14764,7 +15787,7 @@ ReadStructBeginError: 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_PromptManageServiceClonePromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceDeletePromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14774,8 +15797,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceClonePromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewClonePromptResponse() +func (p *PromptManageServiceDeletePromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeletePromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14783,9 +15806,9 @@ func (p *PromptManageServiceClonePromptResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *PromptManageServiceClonePromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ClonePrompt_result"); err != nil { + if err = oprot.WriteStructBegin("DeletePrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14811,7 +15834,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceClonePromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceDeletePromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14830,15 +15853,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceClonePromptResult) String() string { +func (p *PromptManageServiceDeletePromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceClonePromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceDeletePromptResult(%+v)", *p) } -func (p *PromptManageServiceClonePromptResult) DeepEqual(ano *PromptManageServiceClonePromptResult) bool { +func (p *PromptManageServiceDeletePromptResult) DeepEqual(ano *PromptManageServiceDeletePromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14850,7 +15873,7 @@ func (p *PromptManageServiceClonePromptResult) DeepEqual(ano *PromptManageServic return true } -func (p *PromptManageServiceClonePromptResult) Field0DeepEqual(src *ClonePromptResponse) bool { +func (p *PromptManageServiceDeletePromptResult) Field0DeepEqual(src *DeletePromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -14858,41 +15881,41 @@ func (p *PromptManageServiceClonePromptResult) Field0DeepEqual(src *ClonePromptR return true } -type PromptManageServiceDeletePromptArgs struct { - Request *DeletePromptRequest `thrift:"request,1" frugal:"1,default,DeletePromptRequest"` +type PromptManageServiceGetPromptArgs struct { + Request *GetPromptRequest `thrift:"request,1" frugal:"1,default,GetPromptRequest"` } -func NewPromptManageServiceDeletePromptArgs() *PromptManageServiceDeletePromptArgs { - return &PromptManageServiceDeletePromptArgs{} +func NewPromptManageServiceGetPromptArgs() *PromptManageServiceGetPromptArgs { + return &PromptManageServiceGetPromptArgs{} } -func (p *PromptManageServiceDeletePromptArgs) InitDefault() { +func (p *PromptManageServiceGetPromptArgs) InitDefault() { } -var PromptManageServiceDeletePromptArgs_Request_DEFAULT *DeletePromptRequest +var PromptManageServiceGetPromptArgs_Request_DEFAULT *GetPromptRequest -func (p *PromptManageServiceDeletePromptArgs) GetRequest() (v *DeletePromptRequest) { +func (p *PromptManageServiceGetPromptArgs) GetRequest() (v *GetPromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceDeletePromptArgs_Request_DEFAULT + return PromptManageServiceGetPromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceDeletePromptArgs) SetRequest(val *DeletePromptRequest) { +func (p *PromptManageServiceGetPromptArgs) SetRequest(val *GetPromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceDeletePromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceGetPromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceDeletePromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceGetPromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceDeletePromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14937,7 +15960,7 @@ ReadStructBeginError: 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_PromptManageServiceDeletePromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceGetPromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14947,8 +15970,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceDeletePromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDeletePromptRequest() +func (p *PromptManageServiceGetPromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetPromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14956,9 +15979,9 @@ func (p *PromptManageServiceDeletePromptArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *PromptManageServiceDeletePromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeletePrompt_args"); err != nil { + if err = oprot.WriteStructBegin("GetPrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14984,7 +16007,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceDeletePromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15001,15 +16024,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceDeletePromptArgs) String() string { +func (p *PromptManageServiceGetPromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceDeletePromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceGetPromptArgs(%+v)", *p) } -func (p *PromptManageServiceDeletePromptArgs) DeepEqual(ano *PromptManageServiceDeletePromptArgs) bool { +func (p *PromptManageServiceGetPromptArgs) DeepEqual(ano *PromptManageServiceGetPromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15021,7 +16044,7 @@ func (p *PromptManageServiceDeletePromptArgs) DeepEqual(ano *PromptManageService return true } -func (p *PromptManageServiceDeletePromptArgs) Field1DeepEqual(src *DeletePromptRequest) bool { +func (p *PromptManageServiceGetPromptArgs) Field1DeepEqual(src *GetPromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -15029,41 +16052,41 @@ func (p *PromptManageServiceDeletePromptArgs) Field1DeepEqual(src *DeletePromptR return true } -type PromptManageServiceDeletePromptResult struct { - Success *DeletePromptResponse `thrift:"success,0,optional" frugal:"0,optional,DeletePromptResponse"` +type PromptManageServiceGetPromptResult struct { + Success *GetPromptResponse `thrift:"success,0,optional" frugal:"0,optional,GetPromptResponse"` } -func NewPromptManageServiceDeletePromptResult() *PromptManageServiceDeletePromptResult { - return &PromptManageServiceDeletePromptResult{} +func NewPromptManageServiceGetPromptResult() *PromptManageServiceGetPromptResult { + return &PromptManageServiceGetPromptResult{} } -func (p *PromptManageServiceDeletePromptResult) InitDefault() { +func (p *PromptManageServiceGetPromptResult) InitDefault() { } -var PromptManageServiceDeletePromptResult_Success_DEFAULT *DeletePromptResponse +var PromptManageServiceGetPromptResult_Success_DEFAULT *GetPromptResponse -func (p *PromptManageServiceDeletePromptResult) GetSuccess() (v *DeletePromptResponse) { +func (p *PromptManageServiceGetPromptResult) GetSuccess() (v *GetPromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceDeletePromptResult_Success_DEFAULT + return PromptManageServiceGetPromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceDeletePromptResult) SetSuccess(x interface{}) { - p.Success = x.(*DeletePromptResponse) +func (p *PromptManageServiceGetPromptResult) SetSuccess(x interface{}) { + p.Success = x.(*GetPromptResponse) } -var fieldIDToName_PromptManageServiceDeletePromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceGetPromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceDeletePromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceGetPromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceDeletePromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15108,7 +16131,7 @@ ReadStructBeginError: 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_PromptManageServiceDeletePromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceGetPromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15118,8 +16141,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceDeletePromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDeletePromptResponse() +func (p *PromptManageServiceGetPromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetPromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15127,9 +16150,9 @@ func (p *PromptManageServiceDeletePromptResult) ReadField0(iprot thrift.TProtoco return nil } -func (p *PromptManageServiceDeletePromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeletePrompt_result"); err != nil { + if err = oprot.WriteStructBegin("GetPrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15155,7 +16178,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceDeletePromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceGetPromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15174,15 +16197,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceDeletePromptResult) String() string { +func (p *PromptManageServiceGetPromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceDeletePromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceGetPromptResult(%+v)", *p) } -func (p *PromptManageServiceDeletePromptResult) DeepEqual(ano *PromptManageServiceDeletePromptResult) bool { +func (p *PromptManageServiceGetPromptResult) DeepEqual(ano *PromptManageServiceGetPromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15194,7 +16217,7 @@ func (p *PromptManageServiceDeletePromptResult) DeepEqual(ano *PromptManageServi return true } -func (p *PromptManageServiceDeletePromptResult) Field0DeepEqual(src *DeletePromptResponse) bool { +func (p *PromptManageServiceGetPromptResult) Field0DeepEqual(src *GetPromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15202,41 +16225,41 @@ func (p *PromptManageServiceDeletePromptResult) Field0DeepEqual(src *DeletePromp return true } -type PromptManageServiceGetPromptArgs struct { - Request *GetPromptRequest `thrift:"request,1" frugal:"1,default,GetPromptRequest"` +type PromptManageServiceBatchGetPromptArgs struct { + Request *BatchGetPromptRequest `thrift:"request,1" frugal:"1,default,BatchGetPromptRequest"` } -func NewPromptManageServiceGetPromptArgs() *PromptManageServiceGetPromptArgs { - return &PromptManageServiceGetPromptArgs{} +func NewPromptManageServiceBatchGetPromptArgs() *PromptManageServiceBatchGetPromptArgs { + return &PromptManageServiceBatchGetPromptArgs{} } -func (p *PromptManageServiceGetPromptArgs) InitDefault() { +func (p *PromptManageServiceBatchGetPromptArgs) InitDefault() { } -var PromptManageServiceGetPromptArgs_Request_DEFAULT *GetPromptRequest +var PromptManageServiceBatchGetPromptArgs_Request_DEFAULT *BatchGetPromptRequest -func (p *PromptManageServiceGetPromptArgs) GetRequest() (v *GetPromptRequest) { +func (p *PromptManageServiceBatchGetPromptArgs) GetRequest() (v *BatchGetPromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceGetPromptArgs_Request_DEFAULT + return PromptManageServiceBatchGetPromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceGetPromptArgs) SetRequest(val *GetPromptRequest) { +func (p *PromptManageServiceBatchGetPromptArgs) SetRequest(val *BatchGetPromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceGetPromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceBatchGetPromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceGetPromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceBatchGetPromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceGetPromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15281,7 +16304,7 @@ ReadStructBeginError: 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_PromptManageServiceGetPromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15291,8 +16314,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceGetPromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetPromptRequest() +func (p *PromptManageServiceBatchGetPromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetPromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15300,9 +16323,9 @@ func (p *PromptManageServiceGetPromptArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *PromptManageServiceGetPromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetPrompt_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetPrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15328,7 +16351,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceGetPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15345,15 +16368,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceGetPromptArgs) String() string { +func (p *PromptManageServiceBatchGetPromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceGetPromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceBatchGetPromptArgs(%+v)", *p) } -func (p *PromptManageServiceGetPromptArgs) DeepEqual(ano *PromptManageServiceGetPromptArgs) bool { +func (p *PromptManageServiceBatchGetPromptArgs) DeepEqual(ano *PromptManageServiceBatchGetPromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15365,7 +16388,7 @@ func (p *PromptManageServiceGetPromptArgs) DeepEqual(ano *PromptManageServiceGet return true } -func (p *PromptManageServiceGetPromptArgs) Field1DeepEqual(src *GetPromptRequest) bool { +func (p *PromptManageServiceBatchGetPromptArgs) Field1DeepEqual(src *BatchGetPromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -15373,41 +16396,41 @@ func (p *PromptManageServiceGetPromptArgs) Field1DeepEqual(src *GetPromptRequest return true } -type PromptManageServiceGetPromptResult struct { - Success *GetPromptResponse `thrift:"success,0,optional" frugal:"0,optional,GetPromptResponse"` +type PromptManageServiceBatchGetPromptResult struct { + Success *BatchGetPromptResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetPromptResponse"` } -func NewPromptManageServiceGetPromptResult() *PromptManageServiceGetPromptResult { - return &PromptManageServiceGetPromptResult{} +func NewPromptManageServiceBatchGetPromptResult() *PromptManageServiceBatchGetPromptResult { + return &PromptManageServiceBatchGetPromptResult{} } -func (p *PromptManageServiceGetPromptResult) InitDefault() { +func (p *PromptManageServiceBatchGetPromptResult) InitDefault() { } -var PromptManageServiceGetPromptResult_Success_DEFAULT *GetPromptResponse +var PromptManageServiceBatchGetPromptResult_Success_DEFAULT *BatchGetPromptResponse -func (p *PromptManageServiceGetPromptResult) GetSuccess() (v *GetPromptResponse) { +func (p *PromptManageServiceBatchGetPromptResult) GetSuccess() (v *BatchGetPromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceGetPromptResult_Success_DEFAULT + return PromptManageServiceBatchGetPromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceGetPromptResult) SetSuccess(x interface{}) { - p.Success = x.(*GetPromptResponse) +func (p *PromptManageServiceBatchGetPromptResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetPromptResponse) } -var fieldIDToName_PromptManageServiceGetPromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceBatchGetPromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceGetPromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceBatchGetPromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceGetPromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15452,7 +16475,7 @@ ReadStructBeginError: 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_PromptManageServiceGetPromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15462,8 +16485,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceGetPromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetPromptResponse() +func (p *PromptManageServiceBatchGetPromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetPromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15471,9 +16494,9 @@ func (p *PromptManageServiceGetPromptResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *PromptManageServiceGetPromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetPrompt_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetPrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15499,7 +16522,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceGetPromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15518,15 +16541,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceGetPromptResult) String() string { +func (p *PromptManageServiceBatchGetPromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceGetPromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceBatchGetPromptResult(%+v)", *p) } -func (p *PromptManageServiceGetPromptResult) DeepEqual(ano *PromptManageServiceGetPromptResult) bool { +func (p *PromptManageServiceBatchGetPromptResult) DeepEqual(ano *PromptManageServiceBatchGetPromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15538,7 +16561,7 @@ func (p *PromptManageServiceGetPromptResult) DeepEqual(ano *PromptManageServiceG return true } -func (p *PromptManageServiceGetPromptResult) Field0DeepEqual(src *GetPromptResponse) bool { +func (p *PromptManageServiceBatchGetPromptResult) Field0DeepEqual(src *BatchGetPromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15546,41 +16569,41 @@ func (p *PromptManageServiceGetPromptResult) Field0DeepEqual(src *GetPromptRespo return true } -type PromptManageServiceBatchGetPromptArgs struct { - Request *BatchGetPromptRequest `thrift:"request,1" frugal:"1,default,BatchGetPromptRequest"` +type PromptManageServiceListPromptArgs struct { + Request *ListPromptRequest `thrift:"request,1" frugal:"1,default,ListPromptRequest"` } -func NewPromptManageServiceBatchGetPromptArgs() *PromptManageServiceBatchGetPromptArgs { - return &PromptManageServiceBatchGetPromptArgs{} +func NewPromptManageServiceListPromptArgs() *PromptManageServiceListPromptArgs { + return &PromptManageServiceListPromptArgs{} } -func (p *PromptManageServiceBatchGetPromptArgs) InitDefault() { +func (p *PromptManageServiceListPromptArgs) InitDefault() { } -var PromptManageServiceBatchGetPromptArgs_Request_DEFAULT *BatchGetPromptRequest +var PromptManageServiceListPromptArgs_Request_DEFAULT *ListPromptRequest -func (p *PromptManageServiceBatchGetPromptArgs) GetRequest() (v *BatchGetPromptRequest) { +func (p *PromptManageServiceListPromptArgs) GetRequest() (v *ListPromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceBatchGetPromptArgs_Request_DEFAULT + return PromptManageServiceListPromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceBatchGetPromptArgs) SetRequest(val *BatchGetPromptRequest) { +func (p *PromptManageServiceListPromptArgs) SetRequest(val *ListPromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceBatchGetPromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceListPromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceBatchGetPromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceListPromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceBatchGetPromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15625,7 +16648,7 @@ ReadStructBeginError: 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_PromptManageServiceBatchGetPromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceListPromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15635,8 +16658,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetPromptRequest() +func (p *PromptManageServiceListPromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListPromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15644,9 +16667,9 @@ func (p *PromptManageServiceBatchGetPromptArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *PromptManageServiceBatchGetPromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetPrompt_args"); err != nil { + if err = oprot.WriteStructBegin("ListPrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15672,7 +16695,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15689,15 +16712,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptArgs) String() string { +func (p *PromptManageServiceListPromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceBatchGetPromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceListPromptArgs(%+v)", *p) } -func (p *PromptManageServiceBatchGetPromptArgs) DeepEqual(ano *PromptManageServiceBatchGetPromptArgs) bool { +func (p *PromptManageServiceListPromptArgs) DeepEqual(ano *PromptManageServiceListPromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15709,7 +16732,7 @@ func (p *PromptManageServiceBatchGetPromptArgs) DeepEqual(ano *PromptManageServi return true } -func (p *PromptManageServiceBatchGetPromptArgs) Field1DeepEqual(src *BatchGetPromptRequest) bool { +func (p *PromptManageServiceListPromptArgs) Field1DeepEqual(src *ListPromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -15717,41 +16740,41 @@ func (p *PromptManageServiceBatchGetPromptArgs) Field1DeepEqual(src *BatchGetPro return true } -type PromptManageServiceBatchGetPromptResult struct { - Success *BatchGetPromptResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetPromptResponse"` +type PromptManageServiceListPromptResult struct { + Success *ListPromptResponse `thrift:"success,0,optional" frugal:"0,optional,ListPromptResponse"` } -func NewPromptManageServiceBatchGetPromptResult() *PromptManageServiceBatchGetPromptResult { - return &PromptManageServiceBatchGetPromptResult{} +func NewPromptManageServiceListPromptResult() *PromptManageServiceListPromptResult { + return &PromptManageServiceListPromptResult{} } -func (p *PromptManageServiceBatchGetPromptResult) InitDefault() { +func (p *PromptManageServiceListPromptResult) InitDefault() { } -var PromptManageServiceBatchGetPromptResult_Success_DEFAULT *BatchGetPromptResponse +var PromptManageServiceListPromptResult_Success_DEFAULT *ListPromptResponse -func (p *PromptManageServiceBatchGetPromptResult) GetSuccess() (v *BatchGetPromptResponse) { +func (p *PromptManageServiceListPromptResult) GetSuccess() (v *ListPromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceBatchGetPromptResult_Success_DEFAULT + return PromptManageServiceListPromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceBatchGetPromptResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetPromptResponse) +func (p *PromptManageServiceListPromptResult) SetSuccess(x interface{}) { + p.Success = x.(*ListPromptResponse) } -var fieldIDToName_PromptManageServiceBatchGetPromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceListPromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceBatchGetPromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceListPromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceBatchGetPromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15796,7 +16819,7 @@ ReadStructBeginError: 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_PromptManageServiceBatchGetPromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceListPromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15806,8 +16829,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetPromptResponse() +func (p *PromptManageServiceListPromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListPromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15815,9 +16838,9 @@ func (p *PromptManageServiceBatchGetPromptResult) ReadField0(iprot thrift.TProto return nil } -func (p *PromptManageServiceBatchGetPromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetPrompt_result"); err != nil { + if err = oprot.WriteStructBegin("ListPrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15843,7 +16866,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListPromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15862,15 +16885,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceBatchGetPromptResult) String() string { +func (p *PromptManageServiceListPromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceBatchGetPromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceListPromptResult(%+v)", *p) } -func (p *PromptManageServiceBatchGetPromptResult) DeepEqual(ano *PromptManageServiceBatchGetPromptResult) bool { +func (p *PromptManageServiceListPromptResult) DeepEqual(ano *PromptManageServiceListPromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15882,7 +16905,7 @@ func (p *PromptManageServiceBatchGetPromptResult) DeepEqual(ano *PromptManageSer return true } -func (p *PromptManageServiceBatchGetPromptResult) Field0DeepEqual(src *BatchGetPromptResponse) bool { +func (p *PromptManageServiceListPromptResult) Field0DeepEqual(src *ListPromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15890,41 +16913,41 @@ func (p *PromptManageServiceBatchGetPromptResult) Field0DeepEqual(src *BatchGetP return true } -type PromptManageServiceListPromptArgs struct { - Request *ListPromptRequest `thrift:"request,1" frugal:"1,default,ListPromptRequest"` +type PromptManageServiceListParentPromptArgs struct { + Request *ListParentPromptRequest `thrift:"request,1" frugal:"1,default,ListParentPromptRequest"` } -func NewPromptManageServiceListPromptArgs() *PromptManageServiceListPromptArgs { - return &PromptManageServiceListPromptArgs{} +func NewPromptManageServiceListParentPromptArgs() *PromptManageServiceListParentPromptArgs { + return &PromptManageServiceListParentPromptArgs{} } -func (p *PromptManageServiceListPromptArgs) InitDefault() { +func (p *PromptManageServiceListParentPromptArgs) InitDefault() { } -var PromptManageServiceListPromptArgs_Request_DEFAULT *ListPromptRequest +var PromptManageServiceListParentPromptArgs_Request_DEFAULT *ListParentPromptRequest -func (p *PromptManageServiceListPromptArgs) GetRequest() (v *ListPromptRequest) { +func (p *PromptManageServiceListParentPromptArgs) GetRequest() (v *ListParentPromptRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceListPromptArgs_Request_DEFAULT + return PromptManageServiceListParentPromptArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceListPromptArgs) SetRequest(val *ListPromptRequest) { +func (p *PromptManageServiceListParentPromptArgs) SetRequest(val *ListParentPromptRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceListPromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceListParentPromptArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceListPromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceListParentPromptArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceListPromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15969,7 +16992,7 @@ ReadStructBeginError: 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_PromptManageServiceListPromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceListParentPromptArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15979,8 +17002,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceListPromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListPromptRequest() +func (p *PromptManageServiceListParentPromptArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListParentPromptRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15988,9 +17011,9 @@ func (p *PromptManageServiceListPromptArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *PromptManageServiceListPromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListPrompt_args"); err != nil { + if err = oprot.WriteStructBegin("ListParentPrompt_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16016,7 +17039,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceListPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16033,15 +17056,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceListPromptArgs) String() string { +func (p *PromptManageServiceListParentPromptArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceListPromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceListParentPromptArgs(%+v)", *p) } -func (p *PromptManageServiceListPromptArgs) DeepEqual(ano *PromptManageServiceListPromptArgs) bool { +func (p *PromptManageServiceListParentPromptArgs) DeepEqual(ano *PromptManageServiceListParentPromptArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16053,7 +17076,7 @@ func (p *PromptManageServiceListPromptArgs) DeepEqual(ano *PromptManageServiceLi return true } -func (p *PromptManageServiceListPromptArgs) Field1DeepEqual(src *ListPromptRequest) bool { +func (p *PromptManageServiceListParentPromptArgs) Field1DeepEqual(src *ListParentPromptRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -16061,41 +17084,41 @@ func (p *PromptManageServiceListPromptArgs) Field1DeepEqual(src *ListPromptReque return true } -type PromptManageServiceListPromptResult struct { - Success *ListPromptResponse `thrift:"success,0,optional" frugal:"0,optional,ListPromptResponse"` +type PromptManageServiceListParentPromptResult struct { + Success *ListParentPromptResponse `thrift:"success,0,optional" frugal:"0,optional,ListParentPromptResponse"` } -func NewPromptManageServiceListPromptResult() *PromptManageServiceListPromptResult { - return &PromptManageServiceListPromptResult{} +func NewPromptManageServiceListParentPromptResult() *PromptManageServiceListParentPromptResult { + return &PromptManageServiceListParentPromptResult{} } -func (p *PromptManageServiceListPromptResult) InitDefault() { +func (p *PromptManageServiceListParentPromptResult) InitDefault() { } -var PromptManageServiceListPromptResult_Success_DEFAULT *ListPromptResponse +var PromptManageServiceListParentPromptResult_Success_DEFAULT *ListParentPromptResponse -func (p *PromptManageServiceListPromptResult) GetSuccess() (v *ListPromptResponse) { +func (p *PromptManageServiceListParentPromptResult) GetSuccess() (v *ListParentPromptResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceListPromptResult_Success_DEFAULT + return PromptManageServiceListParentPromptResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceListPromptResult) SetSuccess(x interface{}) { - p.Success = x.(*ListPromptResponse) +func (p *PromptManageServiceListParentPromptResult) SetSuccess(x interface{}) { + p.Success = x.(*ListParentPromptResponse) } -var fieldIDToName_PromptManageServiceListPromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceListParentPromptResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceListPromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceListParentPromptResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceListPromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16140,7 +17163,7 @@ ReadStructBeginError: 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_PromptManageServiceListPromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceListParentPromptResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16150,8 +17173,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceListPromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListPromptResponse() +func (p *PromptManageServiceListParentPromptResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListParentPromptResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16159,9 +17182,9 @@ func (p *PromptManageServiceListPromptResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *PromptManageServiceListPromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListPrompt_result"); err != nil { + if err = oprot.WriteStructBegin("ListParentPrompt_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16187,7 +17210,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceListPromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceListParentPromptResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16206,15 +17229,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceListPromptResult) String() string { +func (p *PromptManageServiceListParentPromptResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceListPromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceListParentPromptResult(%+v)", *p) } -func (p *PromptManageServiceListPromptResult) DeepEqual(ano *PromptManageServiceListPromptResult) bool { +func (p *PromptManageServiceListParentPromptResult) DeepEqual(ano *PromptManageServiceListParentPromptResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16226,7 +17249,7 @@ func (p *PromptManageServiceListPromptResult) DeepEqual(ano *PromptManageService return true } -func (p *PromptManageServiceListPromptResult) Field0DeepEqual(src *ListPromptResponse) bool { +func (p *PromptManageServiceListParentPromptResult) Field0DeepEqual(src *ListParentPromptResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -16234,41 +17257,41 @@ func (p *PromptManageServiceListPromptResult) Field0DeepEqual(src *ListPromptRes return true } -type PromptManageServiceListParentPromptArgs struct { - Request *ListParentPromptRequest `thrift:"request,1" frugal:"1,default,ListParentPromptRequest"` +type PromptManageServiceBatchGetPromptBasicArgs struct { + Request *BatchGetPromptBasicRequest `thrift:"request,1" frugal:"1,default,BatchGetPromptBasicRequest"` } -func NewPromptManageServiceListParentPromptArgs() *PromptManageServiceListParentPromptArgs { - return &PromptManageServiceListParentPromptArgs{} +func NewPromptManageServiceBatchGetPromptBasicArgs() *PromptManageServiceBatchGetPromptBasicArgs { + return &PromptManageServiceBatchGetPromptBasicArgs{} } -func (p *PromptManageServiceListParentPromptArgs) InitDefault() { +func (p *PromptManageServiceBatchGetPromptBasicArgs) InitDefault() { } -var PromptManageServiceListParentPromptArgs_Request_DEFAULT *ListParentPromptRequest +var PromptManageServiceBatchGetPromptBasicArgs_Request_DEFAULT *BatchGetPromptBasicRequest -func (p *PromptManageServiceListParentPromptArgs) GetRequest() (v *ListParentPromptRequest) { +func (p *PromptManageServiceBatchGetPromptBasicArgs) GetRequest() (v *BatchGetPromptBasicRequest) { if p == nil { return } if !p.IsSetRequest() { - return PromptManageServiceListParentPromptArgs_Request_DEFAULT + return PromptManageServiceBatchGetPromptBasicArgs_Request_DEFAULT } return p.Request } -func (p *PromptManageServiceListParentPromptArgs) SetRequest(val *ListParentPromptRequest) { +func (p *PromptManageServiceBatchGetPromptBasicArgs) SetRequest(val *BatchGetPromptBasicRequest) { p.Request = val } -var fieldIDToName_PromptManageServiceListParentPromptArgs = map[int16]string{ +var fieldIDToName_PromptManageServiceBatchGetPromptBasicArgs = map[int16]string{ 1: "request", } -func (p *PromptManageServiceListParentPromptArgs) IsSetRequest() bool { +func (p *PromptManageServiceBatchGetPromptBasicArgs) IsSetRequest() bool { return p.Request != nil } -func (p *PromptManageServiceListParentPromptArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16313,7 +17336,7 @@ ReadStructBeginError: 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_PromptManageServiceListParentPromptArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptBasicArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16323,8 +17346,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceListParentPromptArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListParentPromptRequest() +func (p *PromptManageServiceBatchGetPromptBasicArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetPromptBasicRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16332,9 +17355,9 @@ func (p *PromptManageServiceListParentPromptArgs) ReadField1(iprot thrift.TProto return nil } -func (p *PromptManageServiceListParentPromptArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListParentPrompt_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetPromptBasic_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16360,7 +17383,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceListParentPromptArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16377,15 +17400,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PromptManageServiceListParentPromptArgs) String() string { +func (p *PromptManageServiceBatchGetPromptBasicArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceListParentPromptArgs(%+v)", *p) + return fmt.Sprintf("PromptManageServiceBatchGetPromptBasicArgs(%+v)", *p) } -func (p *PromptManageServiceListParentPromptArgs) DeepEqual(ano *PromptManageServiceListParentPromptArgs) bool { +func (p *PromptManageServiceBatchGetPromptBasicArgs) DeepEqual(ano *PromptManageServiceBatchGetPromptBasicArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16397,7 +17420,7 @@ func (p *PromptManageServiceListParentPromptArgs) DeepEqual(ano *PromptManageSer return true } -func (p *PromptManageServiceListParentPromptArgs) Field1DeepEqual(src *ListParentPromptRequest) bool { +func (p *PromptManageServiceBatchGetPromptBasicArgs) Field1DeepEqual(src *BatchGetPromptBasicRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -16405,41 +17428,41 @@ func (p *PromptManageServiceListParentPromptArgs) Field1DeepEqual(src *ListParen return true } -type PromptManageServiceListParentPromptResult struct { - Success *ListParentPromptResponse `thrift:"success,0,optional" frugal:"0,optional,ListParentPromptResponse"` +type PromptManageServiceBatchGetPromptBasicResult struct { + Success *BatchGetPromptBasicResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetPromptBasicResponse"` } -func NewPromptManageServiceListParentPromptResult() *PromptManageServiceListParentPromptResult { - return &PromptManageServiceListParentPromptResult{} +func NewPromptManageServiceBatchGetPromptBasicResult() *PromptManageServiceBatchGetPromptBasicResult { + return &PromptManageServiceBatchGetPromptBasicResult{} } -func (p *PromptManageServiceListParentPromptResult) InitDefault() { +func (p *PromptManageServiceBatchGetPromptBasicResult) InitDefault() { } -var PromptManageServiceListParentPromptResult_Success_DEFAULT *ListParentPromptResponse +var PromptManageServiceBatchGetPromptBasicResult_Success_DEFAULT *BatchGetPromptBasicResponse -func (p *PromptManageServiceListParentPromptResult) GetSuccess() (v *ListParentPromptResponse) { +func (p *PromptManageServiceBatchGetPromptBasicResult) GetSuccess() (v *BatchGetPromptBasicResponse) { if p == nil { return } if !p.IsSetSuccess() { - return PromptManageServiceListParentPromptResult_Success_DEFAULT + return PromptManageServiceBatchGetPromptBasicResult_Success_DEFAULT } return p.Success } -func (p *PromptManageServiceListParentPromptResult) SetSuccess(x interface{}) { - p.Success = x.(*ListParentPromptResponse) +func (p *PromptManageServiceBatchGetPromptBasicResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetPromptBasicResponse) } -var fieldIDToName_PromptManageServiceListParentPromptResult = map[int16]string{ +var fieldIDToName_PromptManageServiceBatchGetPromptBasicResult = map[int16]string{ 0: "success", } -func (p *PromptManageServiceListParentPromptResult) IsSetSuccess() bool { +func (p *PromptManageServiceBatchGetPromptBasicResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PromptManageServiceListParentPromptResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16484,7 +17507,7 @@ ReadStructBeginError: 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_PromptManageServiceListParentPromptResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptBasicResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16494,8 +17517,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PromptManageServiceListParentPromptResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListParentPromptResponse() +func (p *PromptManageServiceBatchGetPromptBasicResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetPromptBasicResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16503,9 +17526,9 @@ func (p *PromptManageServiceListParentPromptResult) ReadField0(iprot thrift.TPro return nil } -func (p *PromptManageServiceListParentPromptResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListParentPrompt_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetPromptBasic_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16531,7 +17554,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PromptManageServiceListParentPromptResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PromptManageServiceBatchGetPromptBasicResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16550,15 +17573,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PromptManageServiceListParentPromptResult) String() string { +func (p *PromptManageServiceBatchGetPromptBasicResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PromptManageServiceListParentPromptResult(%+v)", *p) + return fmt.Sprintf("PromptManageServiceBatchGetPromptBasicResult(%+v)", *p) } -func (p *PromptManageServiceListParentPromptResult) DeepEqual(ano *PromptManageServiceListParentPromptResult) bool { +func (p *PromptManageServiceBatchGetPromptBasicResult) DeepEqual(ano *PromptManageServiceBatchGetPromptBasicResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16570,7 +17593,7 @@ func (p *PromptManageServiceListParentPromptResult) DeepEqual(ano *PromptManageS return true } -func (p *PromptManageServiceListParentPromptResult) Field0DeepEqual(src *ListParentPromptResponse) bool { +func (p *PromptManageServiceBatchGetPromptBasicResult) Field0DeepEqual(src *BatchGetPromptBasicResponse) bool { if !p.Success.DeepEqual(src) { return false diff --git a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage_validator.go b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage_validator.go index be8d6c11b..fb7b91a86 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage_validator.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage_validator.go @@ -511,3 +511,25 @@ func (p *ListParentPromptResponse) IsValid() error { } return nil } +func (p *BatchGetPromptBasicRequest) IsValid() error { + if p.WorkspaceID == nil { + return fmt.Errorf("field WorkspaceID not_nil rule failed") + } + if *p.WorkspaceID <= int64(0) { + return fmt.Errorf("field WorkspaceID gt rule failed, current value: %v", *p.WorkspaceID) + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *BatchGetPromptBasicResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} diff --git a/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go b/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go index b66c724f8..87d0af839 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go @@ -9520,6 +9520,458 @@ func (p *ListParentPromptResponse) DeepCopy(s interface{}) error { return nil } +func (p *BatchGetPromptBasicRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BatchGetPromptBasicRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *BatchGetPromptBasicRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *BatchGetPromptBasicRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]int64, 0, size) + for i := 0; i < size; i++ { + var _elem int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.PromptIds = _field + return offset, nil +} + +func (p *BatchGetPromptBasicRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *BatchGetPromptBasicRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *BatchGetPromptBasicRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *BatchGetPromptBasicRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *BatchGetPromptBasicRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *BatchGetPromptBasicRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPromptIds() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.PromptIds { + length++ + offset += thrift.Binary.WriteI64(buf[offset:], v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) + } + return offset +} + +func (p *BatchGetPromptBasicRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *BatchGetPromptBasicRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *BatchGetPromptBasicRequest) field2Length() int { + l := 0 + if p.IsSetPromptIds() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + l += + thrift.Binary.I64Length() * len(p.PromptIds) + } + return l +} + +func (p *BatchGetPromptBasicRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *BatchGetPromptBasicRequest) DeepCopy(s interface{}) error { + src, ok := s.(*BatchGetPromptBasicRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.PromptIds != nil { + p.PromptIds = make([]int64, 0, len(src.PromptIds)) + for _, elem := range src.PromptIds { + var _elem int64 + _elem = elem + p.PromptIds = append(p.PromptIds, _elem) + } + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *BatchGetPromptBasicResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BatchGetPromptBasicResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *BatchGetPromptBasicResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*prompt.Prompt, 0, size) + values := make([]prompt.Prompt, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.Prompts = _field + return offset, nil +} + +func (p *BatchGetPromptBasicResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *BatchGetPromptBasicResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *BatchGetPromptBasicResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *BatchGetPromptBasicResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *BatchGetPromptBasicResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPrompts() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 1) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Prompts { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *BatchGetPromptBasicResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBaseResp() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *BatchGetPromptBasicResponse) field1Length() int { + l := 0 + if p.IsSetPrompts() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Prompts { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *BatchGetPromptBasicResponse) field255Length() int { + l := 0 + if p.IsSetBaseResp() { + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + } + return l +} + +func (p *BatchGetPromptBasicResponse) DeepCopy(s interface{}) error { + src, ok := s.(*BatchGetPromptBasicResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.Prompts != nil { + p.Prompts = make([]*prompt.Prompt, 0, len(src.Prompts)) + for _, elem := range src.Prompts { + var _elem *prompt.Prompt + if elem != nil { + _elem = &prompt.Prompt{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.Prompts = append(p.Prompts, _elem) + } + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + func (p *PromptManageServiceCreatePromptArgs) FastRead(buf []byte) (int, error) { var err error @@ -11158,6 +11610,240 @@ func (p *PromptManageServiceListParentPromptResult) DeepCopy(s interface{}) erro return nil } +func (p *PromptManageServiceBatchGetPromptBasicArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptBasicArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetPromptBasicRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *PromptManageServiceBatchGetPromptBasicArgs) DeepCopy(s interface{}) error { + src, ok := s.(*PromptManageServiceBatchGetPromptBasicArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *BatchGetPromptBasicRequest + if src.Request != nil { + _request = &BatchGetPromptBasicRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PromptManageServiceBatchGetPromptBasicResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetPromptBasicResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) DeepCopy(s interface{}) error { + src, ok := s.(*PromptManageServiceBatchGetPromptBasicResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *BatchGetPromptBasicResponse + if src.Success != nil { + _success = &BatchGetPromptBasicResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + func (p *PromptManageServiceUpdatePromptArgs) FastRead(buf []byte) (int, error) { var err error @@ -13320,6 +14006,14 @@ func (p *PromptManageServiceListParentPromptResult) GetResult() interface{} { return p.Success } +func (p *PromptManageServiceBatchGetPromptBasicArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *PromptManageServiceBatchGetPromptBasicResult) GetResult() interface{} { + return p.Success +} + func (p *PromptManageServiceUpdatePromptArgs) GetFirstArgument() interface{} { return p.Request } diff --git a/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/client.go b/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/client.go index 3e7b1c158..aaec1bad2 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/client.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/client.go @@ -18,6 +18,7 @@ type Client interface { BatchGetPrompt(ctx context.Context, request *manage.BatchGetPromptRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptResponse, err error) ListPrompt(ctx context.Context, request *manage.ListPromptRequest, callOptions ...callopt.Option) (r *manage.ListPromptResponse, err error) ListParentPrompt(ctx context.Context, request *manage.ListParentPromptRequest, callOptions ...callopt.Option) (r *manage.ListParentPromptResponse, err error) + BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) SaveDraft(ctx context.Context, request *manage.SaveDraftRequest, callOptions ...callopt.Option) (r *manage.SaveDraftResponse, err error) CreateLabel(ctx context.Context, request *manage.CreateLabelRequest, callOptions ...callopt.Option) (r *manage.CreateLabelResponse, err error) @@ -93,6 +94,11 @@ func (p *kPromptManageServiceClient) ListParentPrompt(ctx context.Context, reque return p.kClient.ListParentPrompt(ctx, request) } +func (p *kPromptManageServiceClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.BatchGetPromptBasic(ctx, request) +} + func (p *kPromptManageServiceClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.UpdatePrompt(ctx, request) diff --git a/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/promptmanageservice.go b/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/promptmanageservice.go index d8900b7be..3ef8b1cd6 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/promptmanageservice.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/promptmanageservice/promptmanageservice.go @@ -62,6 +62,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "BatchGetPromptBasic": kitex.NewMethodInfo( + batchGetPromptBasicHandler, + newPromptManageServiceBatchGetPromptBasicArgs, + newPromptManageServiceBatchGetPromptBasicResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "UpdatePrompt": kitex.NewMethodInfo( updatePromptHandler, newPromptManageServiceUpdatePromptArgs, @@ -291,6 +298,25 @@ func newPromptManageServiceListParentPromptResult() interface{} { return manage.NewPromptManageServiceListParentPromptResult() } +func batchGetPromptBasicHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*manage.PromptManageServiceBatchGetPromptBasicArgs) + realResult := result.(*manage.PromptManageServiceBatchGetPromptBasicResult) + success, err := handler.(manage.PromptManageService).BatchGetPromptBasic(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newPromptManageServiceBatchGetPromptBasicArgs() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicArgs() +} + +func newPromptManageServiceBatchGetPromptBasicResult() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicResult() +} + func updatePromptHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*manage.PromptManageServiceUpdatePromptArgs) realResult := result.(*manage.PromptManageServiceUpdatePromptResult) @@ -544,6 +570,16 @@ func (p *kClient) ListParentPrompt(ctx context.Context, request *manage.ListPare return _result.GetSuccess(), nil } +func (p *kClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest) (r *manage.BatchGetPromptBasicResponse, err error) { + var _args manage.PromptManageServiceBatchGetPromptBasicArgs + _args.Request = request + var _result manage.PromptManageServiceBatchGetPromptBasicResult + if err = p.c.Call(ctx, "BatchGetPromptBasic", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest) (r *manage.UpdatePromptResponse, err error) { var _args manage.PromptManageServiceUpdatePromptArgs _args.Request = request diff --git a/backend/kitex_gen/coze/loop/prompt/promptmanageservice/client.go b/backend/kitex_gen/coze/loop/prompt/promptmanageservice/client.go index 3e7b1c158..aaec1bad2 100644 --- a/backend/kitex_gen/coze/loop/prompt/promptmanageservice/client.go +++ b/backend/kitex_gen/coze/loop/prompt/promptmanageservice/client.go @@ -18,6 +18,7 @@ type Client interface { BatchGetPrompt(ctx context.Context, request *manage.BatchGetPromptRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptResponse, err error) ListPrompt(ctx context.Context, request *manage.ListPromptRequest, callOptions ...callopt.Option) (r *manage.ListPromptResponse, err error) ListParentPrompt(ctx context.Context, request *manage.ListParentPromptRequest, callOptions ...callopt.Option) (r *manage.ListParentPromptResponse, err error) + BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) SaveDraft(ctx context.Context, request *manage.SaveDraftRequest, callOptions ...callopt.Option) (r *manage.SaveDraftResponse, err error) CreateLabel(ctx context.Context, request *manage.CreateLabelRequest, callOptions ...callopt.Option) (r *manage.CreateLabelResponse, err error) @@ -93,6 +94,11 @@ func (p *kPromptManageServiceClient) ListParentPrompt(ctx context.Context, reque return p.kClient.ListParentPrompt(ctx, request) } +func (p *kPromptManageServiceClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (r *manage.BatchGetPromptBasicResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.BatchGetPromptBasic(ctx, request) +} + func (p *kPromptManageServiceClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (r *manage.UpdatePromptResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.UpdatePrompt(ctx, request) diff --git a/backend/kitex_gen/coze/loop/prompt/promptmanageservice/promptmanageservice.go b/backend/kitex_gen/coze/loop/prompt/promptmanageservice/promptmanageservice.go index f2c8b070e..d003d7ae1 100644 --- a/backend/kitex_gen/coze/loop/prompt/promptmanageservice/promptmanageservice.go +++ b/backend/kitex_gen/coze/loop/prompt/promptmanageservice/promptmanageservice.go @@ -63,6 +63,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "BatchGetPromptBasic": kitex.NewMethodInfo( + batchGetPromptBasicHandler, + newPromptManageServiceBatchGetPromptBasicArgs, + newPromptManageServiceBatchGetPromptBasicResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "UpdatePrompt": kitex.NewMethodInfo( updatePromptHandler, newPromptManageServiceUpdatePromptArgs, @@ -292,6 +299,25 @@ func newPromptManageServiceListParentPromptResult() interface{} { return manage.NewPromptManageServiceListParentPromptResult() } +func batchGetPromptBasicHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*manage.PromptManageServiceBatchGetPromptBasicArgs) + realResult := result.(*manage.PromptManageServiceBatchGetPromptBasicResult) + success, err := handler.(manage.PromptManageService).BatchGetPromptBasic(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newPromptManageServiceBatchGetPromptBasicArgs() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicArgs() +} + +func newPromptManageServiceBatchGetPromptBasicResult() interface{} { + return manage.NewPromptManageServiceBatchGetPromptBasicResult() +} + func updatePromptHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*manage.PromptManageServiceUpdatePromptArgs) realResult := result.(*manage.PromptManageServiceUpdatePromptResult) @@ -545,6 +571,16 @@ func (p *kClient) ListParentPrompt(ctx context.Context, request *manage.ListPare return _result.GetSuccess(), nil } +func (p *kClient) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest) (r *manage.BatchGetPromptBasicResponse, err error) { + var _args manage.PromptManageServiceBatchGetPromptBasicArgs + _args.Request = request + var _result manage.PromptManageServiceBatchGetPromptBasicResult + if err = p.c.Call(ctx, "BatchGetPromptBasic", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest) (r *manage.UpdatePromptResponse, err error) { var _args manage.PromptManageServiceUpdatePromptArgs _args.Request = request diff --git a/backend/loop_gen/coze/loop/prompt/lomanage/local_promptmanageservice.go b/backend/loop_gen/coze/loop/prompt/lomanage/local_promptmanageservice.go index 74d233021..aabc63c89 100644 --- a/backend/loop_gen/coze/loop/prompt/lomanage/local_promptmanageservice.go +++ b/backend/loop_gen/coze/loop/prompt/lomanage/local_promptmanageservice.go @@ -178,6 +178,27 @@ func (l *LocalPromptManageService) ListParentPrompt(ctx context.Context, request return result.GetSuccess(), nil } +func (l *LocalPromptManageService) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest, callOptions ...callopt.Option) (*manage.BatchGetPromptBasicResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*manage.PromptManageServiceBatchGetPromptBasicArgs) + result := out.(*manage.PromptManageServiceBatchGetPromptBasicResult) + resp, err := l.impl.BatchGetPromptBasic(ctx, arg.Request) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &manage.PromptManageServiceBatchGetPromptBasicArgs{Request: request} + result := &manage.PromptManageServiceBatchGetPromptBasicResult{} + ctx = l.injectRPCInfo(ctx, "BatchGetPromptBasic") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + // UpdatePrompt // 改 func (l *LocalPromptManageService) UpdatePrompt(ctx context.Context, request *manage.UpdatePromptRequest, callOptions ...callopt.Option) (*manage.UpdatePromptResponse, error) { diff --git a/backend/modules/prompt/application/manage.go b/backend/modules/prompt/application/manage.go index 858c25216..981bb8f5f 100644 --- a/backend/modules/prompt/application/manage.go +++ b/backend/modules/prompt/application/manage.go @@ -958,3 +958,28 @@ func (app *PromptManageApplicationImpl) UpdateCommitLabels(ctx context.Context, return r, nil } + +func (app *PromptManageApplicationImpl) BatchGetPromptBasic(ctx context.Context, request *manage.BatchGetPromptBasicRequest) (r *manage.BatchGetPromptBasicResponse, err error) { + r = manage.NewBatchGetPromptBasicResponse() + // 用户 + userID, ok := session.UserIDInCtx(ctx) + if !ok || lo.IsEmpty(userID) { + return r, errorx.NewByCode(prompterr.CommonInvalidParamCode, errorx.WithExtraMsg("User not found")) + } + + // 权限检查 + err = app.authRPCProvider.MCheckPromptPermission(ctx, request.GetWorkspaceID(), request.GetPromptIds(), consts.ActionLoopPromptRead) + if err != nil { + return r, err + } + + // 调用domain层服务查询PromptBasic列表 + promptBasics, err := app.manageRepo.BatchGetPromptBasic(ctx, request.GetPromptIds()) + if err != nil { + return r, err + } + // 转换结果 + r.Prompts = convertor.BatchPromptDO2DTO(maps.Values(promptBasics)) + + return r, nil +} diff --git a/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift b/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift index 9608fe966..b19e453db 100644 --- a/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift +++ b/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift @@ -22,6 +22,7 @@ service PromptManageService { ListPromptResponse ListPrompt(1: ListPromptRequest request) (api.post = '/api/prompt/v1/prompts/list') // 查询片段的引用记录 ListParentPromptResponse ListParentPrompt (1: ListParentPromptRequest request) (api.post = '/api/prompt/v1/prompts/list_parent') + BatchGetPromptBasicResponse BatchGetPromptBasic (1: BatchGetPromptBasicRequest request) (api.post = '/api/prompt/v1/prompts/batch_get_prompt_basic') // 改 UpdatePromptResponse UpdatePrompt(1: UpdatePromptRequest request) (api.put = '/api/prompt/v1/prompts/:prompt_id') @@ -309,5 +310,18 @@ struct ListParentPromptRequest { struct ListParentPromptResponse { 1: optional map> parent_prompts // 不同片段版本被引用的父prompt记录 + 255: optional base.BaseResp BaseResp +} + +struct BatchGetPromptBasicRequest { + 1: optional i64 workspace_id (api.js_conv='true', vt.not_nil='true', vt.gt='0', go.tag='json:"workspace_id"') + 2: optional list prompt_ids + + 255: optional base.Base Base +} + +struct BatchGetPromptBasicResponse { + 1: optional list prompts + 255: optional base.BaseResp BaseResp } \ No newline at end of file From 374cba543df76705394a95e8fafe2cbfe41d9039 Mon Sep 17 00:00:00 2001 From: "wangluming.wlm" Date: Wed, 21 Jan 2026 22:24:53 +0800 Subject: [PATCH 4/5] feat:prompt_release --- backend/infra/platestwrite/latest_write_tracker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/infra/platestwrite/latest_write_tracker.go b/backend/infra/platestwrite/latest_write_tracker.go index 69b6cd859..935019cfe 100644 --- a/backend/infra/platestwrite/latest_write_tracker.go +++ b/backend/infra/platestwrite/latest_write_tracker.go @@ -131,6 +131,10 @@ const ( ResourceTypePromptCommitLabelMapping ResourceType = "prompt_commit_label_mapping" ResourceTypeCozeloopOptimizeTask ResourceType = "cozeloop_optimize_task" // 外场智能优化 ResourceTypePromptRelation ResourceType = "prompt_relation" + ResourceTypePromptRelease ResourceType = "prompt_release" + ResourceTypeReleaseTask ResourceType = "release_task" + ResourceTypeReleaseSubtask ResourceType = "release_subtask" + ResourceTypeReleaseTaskResource ResourceType = "release_task_resource" ResourceTypeExperiment ResourceType = "experiment" ResourceTypeEvalSet ResourceType = "eval_set" From 6a68b608831e02498cd5fb44cd42cf65a60c4e2a Mon Sep 17 00:00:00 2001 From: lizwang11 Date: Fri, 6 Feb 2026 11:49:10 +0800 Subject: [PATCH 5/5] Feat/dlp sync (#419) * feat: support dlp and security level for prompt * feat: add prompt commit and draft dao hook * feat: change permission check for ListParentPrompt * fix: user draft save encrypt message --- .gitignore | 3 +- backend/go.sum | 1 + .../loop/prompt/domain/prompt/k-prompt.go | 53 ++++ .../coze/loop/prompt/domain/prompt/prompt.go | 123 +++++++-- .../prompt/manage/coze.loop.prompt.manage.go | 253 +++++++++++++++++- .../manage/k-coze.loop.prompt.manage.go | 162 +++++++++++ .../prompt/application/convertor/prompt.go | 34 ++- backend/modules/prompt/application/manage.go | 45 ++-- backend/modules/prompt/application/wire.go | 3 + .../modules/prompt/application/wire_gen.go | 27 +- .../prompt/domain/entity/prompt_basic.go | 28 +- backend/modules/prompt/domain/repo/manage.go | 1 + backend/modules/prompt/infra/repo/manage.go | 5 +- .../infra/repo/mysql/convertor/manage.go | 2 + .../mysql/gorm_gen/model/prompt_basic.gen.go | 1 + .../mysql/gorm_gen/model/prompt_commit.gen.go | 41 +-- .../gorm_gen/model/prompt_user_draft.gen.go | 39 +-- .../mysql/gorm_gen/query/prompt_basic.gen.go | 6 +- .../mysql/gorm_gen/query/prompt_commit.gen.go | 48 ++-- .../gorm_gen/query/prompt_user_draft.gen.go | 46 ++-- .../repo/mysql/hooks/prompt_commit_hook.go | 26 ++ .../mysql/hooks/prompt_user_draft_hook.go | 26 ++ .../prompt/infra/repo/mysql/prompt_commit.go | 20 +- .../infra/repo/mysql/prompt_user_draft.go | 49 +++- backend/modules/prompt/pkg/consts/auth.go | 1 + .../prompt/coze.loop.prompt.manage.thrift | 3 + .../coze/loop/prompt/domain/prompt.thrift | 7 + .../mysql-init/init-sql/prompt_basic.sql | 1 + .../mysql-init/init-sql/prompt_commit.sql | 1 + .../mysql-init/init-sql/prompt_user_draft.sql | 1 + .../patch-sql/prompt_basic_alter.sql | 3 +- .../patch-sql/prompt_commit_alter.sql | 3 +- .../patch-sql/prompt_user_draft_alter.sql | 3 +- .../init/mysql/init-sql/prompt_basic.sql | 1 + .../mysql/init-sql/prompt_basic_alter.sql | 3 +- .../init/mysql/init-sql/prompt_commit.sql | 1 + .../mysql/init-sql/prompt_commit_alter.sql | 3 +- .../init/mysql/init-sql/prompt_user_draft.sql | 1 + .../init-sql/prompt_user_draft_alter.sql | 3 +- 39 files changed, 909 insertions(+), 168 deletions(-) create mode 100644 backend/modules/prompt/infra/repo/mysql/hooks/prompt_commit_hook.go create mode 100644 backend/modules/prompt/infra/repo/mysql/hooks/prompt_user_draft_hook.go diff --git a/.gitignore b/.gitignore index c6b6ab2b6..1483f32a0 100644 --- a/.gitignore +++ b/.gitignore @@ -59,4 +59,5 @@ backend/script/errorx/.env .cursor/ .specify/ specs/ -.puml \ No newline at end of file +.puml +.trae \ No newline at end of file diff --git a/backend/go.sum b/backend/go.sum index 8459bd31b..a7d0e542b 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -473,6 +473,7 @@ github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAx github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= diff --git a/backend/kitex_gen/coze/loop/prompt/domain/prompt/k-prompt.go b/backend/kitex_gen/coze/loop/prompt/domain/prompt/k-prompt.go index 2c8ea22bc..c7df0e584 100644 --- a/backend/kitex_gen/coze/loop/prompt/domain/prompt/k-prompt.go +++ b/backend/kitex_gen/coze/loop/prompt/domain/prompt/k-prompt.go @@ -555,6 +555,20 @@ func (p *PromptBasic) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -699,6 +713,20 @@ func (p *PromptBasic) FastReadField9(buf []byte) (int, error) { return offset, nil } +func (p *PromptBasic) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *SecurityLevel + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.SecurityLevel = _field + return offset, nil +} + func (p *PromptBasic) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -715,6 +743,7 @@ func (p *PromptBasic) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) offset += p.fastWriteField9(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -732,6 +761,7 @@ func (p *PromptBasic) BLength() int { l += p.field7Length() l += p.field8Length() l += p.field9Length() + l += p.field10Length() } l += thrift.Binary.FieldStopLength() return l @@ -818,6 +848,15 @@ func (p *PromptBasic) fastWriteField9(buf []byte, w thrift.NocopyWriter) int { return offset } +func (p *PromptBasic) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSecurityLevel() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.SecurityLevel) + } + return offset +} + func (p *PromptBasic) field1Length() int { l := 0 if p.IsSetDisplayName() { @@ -899,6 +938,15 @@ func (p *PromptBasic) field9Length() int { return l } +func (p *PromptBasic) field10Length() int { + l := 0 + if p.IsSetSecurityLevel() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.SecurityLevel) + } + return l +} + func (p *PromptBasic) DeepCopy(s interface{}) error { src, ok := s.(*PromptBasic) if !ok { @@ -965,6 +1013,11 @@ func (p *PromptBasic) DeepCopy(s interface{}) error { p.PromptType = &tmp } + if src.SecurityLevel != nil { + tmp := *src.SecurityLevel + p.SecurityLevel = &tmp + } + return nil } diff --git a/backend/kitex_gen/coze/loop/prompt/domain/prompt/prompt.go b/backend/kitex_gen/coze/loop/prompt/domain/prompt/prompt.go index 403002cfd..9edfd5483 100644 --- a/backend/kitex_gen/coze/loop/prompt/domain/prompt/prompt.go +++ b/backend/kitex_gen/coze/loop/prompt/domain/prompt/prompt.go @@ -15,6 +15,14 @@ const ( PromptTypeSnippet = "snippet" + SecurityLevelL1 = "L1" + + SecurityLevelL2 = "L2" + + SecurityLevelL3 = "L3" + + SecurityLevelL4 = "L4" + TemplateTypeNormal = "normal" TemplateTypeJinja2 = "jinja2" @@ -181,6 +189,8 @@ func (p *ThinkingOption) Value() (driver.Value, error) { type PromptType = string +type SecurityLevel = string + type TemplateType = string type ToolType = string @@ -738,15 +748,16 @@ func (p *Prompt) Field6DeepEqual(src *PromptCommit) bool { } type PromptBasic struct { - DisplayName *string `thrift:"display_name,1,optional" frugal:"1,optional,string" form:"display_name" json:"display_name,omitempty" query:"display_name"` - Description *string `thrift:"description,2,optional" frugal:"2,optional,string" form:"description" json:"description,omitempty" query:"description"` - LatestVersion *string `thrift:"latest_version,3,optional" frugal:"3,optional,string" form:"latest_version" json:"latest_version,omitempty" query:"latest_version"` - CreatedBy *string `thrift:"created_by,4,optional" frugal:"4,optional,string" form:"created_by" json:"created_by,omitempty" query:"created_by"` - UpdatedBy *string `thrift:"updated_by,5,optional" frugal:"5,optional,string" form:"updated_by" json:"updated_by,omitempty" query:"updated_by"` - CreatedAt *int64 `thrift:"created_at,6,optional" frugal:"6,optional,i64" json:"created_at" form:"created_at" query:"created_at"` - UpdatedAt *int64 `thrift:"updated_at,7,optional" frugal:"7,optional,i64" json:"updated_at" form:"updated_at" query:"updated_at"` - LatestCommittedAt *int64 `thrift:"latest_committed_at,8,optional" frugal:"8,optional,i64" json:"latest_committed_at" form:"latest_committed_at" query:"latest_committed_at"` - PromptType *PromptType `thrift:"prompt_type,9,optional" frugal:"9,optional,string" form:"prompt_type" json:"prompt_type,omitempty" query:"prompt_type"` + DisplayName *string `thrift:"display_name,1,optional" frugal:"1,optional,string" form:"display_name" json:"display_name,omitempty" query:"display_name"` + Description *string `thrift:"description,2,optional" frugal:"2,optional,string" form:"description" json:"description,omitempty" query:"description"` + LatestVersion *string `thrift:"latest_version,3,optional" frugal:"3,optional,string" form:"latest_version" json:"latest_version,omitempty" query:"latest_version"` + CreatedBy *string `thrift:"created_by,4,optional" frugal:"4,optional,string" form:"created_by" json:"created_by,omitempty" query:"created_by"` + UpdatedBy *string `thrift:"updated_by,5,optional" frugal:"5,optional,string" form:"updated_by" json:"updated_by,omitempty" query:"updated_by"` + CreatedAt *int64 `thrift:"created_at,6,optional" frugal:"6,optional,i64" json:"created_at" form:"created_at" query:"created_at"` + UpdatedAt *int64 `thrift:"updated_at,7,optional" frugal:"7,optional,i64" json:"updated_at" form:"updated_at" query:"updated_at"` + LatestCommittedAt *int64 `thrift:"latest_committed_at,8,optional" frugal:"8,optional,i64" json:"latest_committed_at" form:"latest_committed_at" query:"latest_committed_at"` + PromptType *PromptType `thrift:"prompt_type,9,optional" frugal:"9,optional,string" form:"prompt_type" json:"prompt_type,omitempty" query:"prompt_type"` + SecurityLevel *SecurityLevel `thrift:"security_level,10,optional" frugal:"10,optional,string" form:"security_level" json:"security_level,omitempty" query:"security_level"` } func NewPromptBasic() *PromptBasic { @@ -863,6 +874,18 @@ func (p *PromptBasic) GetPromptType() (v PromptType) { } return *p.PromptType } + +var PromptBasic_SecurityLevel_DEFAULT SecurityLevel + +func (p *PromptBasic) GetSecurityLevel() (v SecurityLevel) { + if p == nil { + return + } + if !p.IsSetSecurityLevel() { + return PromptBasic_SecurityLevel_DEFAULT + } + return *p.SecurityLevel +} func (p *PromptBasic) SetDisplayName(val *string) { p.DisplayName = val } @@ -890,17 +913,21 @@ func (p *PromptBasic) SetLatestCommittedAt(val *int64) { func (p *PromptBasic) SetPromptType(val *PromptType) { p.PromptType = val } +func (p *PromptBasic) SetSecurityLevel(val *SecurityLevel) { + p.SecurityLevel = val +} var fieldIDToName_PromptBasic = map[int16]string{ - 1: "display_name", - 2: "description", - 3: "latest_version", - 4: "created_by", - 5: "updated_by", - 6: "created_at", - 7: "updated_at", - 8: "latest_committed_at", - 9: "prompt_type", + 1: "display_name", + 2: "description", + 3: "latest_version", + 4: "created_by", + 5: "updated_by", + 6: "created_at", + 7: "updated_at", + 8: "latest_committed_at", + 9: "prompt_type", + 10: "security_level", } func (p *PromptBasic) IsSetDisplayName() bool { @@ -939,6 +966,10 @@ func (p *PromptBasic) IsSetPromptType() bool { return p.PromptType != nil } +func (p *PromptBasic) IsSetSecurityLevel() bool { + return p.SecurityLevel != nil +} + func (p *PromptBasic) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1029,6 +1060,14 @@ func (p *PromptBasic) Read(iprot thrift.TProtocol) (err error) { } 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 + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -1157,6 +1196,17 @@ func (p *PromptBasic) ReadField9(iprot thrift.TProtocol) error { p.PromptType = _field return nil } +func (p *PromptBasic) ReadField10(iprot thrift.TProtocol) error { + + var _field *SecurityLevel + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SecurityLevel = _field + return nil +} func (p *PromptBasic) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -1200,6 +1250,10 @@ func (p *PromptBasic) Write(oprot thrift.TProtocol) (err error) { fieldId = 9 goto WriteFieldError } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -1380,6 +1434,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) } +func (p *PromptBasic) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetSecurityLevel() { + if err = oprot.WriteFieldBegin("security_level", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SecurityLevel); 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 *PromptBasic) String() string { if p == nil { @@ -1422,6 +1494,9 @@ func (p *PromptBasic) DeepEqual(ano *PromptBasic) bool { if !p.Field9DeepEqual(ano.PromptType) { return false } + if !p.Field10DeepEqual(ano.SecurityLevel) { + return false + } return true } @@ -1533,6 +1608,18 @@ func (p *PromptBasic) Field9DeepEqual(src *PromptType) bool { } return true } +func (p *PromptBasic) Field10DeepEqual(src *SecurityLevel) bool { + + if p.SecurityLevel == src { + return true + } else if p.SecurityLevel == nil || src == nil { + return false + } + if strings.Compare(*p.SecurityLevel, *src) != 0 { + return false + } + return true +} type PromptCommit struct { Detail *PromptDetail `thrift:"detail,1,optional" frugal:"1,optional,PromptDetail" form:"detail" json:"detail,omitempty" query:"detail"` diff --git a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go index 5ac6b1591..9786a80c2 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/coze.loop.prompt.manage.go @@ -22,13 +22,14 @@ type ListPromptOrderBy = string // --------------- Prompt管理 --------------- // type CreatePromptRequest struct { - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` - PromptName *string `thrift:"prompt_name,11,optional" frugal:"11,optional,string" form:"prompt_name" json:"prompt_name,omitempty" query:"prompt_name"` - PromptKey *string `thrift:"prompt_key,12,optional" frugal:"12,optional,string" form:"prompt_key" json:"prompt_key,omitempty" query:"prompt_key"` - PromptDescription *string `thrift:"prompt_description,13,optional" frugal:"13,optional,string" form:"prompt_description" json:"prompt_description,omitempty" query:"prompt_description"` - PromptType *prompt.PromptType `thrift:"prompt_type,14,optional" frugal:"14,optional,string" form:"prompt_type" json:"prompt_type,omitempty" query:"prompt_type"` - DraftDetail *prompt.PromptDetail `thrift:"draft_detail,21,optional" frugal:"21,optional,prompt.PromptDetail" form:"draft_detail" json:"draft_detail,omitempty" query:"draft_detail"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + PromptName *string `thrift:"prompt_name,11,optional" frugal:"11,optional,string" form:"prompt_name" json:"prompt_name,omitempty" query:"prompt_name"` + PromptKey *string `thrift:"prompt_key,12,optional" frugal:"12,optional,string" form:"prompt_key" json:"prompt_key,omitempty" query:"prompt_key"` + PromptDescription *string `thrift:"prompt_description,13,optional" frugal:"13,optional,string" form:"prompt_description" json:"prompt_description,omitempty" query:"prompt_description"` + PromptType *prompt.PromptType `thrift:"prompt_type,14,optional" frugal:"14,optional,string" form:"prompt_type" json:"prompt_type,omitempty" query:"prompt_type"` + SecurityLevel *prompt.SecurityLevel `thrift:"security_level,15,optional" frugal:"15,optional,string" form:"security_level" json:"security_level,omitempty" query:"security_level"` + DraftDetail *prompt.PromptDetail `thrift:"draft_detail,21,optional" frugal:"21,optional,prompt.PromptDetail" form:"draft_detail" json:"draft_detail,omitempty" query:"draft_detail"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewCreatePromptRequest() *CreatePromptRequest { @@ -98,6 +99,18 @@ func (p *CreatePromptRequest) GetPromptType() (v prompt.PromptType) { return *p.PromptType } +var CreatePromptRequest_SecurityLevel_DEFAULT prompt.SecurityLevel + +func (p *CreatePromptRequest) GetSecurityLevel() (v prompt.SecurityLevel) { + if p == nil { + return + } + if !p.IsSetSecurityLevel() { + return CreatePromptRequest_SecurityLevel_DEFAULT + } + return *p.SecurityLevel +} + var CreatePromptRequest_DraftDetail_DEFAULT *prompt.PromptDetail func (p *CreatePromptRequest) GetDraftDetail() (v *prompt.PromptDetail) { @@ -136,6 +149,9 @@ func (p *CreatePromptRequest) SetPromptDescription(val *string) { func (p *CreatePromptRequest) SetPromptType(val *prompt.PromptType) { p.PromptType = val } +func (p *CreatePromptRequest) SetSecurityLevel(val *prompt.SecurityLevel) { + p.SecurityLevel = val +} func (p *CreatePromptRequest) SetDraftDetail(val *prompt.PromptDetail) { p.DraftDetail = val } @@ -149,6 +165,7 @@ var fieldIDToName_CreatePromptRequest = map[int16]string{ 12: "prompt_key", 13: "prompt_description", 14: "prompt_type", + 15: "security_level", 21: "draft_detail", 255: "Base", } @@ -173,6 +190,10 @@ func (p *CreatePromptRequest) IsSetPromptType() bool { return p.PromptType != nil } +func (p *CreatePromptRequest) IsSetSecurityLevel() bool { + return p.SecurityLevel != nil +} + func (p *CreatePromptRequest) IsSetDraftDetail() bool { return p.DraftDetail != nil } @@ -239,6 +260,14 @@ func (p *CreatePromptRequest) Read(iprot thrift.TProtocol) (err error) { } 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 21: if fieldTypeId == thrift.STRUCT { if err = p.ReadField21(iprot); err != nil { @@ -339,6 +368,17 @@ func (p *CreatePromptRequest) ReadField14(iprot thrift.TProtocol) error { p.PromptType = _field return nil } +func (p *CreatePromptRequest) ReadField15(iprot thrift.TProtocol) error { + + var _field *prompt.SecurityLevel + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SecurityLevel = _field + return nil +} func (p *CreatePromptRequest) ReadField21(iprot thrift.TProtocol) error { _field := prompt.NewPromptDetail() if err := _field.Read(iprot); err != nil { @@ -382,6 +422,10 @@ func (p *CreatePromptRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 14 goto WriteFieldError } + if err = p.writeField15(oprot); err != nil { + fieldId = 15 + goto WriteFieldError + } if err = p.writeField21(oprot); err != nil { fieldId = 21 goto WriteFieldError @@ -498,6 +542,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) } +func (p *CreatePromptRequest) writeField15(oprot thrift.TProtocol) (err error) { + if p.IsSetSecurityLevel() { + if err = oprot.WriteFieldBegin("security_level", thrift.STRING, 15); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SecurityLevel); 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 *CreatePromptRequest) writeField21(oprot thrift.TProtocol) (err error) { if p.IsSetDraftDetail() { if err = oprot.WriteFieldBegin("draft_detail", thrift.STRUCT, 21); err != nil { @@ -564,6 +626,9 @@ func (p *CreatePromptRequest) DeepEqual(ano *CreatePromptRequest) bool { if !p.Field14DeepEqual(ano.PromptType) { return false } + if !p.Field15DeepEqual(ano.SecurityLevel) { + return false + } if !p.Field21DeepEqual(ano.DraftDetail) { return false } @@ -633,6 +698,18 @@ func (p *CreatePromptRequest) Field14DeepEqual(src *prompt.PromptType) bool { } return true } +func (p *CreatePromptRequest) Field15DeepEqual(src *prompt.SecurityLevel) bool { + + if p.SecurityLevel == src { + return true + } else if p.SecurityLevel == nil || src == nil { + return false + } + if strings.Compare(*p.SecurityLevel, *src) != 0 { + return false + } + return true +} func (p *CreatePromptRequest) Field21DeepEqual(src *prompt.PromptDetail) bool { if !p.DraftDetail.DeepEqual(src) { @@ -5706,10 +5783,12 @@ func (p *ListPromptResponse) Field255DeepEqual(src *base.BaseResp) bool { } type UpdatePromptRequest struct { - PromptID *int64 `thrift:"prompt_id,1,optional" frugal:"1,optional,i64" json:"prompt_id" path:"prompt_id" ` - PromptName *string `thrift:"prompt_name,11,optional" frugal:"11,optional,string" form:"prompt_name" json:"prompt_name,omitempty" query:"prompt_name"` - PromptDescription *string `thrift:"prompt_description,12,optional" frugal:"12,optional,string" form:"prompt_description" json:"prompt_description,omitempty" query:"prompt_description"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + PromptID *int64 `thrift:"prompt_id,1,optional" frugal:"1,optional,i64" json:"prompt_id" path:"prompt_id" ` + PromptName *string `thrift:"prompt_name,11,optional" frugal:"11,optional,string" form:"prompt_name" json:"prompt_name,omitempty" query:"prompt_name"` + PromptDescription *string `thrift:"prompt_description,12,optional" frugal:"12,optional,string" form:"prompt_description" json:"prompt_description,omitempty" query:"prompt_description"` + SecurityLevel *prompt.SecurityLevel `thrift:"security_level,13,optional" frugal:"13,optional,string" form:"security_level" json:"security_level,omitempty" query:"security_level"` + DowngradeReason *string `thrift:"downgrade_reason,14,optional" frugal:"14,optional,string" form:"downgrade_reason" json:"downgrade_reason,omitempty" query:"downgrade_reason"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewUpdatePromptRequest() *UpdatePromptRequest { @@ -5755,6 +5834,30 @@ func (p *UpdatePromptRequest) GetPromptDescription() (v string) { return *p.PromptDescription } +var UpdatePromptRequest_SecurityLevel_DEFAULT prompt.SecurityLevel + +func (p *UpdatePromptRequest) GetSecurityLevel() (v prompt.SecurityLevel) { + if p == nil { + return + } + if !p.IsSetSecurityLevel() { + return UpdatePromptRequest_SecurityLevel_DEFAULT + } + return *p.SecurityLevel +} + +var UpdatePromptRequest_DowngradeReason_DEFAULT string + +func (p *UpdatePromptRequest) GetDowngradeReason() (v string) { + if p == nil { + return + } + if !p.IsSetDowngradeReason() { + return UpdatePromptRequest_DowngradeReason_DEFAULT + } + return *p.DowngradeReason +} + var UpdatePromptRequest_Base_DEFAULT *base.Base func (p *UpdatePromptRequest) GetBase() (v *base.Base) { @@ -5775,6 +5878,12 @@ func (p *UpdatePromptRequest) SetPromptName(val *string) { func (p *UpdatePromptRequest) SetPromptDescription(val *string) { p.PromptDescription = val } +func (p *UpdatePromptRequest) SetSecurityLevel(val *prompt.SecurityLevel) { + p.SecurityLevel = val +} +func (p *UpdatePromptRequest) SetDowngradeReason(val *string) { + p.DowngradeReason = val +} func (p *UpdatePromptRequest) SetBase(val *base.Base) { p.Base = val } @@ -5783,6 +5892,8 @@ var fieldIDToName_UpdatePromptRequest = map[int16]string{ 1: "prompt_id", 11: "prompt_name", 12: "prompt_description", + 13: "security_level", + 14: "downgrade_reason", 255: "Base", } @@ -5798,6 +5909,14 @@ func (p *UpdatePromptRequest) IsSetPromptDescription() bool { return p.PromptDescription != nil } +func (p *UpdatePromptRequest) IsSetSecurityLevel() bool { + return p.SecurityLevel != nil +} + +func (p *UpdatePromptRequest) IsSetDowngradeReason() bool { + return p.DowngradeReason != nil +} + func (p *UpdatePromptRequest) IsSetBase() bool { return p.Base != nil } @@ -5844,6 +5963,22 @@ func (p *UpdatePromptRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 13: + if fieldTypeId == thrift.STRING { + 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 255: if fieldTypeId == thrift.STRUCT { if err = p.ReadField255(iprot); err != nil { @@ -5914,6 +6049,28 @@ func (p *UpdatePromptRequest) ReadField12(iprot thrift.TProtocol) error { p.PromptDescription = _field return nil } +func (p *UpdatePromptRequest) ReadField13(iprot thrift.TProtocol) error { + + var _field *prompt.SecurityLevel + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SecurityLevel = _field + return nil +} +func (p *UpdatePromptRequest) ReadField14(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.DowngradeReason = _field + return nil +} func (p *UpdatePromptRequest) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBase() if err := _field.Read(iprot); err != nil { @@ -5941,6 +6098,14 @@ func (p *UpdatePromptRequest) Write(oprot thrift.TProtocol) (err error) { 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.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -6017,6 +6182,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } +func (p *UpdatePromptRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetSecurityLevel() { + if err = oprot.WriteFieldBegin("security_level", thrift.STRING, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SecurityLevel); 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 *UpdatePromptRequest) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetDowngradeReason() { + if err = oprot.WriteFieldBegin("downgrade_reason", thrift.STRING, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.DowngradeReason); 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 *UpdatePromptRequest) writeField255(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { @@ -6059,6 +6260,12 @@ func (p *UpdatePromptRequest) DeepEqual(ano *UpdatePromptRequest) bool { if !p.Field12DeepEqual(ano.PromptDescription) { return false } + if !p.Field13DeepEqual(ano.SecurityLevel) { + return false + } + if !p.Field14DeepEqual(ano.DowngradeReason) { + return false + } if !p.Field255DeepEqual(ano.Base) { return false } @@ -6101,6 +6308,30 @@ func (p *UpdatePromptRequest) Field12DeepEqual(src *string) bool { } return true } +func (p *UpdatePromptRequest) Field13DeepEqual(src *prompt.SecurityLevel) bool { + + if p.SecurityLevel == src { + return true + } else if p.SecurityLevel == nil || src == nil { + return false + } + if strings.Compare(*p.SecurityLevel, *src) != 0 { + return false + } + return true +} +func (p *UpdatePromptRequest) Field14DeepEqual(src *string) bool { + + if p.DowngradeReason == src { + return true + } else if p.DowngradeReason == nil || src == nil { + return false + } + if strings.Compare(*p.DowngradeReason, *src) != 0 { + return false + } + return true +} func (p *UpdatePromptRequest) Field255DeepEqual(src *base.Base) bool { if !p.Base.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go b/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go index 87d0af839..5a5309b35 100644 --- a/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go +++ b/backend/kitex_gen/coze/loop/prompt/manage/k-coze.loop.prompt.manage.go @@ -118,6 +118,20 @@ func (p *CreatePromptRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 15: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField15(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 21: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField21(buf[offset:]) @@ -234,6 +248,20 @@ func (p *CreatePromptRequest) FastReadField14(buf []byte) (int, error) { return offset, nil } +func (p *CreatePromptRequest) FastReadField15(buf []byte) (int, error) { + offset := 0 + + var _field *prompt.SecurityLevel + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.SecurityLevel = _field + return offset, nil +} + func (p *CreatePromptRequest) FastReadField21(buf []byte) (int, error) { offset := 0 _field := prompt.NewPromptDetail() @@ -270,6 +298,7 @@ func (p *CreatePromptRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) offset += p.fastWriteField12(buf[offset:], w) offset += p.fastWriteField13(buf[offset:], w) offset += p.fastWriteField14(buf[offset:], w) + offset += p.fastWriteField15(buf[offset:], w) offset += p.fastWriteField21(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -285,6 +314,7 @@ func (p *CreatePromptRequest) BLength() int { l += p.field12Length() l += p.field13Length() l += p.field14Length() + l += p.field15Length() l += p.field21Length() l += p.field255Length() } @@ -337,6 +367,15 @@ func (p *CreatePromptRequest) fastWriteField14(buf []byte, w thrift.NocopyWriter return offset } +func (p *CreatePromptRequest) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSecurityLevel() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 15) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.SecurityLevel) + } + return offset +} + func (p *CreatePromptRequest) fastWriteField21(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetDraftDetail() { @@ -400,6 +439,15 @@ func (p *CreatePromptRequest) field14Length() int { return l } +func (p *CreatePromptRequest) field15Length() int { + l := 0 + if p.IsSetSecurityLevel() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.SecurityLevel) + } + return l +} + func (p *CreatePromptRequest) field21Length() int { l := 0 if p.IsSetDraftDetail() { @@ -458,6 +506,11 @@ func (p *CreatePromptRequest) DeepCopy(s interface{}) error { p.PromptType = &tmp } + if src.SecurityLevel != nil { + tmp := *src.SecurityLevel + p.SecurityLevel = &tmp + } + var _draftDetail *prompt.PromptDetail if src.DraftDetail != nil { _draftDetail = &prompt.PromptDetail{} @@ -4145,6 +4198,34 @@ func (p *UpdatePromptRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 13: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 14: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -4219,6 +4300,34 @@ func (p *UpdatePromptRequest) FastReadField12(buf []byte) (int, error) { return offset, nil } +func (p *UpdatePromptRequest) FastReadField13(buf []byte) (int, error) { + offset := 0 + + var _field *prompt.SecurityLevel + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.SecurityLevel = _field + return offset, nil +} + +func (p *UpdatePromptRequest) FastReadField14(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.DowngradeReason = _field + return offset, nil +} + func (p *UpdatePromptRequest) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBase() @@ -4241,6 +4350,8 @@ func (p *UpdatePromptRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) + offset += p.fastWriteField13(buf[offset:], w) + offset += p.fastWriteField14(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -4253,6 +4364,8 @@ func (p *UpdatePromptRequest) BLength() int { l += p.field1Length() l += p.field11Length() l += p.field12Length() + l += p.field13Length() + l += p.field14Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -4286,6 +4399,24 @@ func (p *UpdatePromptRequest) fastWriteField12(buf []byte, w thrift.NocopyWriter return offset } +func (p *UpdatePromptRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSecurityLevel() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 13) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.SecurityLevel) + } + return offset +} + +func (p *UpdatePromptRequest) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetDowngradeReason() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 14) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.DowngradeReason) + } + return offset +} + func (p *UpdatePromptRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetBase() { @@ -4322,6 +4453,24 @@ func (p *UpdatePromptRequest) field12Length() int { return l } +func (p *UpdatePromptRequest) field13Length() int { + l := 0 + if p.IsSetSecurityLevel() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.SecurityLevel) + } + return l +} + +func (p *UpdatePromptRequest) field14Length() int { + l := 0 + if p.IsSetDowngradeReason() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.DowngradeReason) + } + return l +} + func (p *UpdatePromptRequest) field255Length() int { l := 0 if p.IsSetBase() { @@ -4358,6 +4507,19 @@ func (p *UpdatePromptRequest) DeepCopy(s interface{}) error { p.PromptDescription = &tmp } + if src.SecurityLevel != nil { + tmp := *src.SecurityLevel + p.SecurityLevel = &tmp + } + + if src.DowngradeReason != nil { + var tmp string + if *src.DowngradeReason != "" { + tmp = kutils.StringDeepCopy(*src.DowngradeReason) + } + p.DowngradeReason = &tmp + } + var _base *base.Base if src.Base != nil { _base = &base.Base{} diff --git a/backend/modules/prompt/application/convertor/prompt.go b/backend/modules/prompt/application/convertor/prompt.go index babcd757b..e67f6d78e 100644 --- a/backend/modules/prompt/application/convertor/prompt.go +++ b/backend/modules/prompt/application/convertor/prompt.go @@ -101,6 +101,7 @@ func PromptBasicDTO2DO(dto *prompt.PromptBasic) *entity.PromptBasic { UpdatedBy: dto.GetUpdatedBy(), CreatedAt: time.UnixMilli(dto.GetCreatedAt()), UpdatedAt: time.UnixMilli(dto.GetUpdatedAt()), + SecurityLevel: SecurityLevelDTO2DO(dto.GetSecurityLevel()), } } @@ -197,6 +198,21 @@ func PromptTypeDTO2DO(dto prompt.PromptType) entity.PromptType { } } +func SecurityLevelDTO2DO(dto prompt.SecurityLevel) entity.SecurityLevel { + switch dto { + case prompt.SecurityLevelL1: + return entity.SecurityLevelL1 + case prompt.SecurityLevelL2: + return entity.SecurityLevelL2 + case prompt.SecurityLevelL3: + return entity.SecurityLevelL3 + case prompt.SecurityLevelL4: + return entity.SecurityLevelL4 + default: + return entity.SecurityLevelL3 + } +} + func BatchMessageDTO2DO(dtos []*prompt.Message) []*entity.Message { if dtos == nil { return nil @@ -923,7 +939,8 @@ func PromptBasicDO2DTO(do *entity.PromptBasic) *prompt.PromptBasic { } return ptr.Of(do.LatestCommittedAt.UnixMilli()) }(), - PromptType: ptr.Of(PromptTypeDO2DTO(do.PromptType)), + PromptType: ptr.Of(PromptTypeDO2DTO(do.PromptType)), + SecurityLevel: SecurityLevelDO2DTO(do.SecurityLevel), } } @@ -938,6 +955,21 @@ func PromptTypeDO2DTO(do entity.PromptType) prompt.PromptType { } } +func SecurityLevelDO2DTO(level entity.SecurityLevel) *prompt.SecurityLevel { + switch level { + case entity.SecurityLevelL1: + return ptr.Of(prompt.SecurityLevelL1) + case entity.SecurityLevelL2: + return ptr.Of(prompt.SecurityLevelL2) + case entity.SecurityLevelL3: + return ptr.Of(prompt.SecurityLevelL3) + case entity.SecurityLevelL4: + return ptr.Of(prompt.SecurityLevelL4) + default: + return ptr.Of(prompt.SecurityLevelL3) + } +} + func BatchPromptCommitDO2DTO(dos []*entity.PromptCommit) []*prompt.PromptCommit { if len(dos) == 0 { return nil diff --git a/backend/modules/prompt/application/manage.go b/backend/modules/prompt/application/manage.go index 981bb8f5f..67b47f38f 100644 --- a/backend/modules/prompt/application/manage.go +++ b/backend/modules/prompt/application/manage.go @@ -67,17 +67,17 @@ func (app *PromptManageApplicationImpl) ListParentPrompt(ctx context.Context, re return r, errorx.NewByCode(prompterr.CommonInvalidParamCode, errorx.WithExtraMsg("User not found")) } - // 权限检查 - err = app.authRPCProvider.CheckSpacePermission(ctx, request.GetWorkspaceID(), consts.ActionLoopPromptRead) - if err != nil { - return r, err - } - // 参数验证 if request.GetPromptID() <= 0 { return r, errorx.NewByCode(prompterr.CommonInvalidParamCode, errorx.WithExtraMsg("Prompt ID is required")) } + // 权限检查 + err = app.authRPCProvider.MCheckPromptPermission(ctx, request.GetWorkspaceID(), []int64{request.GetPromptID()}, consts.ActionLoopPromptRead) + if err != nil { + return r, err + } + // 调用repository层查询父prompt result, err := app.manageRepo.ListParentPrompt(ctx, repo.ListParentPromptParam{ SubPromptID: request.GetPromptID(), @@ -126,16 +126,20 @@ func (app *PromptManageApplicationImpl) CreatePrompt(ctx context.Context, reques if request.PromptType == nil { request.PromptType = ptr.Of(prompt.PromptTypeNormal) } + if request.SecurityLevel == nil { + request.SecurityLevel = ptr.Of(prompt.SecurityLevelL3) + } // create prompt promptDTO := &prompt.Prompt{ WorkspaceID: request.WorkspaceID, PromptKey: request.PromptKey, PromptBasic: &prompt.PromptBasic{ - PromptType: request.PromptType, - DisplayName: request.PromptName, - Description: request.PromptDescription, - CreatedBy: ptr.Of(userID), - UpdatedBy: ptr.Of(userID), + PromptType: request.PromptType, + DisplayName: request.PromptName, + Description: request.PromptDescription, + CreatedBy: ptr.Of(userID), + UpdatedBy: ptr.Of(userID), + SecurityLevel: request.SecurityLevel, }, PromptDraft: func() *prompt.PromptDraft { if request.DraftDetail == nil { @@ -203,15 +207,18 @@ func (app *PromptManageApplicationImpl) ClonePrompt(ctx context.Context, request clonedPromptDO.PromptKey = request.GetClonedPromptKey() promptType := entity.PromptTypeNormal + securityLevel := entity.SecurityLevelL3 if promptDO.PromptBasic != nil && promptDO.PromptBasic.PromptType != "" { promptType = promptDO.PromptBasic.PromptType + securityLevel = promptDO.PromptBasic.SecurityLevel } clonedPromptDO.PromptBasic = &entity.PromptBasic{ - DisplayName: request.GetClonedPromptName(), - Description: request.GetClonedPromptDescription(), - CreatedBy: userID, - PromptType: promptType, + DisplayName: request.GetClonedPromptName(), + Description: request.GetClonedPromptDescription(), + CreatedBy: userID, + PromptType: promptType, + SecurityLevel: securityLevel, } clonedPromptDO.PromptDraft = &entity.PromptDraft{ DraftInfo: &entity.DraftInfo{ @@ -474,6 +481,13 @@ func (app *PromptManageApplicationImpl) UpdatePrompt(ctx context.Context, reques if err != nil { return r, err } + securityLevel := convertor.SecurityLevelDTO2DO(request.GetSecurityLevel()) + if promptDO.PromptBasic != nil && promptDO.PromptBasic.SecurityLevel != securityLevel { + err = app.authRPCProvider.MCheckPromptPermission(ctx, promptDO.SpaceID, []int64{request.GetPromptID()}, consts.ActionLoopPromptEditSecLevel) + if err != nil { + return r, err + } + } // 审核 err = app.auditRPCProvider.AuditPrompt(ctx, &entity.Prompt{ @@ -494,6 +508,7 @@ func (app *PromptManageApplicationImpl) UpdatePrompt(ctx context.Context, reques PromptName: request.GetPromptName(), PromptDescription: request.GetPromptDescription(), + SecurityLevel: securityLevel, } return r, app.manageRepo.UpdatePrompt(ctx, updatePromptParam) } diff --git a/backend/modules/prompt/application/wire.go b/backend/modules/prompt/application/wire.go index d05a990c3..b275cb5a3 100644 --- a/backend/modules/prompt/application/wire.go +++ b/backend/modules/prompt/application/wire.go @@ -29,6 +29,7 @@ import ( promptconf "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/conf" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql" + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/hooks" rediscache "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/redis" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/rpc" "github.com/coze-dev/coze-loop/backend/pkg/conf" @@ -44,6 +45,8 @@ var ( repo.NewLabelRepo, repo.NewDebugLogRepo, repo.NewDebugContextRepo, + hooks.NewEmptyPromptCommitHook, + hooks.NewEmptyPromptUserDraftHook, mysql.NewPromptBasicDAO, mysql.NewPromptCommitDAO, mysql.NewPromptUserDraftDAO, diff --git a/backend/modules/prompt/application/wire_gen.go b/backend/modules/prompt/application/wire_gen.go index 06d11e9be..c5c88ae26 100644 --- a/backend/modules/prompt/application/wire_gen.go +++ b/backend/modules/prompt/application/wire_gen.go @@ -27,6 +27,7 @@ import ( conf2 "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/conf" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql" + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/hooks" redis2 "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/redis" "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/rpc" "github.com/coze-dev/coze-loop/backend/pkg/conf" @@ -37,8 +38,10 @@ import ( func InitPromptManageApplication(idgen2 idgen.IIDGenerator, db2 db.Provider, redisCli redis.Cmdable, meter metrics.Meter, configFactory conf.IConfigLoaderFactory, llmClient llmruntimeservice.Client, authClient authservice.Client, fileClient fileservice.Client, userClient userservice.Client, auditClient audit.IAuditService) (manage.PromptManageService, error) { iPromptBasicDAO := mysql.NewPromptBasicDAO(db2, redisCli) - iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli) - iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli) + iPromptCommitHook := hooks.NewEmptyPromptCommitHook() + iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli, iPromptCommitHook) + iPromptUserDraftHook := hooks.NewEmptyPromptUserDraftHook() + iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli, iPromptUserDraftHook) iCommitLabelMappingDAO := mysql.NewCommitLabelMappingDAO(db2, redisCli) iPromptRelationDAO := mysql.NewPromptRelationDAO(db2, redisCli) redisIPromptBasicDAO := redis2.NewPromptBasicDAO() @@ -78,8 +81,10 @@ func InitPromptDebugApplication(idgen2 idgen.IIDGenerator, db2 db.Provider, redi iToolConfigProvider := service.NewToolConfigProvider() iToolResultsCollector := service.NewToolResultsCollector() iPromptBasicDAO := mysql.NewPromptBasicDAO(db2, redisCli) - iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli) - iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli) + iPromptCommitHook := hooks.NewEmptyPromptCommitHook() + iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli, iPromptCommitHook) + iPromptUserDraftHook := hooks.NewEmptyPromptUserDraftHook() + iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli, iPromptUserDraftHook) iCommitLabelMappingDAO := mysql.NewCommitLabelMappingDAO(db2, redisCli) iPromptRelationDAO := mysql.NewPromptRelationDAO(db2, redisCli) redisIPromptBasicDAO := redis2.NewPromptBasicDAO() @@ -110,8 +115,10 @@ func InitPromptExecuteApplication(idgen2 idgen.IIDGenerator, db2 db.Provider, re iDebugContextDAO := mysql.NewDebugContextDAO(db2) iDebugContextRepo := repo.NewDebugContextRepo(idgen2, iDebugContextDAO) iPromptBasicDAO := mysql.NewPromptBasicDAO(db2, redisCli) - iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli) - iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli) + iPromptCommitHook := hooks.NewEmptyPromptCommitHook() + iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli, iPromptCommitHook) + iPromptUserDraftHook := hooks.NewEmptyPromptUserDraftHook() + iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli, iPromptUserDraftHook) iCommitLabelMappingDAO := mysql.NewCommitLabelMappingDAO(db2, redisCli) iPromptRelationDAO := mysql.NewPromptRelationDAO(db2, redisCli) redisIPromptBasicDAO := redis2.NewPromptBasicDAO() @@ -141,8 +148,10 @@ func InitPromptOpenAPIApplication(idgen2 idgen.IIDGenerator, db2 db.Provider, re iDebugContextDAO := mysql.NewDebugContextDAO(db2) iDebugContextRepo := repo.NewDebugContextRepo(idgen2, iDebugContextDAO) iPromptBasicDAO := mysql.NewPromptBasicDAO(db2, redisCli) - iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli) - iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli) + iPromptCommitHook := hooks.NewEmptyPromptCommitHook() + iPromptCommitDAO := mysql.NewPromptCommitDAO(db2, redisCli, iPromptCommitHook) + iPromptUserDraftHook := hooks.NewEmptyPromptUserDraftHook() + iPromptUserDraftDAO := mysql.NewPromptUserDraftDAO(db2, redisCli, iPromptUserDraftHook) iCommitLabelMappingDAO := mysql.NewCommitLabelMappingDAO(db2, redisCli) iPromptRelationDAO := mysql.NewPromptRelationDAO(db2, redisCli) redisIPromptBasicDAO := redis2.NewPromptBasicDAO() @@ -172,7 +181,7 @@ func InitPromptOpenAPIApplication(idgen2 idgen.IIDGenerator, db2 db.Provider, re // wire.go: var ( - promptDomainSet = wire.NewSet(service.NewPromptFormatter, service.NewToolConfigProvider, service.NewToolResultsCollector, service.NewPromptService, repo.NewManageRepo, repo.NewLabelRepo, repo.NewDebugLogRepo, repo.NewDebugContextRepo, mysql.NewPromptBasicDAO, mysql.NewPromptCommitDAO, mysql.NewPromptUserDraftDAO, mysql.NewPromptRelationDAO, mysql.NewLabelDAO, mysql.NewCommitLabelMappingDAO, mysql.NewDebugLogDAO, mysql.NewDebugContextDAO, redis2.NewPromptBasicDAO, redis2.NewPromptDAO, redis2.NewPromptLabelVersionDAO, conf2.NewPromptConfigProvider, rpc.NewLLMRPCProvider, rpc.NewAuthRPCProvider, rpc.NewFileRPCProvider, rpc.NewUserRPCProvider, rpc.NewAuditRPCProvider, collector.NewEventCollectorProvider, service.NewCozeLoopSnippetParser) + promptDomainSet = wire.NewSet(service.NewPromptFormatter, service.NewToolConfigProvider, service.NewToolResultsCollector, service.NewPromptService, repo.NewManageRepo, repo.NewLabelRepo, repo.NewDebugLogRepo, repo.NewDebugContextRepo, hooks.NewEmptyPromptCommitHook, hooks.NewEmptyPromptUserDraftHook, mysql.NewPromptBasicDAO, mysql.NewPromptCommitDAO, mysql.NewPromptUserDraftDAO, mysql.NewPromptRelationDAO, mysql.NewLabelDAO, mysql.NewCommitLabelMappingDAO, mysql.NewDebugLogDAO, mysql.NewDebugContextDAO, redis2.NewPromptBasicDAO, redis2.NewPromptDAO, redis2.NewPromptLabelVersionDAO, conf2.NewPromptConfigProvider, rpc.NewLLMRPCProvider, rpc.NewAuthRPCProvider, rpc.NewFileRPCProvider, rpc.NewUserRPCProvider, rpc.NewAuditRPCProvider, collector.NewEventCollectorProvider, service.NewCozeLoopSnippetParser) manageSet = wire.NewSet( NewPromptManageApplication, promptDomainSet, diff --git a/backend/modules/prompt/domain/entity/prompt_basic.go b/backend/modules/prompt/domain/entity/prompt_basic.go index 6c2bf277a..2f6225f30 100644 --- a/backend/modules/prompt/domain/entity/prompt_basic.go +++ b/backend/modules/prompt/domain/entity/prompt_basic.go @@ -6,15 +6,16 @@ package entity import "time" type PromptBasic struct { - PromptType PromptType `json:"prompt_type"` - DisplayName string `json:"display_name"` - Description string `json:"description"` - LatestVersion string `json:"latest_version"` - CreatedBy string `json:"created_by"` - UpdatedBy string `json:"updated_by"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - LatestCommittedAt *time.Time `json:"latest_committed_at"` + PromptType PromptType `json:"prompt_type"` + SecurityLevel SecurityLevel `json:"security_level"` + DisplayName string `json:"display_name"` + Description string `json:"description"` + LatestVersion string `json:"latest_version"` + CreatedBy string `json:"created_by"` + UpdatedBy string `json:"updated_by"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + LatestCommittedAt *time.Time `json:"latest_committed_at"` } type PromptType string @@ -23,3 +24,12 @@ const ( PromptTypeNormal PromptType = "normal" PromptTypeSnippet PromptType = "snippet" ) + +type SecurityLevel string + +const ( + SecurityLevelL1 SecurityLevel = "L1" + SecurityLevelL2 SecurityLevel = "L2" + SecurityLevelL3 SecurityLevel = "L3" + SecurityLevelL4 SecurityLevel = "L4" +) diff --git a/backend/modules/prompt/domain/repo/manage.go b/backend/modules/prompt/domain/repo/manage.go index 6454e96b8..a91f078c9 100644 --- a/backend/modules/prompt/domain/repo/manage.go +++ b/backend/modules/prompt/domain/repo/manage.go @@ -63,6 +63,7 @@ type UpdatePromptParam struct { PromptName string PromptDescription string + SecurityLevel entity.SecurityLevel } type CommitDraftParam struct { diff --git a/backend/modules/prompt/infra/repo/manage.go b/backend/modules/prompt/infra/repo/manage.go index d741724ec..aba9802c7 100644 --- a/backend/modules/prompt/infra/repo/manage.go +++ b/backend/modules/prompt/infra/repo/manage.go @@ -513,8 +513,9 @@ func (d *ManageRepoImpl) UpdatePrompt(ctx context.Context, param repo.UpdateProm updateFields := map[string]interface{}{ q.PromptBasic.UpdatedBy.ColumnName().String(): param.UpdatedBy, - q.PromptBasic.Name.ColumnName().String(): param.PromptName, - q.PromptBasic.Description.ColumnName().String(): param.PromptDescription, + q.PromptBasic.Name.ColumnName().String(): param.PromptName, + q.PromptBasic.Description.ColumnName().String(): param.PromptDescription, + q.PromptBasic.SecurityLevel.ColumnName().String(): param.SecurityLevel, } err = d.promptBasicDAO.Update(ctx, param.PromptID, updateFields) if err != nil { diff --git a/backend/modules/prompt/infra/repo/mysql/convertor/manage.go b/backend/modules/prompt/infra/repo/mysql/convertor/manage.go index 9882eee56..266f55f07 100644 --- a/backend/modules/prompt/infra/repo/mysql/convertor/manage.go +++ b/backend/modules/prompt/infra/repo/mysql/convertor/manage.go @@ -80,6 +80,7 @@ func BasicPO2DO(promptPO *model.PromptBasic) *entity.PromptBasic { CreatedAt: promptPO.CreatedAt, UpdatedAt: promptPO.UpdatedAt, LatestCommittedAt: promptPO.LatestCommitTime, + SecurityLevel: entity.SecurityLevel(promptPO.SecurityLevel), } } @@ -149,6 +150,7 @@ func PromptDO2BasicPO(do *entity.Prompt) *model.PromptBasic { CreatedAt: do.PromptBasic.CreatedAt, UpdatedAt: do.PromptBasic.UpdatedAt, PromptType: PromptTypeDO2PO(do.PromptBasic.PromptType), + SecurityLevel: string(do.PromptBasic.SecurityLevel), } } diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_basic.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_basic.gen.go index 3845b063f..4a1018e6d 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_basic.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_basic.gen.go @@ -27,6 +27,7 @@ type PromptBasic struct { UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint(20);not null;uniqueIndex:uniq_space_id_prompt_key_deleted_at,priority:3;index:idx_pid_ptype_delat,priority:3;column:deleted_at;not null;default:0;softDelete:milli;comment:删除时间" json:"deleted_at"` // 删除时间 PromptType string `gorm:"column:prompt_type;type:varchar(64);not null;index:idx_pid_ptype_delat,priority:2;default:normal;comment:Prompt类型" json:"prompt_type"` // Prompt类型 + SecurityLevel string `gorm:"column:security_level;type:varchar(64);not null;default:L3;comment:security level" json:"security_level"` // security level } // TableName PromptBasic's table name diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_commit.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_commit.gen.go index 518af502c..b92ad1727 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_commit.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_commit.gen.go @@ -12,26 +12,27 @@ const TableNamePromptCommit = "prompt_commit" // PromptCommit Commit表 type PromptCommit struct { - ID int64 `gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID - SpaceID int64 `gorm:"column:space_id;type:bigint(20) unsigned;not null;comment:空间ID" json:"space_id"` // 空间ID - PromptID int64 `gorm:"column:prompt_id;type:bigint(20) unsigned;not null;uniqueIndex:uniq_prompt_id_version,priority:1;comment:Prompt ID" json:"prompt_id"` // Prompt ID - PromptKey string `gorm:"column:prompt_key;type:varchar(128);not null;index:idx_prompt_key_version,priority:1;comment:Prompt key" json:"prompt_key"` // Prompt key - TemplateType *string `gorm:"column:template_type;type:varchar(64);default:normal;comment:模版类型" json:"template_type"` // 模版类型 - Messages *string `gorm:"column:messages;type:longtext;comment:托管消息列表" json:"messages"` // 托管消息列表 - ModelConfig *string `gorm:"column:model_config;type:text;comment:模型配置" json:"model_config"` // 模型配置 - VariableDefs *string `gorm:"column:variable_defs;type:text;comment:变量定义" json:"variable_defs"` // 变量定义 - Tools *string `gorm:"column:tools;type:longtext;comment:tools" json:"tools"` // tools - ToolCallConfig *string `gorm:"column:tool_call_config;type:text;comment:tool调用配置" json:"tool_call_config"` // tool调用配置 - Metadata *string `gorm:"column:metadata;type:text;comment:模板元信息" json:"metadata"` // 模板元信息 - McpConfig *string `gorm:"column:mcp_config;type:text;comment:mcp config info" json:"mcp_config"` // mcp config info - Version string `gorm:"column:version;type:varchar(128);not null;uniqueIndex:uniq_prompt_id_version,priority:2;index:idx_prompt_key_version,priority:2;comment:版本" json:"version"` // 版本 - BaseVersion string `gorm:"column:base_version;type:varchar(128);not null;comment:来源版本" json:"base_version"` // 来源版本 - CommittedBy string `gorm:"column:committed_by;type:varchar(128);not null;comment:提交人" json:"committed_by"` // 提交人 - Description *string `gorm:"column:description;type:text;comment:提交版本描述" json:"description"` // 提交版本描述 - ExtInfo *string `gorm:"column:ext_info;type:text;comment:扩展字段" json:"ext_info"` // 扩展字段 - CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 - HasSnippets bool `gorm:"column:has_snippets;type:tinyint(1);not null;comment:是否包含prompt片段" json:"has_snippets"` // 是否包含prompt片段 + ID int64 `gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID + SpaceID int64 `gorm:"column:space_id;type:bigint(20) unsigned;not null;comment:空间ID" json:"space_id"` // 空间ID + PromptID int64 `gorm:"column:prompt_id;type:bigint(20) unsigned;not null;uniqueIndex:uniq_prompt_id_version,priority:1;comment:Prompt ID" json:"prompt_id"` // Prompt ID + PromptKey string `gorm:"column:prompt_key;type:varchar(128);not null;index:idx_prompt_key_version,priority:1;comment:Prompt key" json:"prompt_key"` // Prompt key + TemplateType *string `gorm:"column:template_type;type:varchar(64);default:normal;comment:模版类型" json:"template_type"` // 模版类型 + Messages *string `gorm:"column:messages;type:longtext;comment:托管消息列表" json:"messages"` // 托管消息列表 + ModelConfig *string `gorm:"column:model_config;type:text;comment:模型配置" json:"model_config"` // 模型配置 + VariableDefs *string `gorm:"column:variable_defs;type:text;comment:变量定义" json:"variable_defs"` // 变量定义 + Tools *string `gorm:"column:tools;type:longtext;comment:tools" json:"tools"` // tools + ToolCallConfig *string `gorm:"column:tool_call_config;type:text;comment:tool调用配置" json:"tool_call_config"` // tool调用配置 + Metadata *string `gorm:"column:metadata;type:text;comment:模板元信息" json:"metadata"` // 模板元信息 + McpConfig *string `gorm:"column:mcp_config;type:text;comment:mcp config info" json:"mcp_config"` // mcp config info + Version string `gorm:"column:version;type:varchar(128);not null;uniqueIndex:uniq_prompt_id_version,priority:2;index:idx_prompt_key_version,priority:2;comment:版本" json:"version"` // 版本 + BaseVersion string `gorm:"column:base_version;type:varchar(128);not null;comment:来源版本" json:"base_version"` // 来源版本 + CommittedBy string `gorm:"column:committed_by;type:varchar(128);not null;comment:提交人" json:"committed_by"` // 提交人 + Description *string `gorm:"column:description;type:text;comment:提交版本描述" json:"description"` // 提交版本描述 + ExtInfo *string `gorm:"column:ext_info;type:text;comment:扩展字段" json:"ext_info"` // 扩展字段 + CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间 + UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 + HasSnippets bool `gorm:"column:has_snippets;type:tinyint(1);not null;comment:是否包含prompt片段" json:"has_snippets"` // 是否包含prompt片段 + EncryptMessages *string `gorm:"column:encrypt_messages;type:longtext;comment:encrypt message list" json:"encrypt_messages"` // encrypt message list } // TableName PromptCommit's table name diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_user_draft.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_user_draft.gen.go index 5da4d102e..fcc4f1144 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_user_draft.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/model/prompt_user_draft.gen.go @@ -14,25 +14,26 @@ const TableNamePromptUserDraft = "prompt_user_draft" // PromptUserDraft Draft表 type PromptUserDraft struct { - ID int64 `gorm:"column:id;type:bigint(20) unsigned;primaryKey;comment:主键ID" json:"id"` // 主键ID - SpaceID int64 `gorm:"column:space_id;type:bigint(20) unsigned;not null;comment:空间ID" json:"space_id"` // 空间ID - PromptID int64 `gorm:"column:prompt_id;type:bigint(20) unsigned;not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:1;index:idx_prompt_id_user_id,priority:1;comment:Prompt ID" json:"prompt_id"` // Prompt ID - UserID string `gorm:"column:user_id;type:varchar(128);not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:2;index:idx_prompt_id_user_id,priority:2;comment:用户ID" json:"user_id"` // 用户ID - TemplateType *string `gorm:"column:template_type;type:varchar(64);default:Normal;comment:模版类型" json:"template_type"` // 模版类型 - Messages *string `gorm:"column:messages;type:longtext;comment:托管消息列表" json:"messages"` // 托管消息列表 - ModelConfig *string `gorm:"column:model_config;type:text;comment:模型配置" json:"model_config"` // 模型配置 - VariableDefs *string `gorm:"column:variable_defs;type:text;comment:变量定义" json:"variable_defs"` // 变量定义 - Tools *string `gorm:"column:tools;type:longtext;comment:tools" json:"tools"` // tools - ToolCallConfig *string `gorm:"column:tool_call_config;type:text;comment:tool调用配置" json:"tool_call_config"` // tool调用配置 - Metadata *string `gorm:"column:metadata;type:text;comment:模板元信息" json:"metadata"` // 模板元信息 - McpConfig *string `gorm:"column:mcp_config;type:text;comment:mcp config info" json:"mcp_config"` // mcp config info - BaseVersion string `gorm:"column:base_version;type:varchar(128);not null;comment:草稿关联版本" json:"base_version"` // 草稿关联版本 - IsDraftEdited int32 `gorm:"column:is_draft_edited;type:tinyint(4);not null;comment:草稿内容是否基于BaseVersion有变更" json:"is_draft_edited"` // 草稿内容是否基于BaseVersion有变更 - ExtInfo *string `gorm:"column:ext_info;type:text;comment:扩展字段" json:"ext_info"` // 扩展字段 - CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 - DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint(20);not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:3;column:deleted_at;not null;default:0;softDelete:milli;comment:删除时间" json:"deleted_at"` // 删除时间 - HasSnippets bool `gorm:"column:has_snippets;type:tinyint(1);not null;comment:是否包含prompt片段" json:"has_snippets"` // 是否包含prompt片段 + ID int64 `gorm:"column:id;type:bigint(20) unsigned;primaryKey;comment:主键ID" json:"id"` // 主键ID + SpaceID int64 `gorm:"column:space_id;type:bigint(20) unsigned;not null;comment:空间ID" json:"space_id"` // 空间ID + PromptID int64 `gorm:"column:prompt_id;type:bigint(20) unsigned;not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:1;index:idx_prompt_id_user_id,priority:1;comment:Prompt ID" json:"prompt_id"` // Prompt ID + UserID string `gorm:"column:user_id;type:varchar(128);not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:2;index:idx_prompt_id_user_id,priority:2;comment:用户ID" json:"user_id"` // 用户ID + TemplateType *string `gorm:"column:template_type;type:varchar(64);default:Normal;comment:模版类型" json:"template_type"` // 模版类型 + Messages *string `gorm:"column:messages;type:longtext;comment:托管消息列表" json:"messages"` // 托管消息列表 + ModelConfig *string `gorm:"column:model_config;type:text;comment:模型配置" json:"model_config"` // 模型配置 + VariableDefs *string `gorm:"column:variable_defs;type:text;comment:变量定义" json:"variable_defs"` // 变量定义 + Tools *string `gorm:"column:tools;type:longtext;comment:tools" json:"tools"` // tools + ToolCallConfig *string `gorm:"column:tool_call_config;type:text;comment:tool调用配置" json:"tool_call_config"` // tool调用配置 + Metadata *string `gorm:"column:metadata;type:text;comment:模板元信息" json:"metadata"` // 模板元信息 + McpConfig *string `gorm:"column:mcp_config;type:text;comment:mcp config info" json:"mcp_config"` // mcp config info + BaseVersion string `gorm:"column:base_version;type:varchar(128);not null;comment:草稿关联版本" json:"base_version"` // 草稿关联版本 + IsDraftEdited int32 `gorm:"column:is_draft_edited;type:tinyint(4);not null;comment:草稿内容是否基于BaseVersion有变更" json:"is_draft_edited"` // 草稿内容是否基于BaseVersion有变更 + ExtInfo *string `gorm:"column:ext_info;type:text;comment:扩展字段" json:"ext_info"` // 扩展字段 + CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间 + UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 + DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint(20);not null;uniqueIndex:uniq_prompt_id_user_id_deleted_at,priority:3;column:deleted_at;not null;default:0;softDelete:milli;comment:删除时间" json:"deleted_at"` // 删除时间 + HasSnippets bool `gorm:"column:has_snippets;type:tinyint(1);not null;comment:是否包含prompt片段" json:"has_snippets"` // 是否包含prompt片段 + EncryptMessages *string `gorm:"column:encrypt_messages;type:longtext;comment:encrypt message list" json:"encrypt_messages"` // encrypt message list } // TableName PromptUserDraft's table name diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_basic.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_basic.gen.go index c9a43121c..28f306402 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_basic.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_basic.gen.go @@ -40,6 +40,7 @@ func newPromptBasic(db *gorm.DB, opts ...gen.DOOption) promptBasic { _promptBasic.UpdatedAt = field.NewTime(tableName, "updated_at") _promptBasic.DeletedAt = field.NewField(tableName, "deleted_at") _promptBasic.PromptType = field.NewString(tableName, "prompt_type") + _promptBasic.SecurityLevel = field.NewString(tableName, "security_level") _promptBasic.fillFieldMap() @@ -64,6 +65,7 @@ type promptBasic struct { UpdatedAt field.Time // 更新时间 DeletedAt field.Field // 删除时间 PromptType field.String // Prompt类型 + SecurityLevel field.String // security level fieldMap map[string]field.Expr } @@ -93,6 +95,7 @@ func (p *promptBasic) updateTableName(table string) *promptBasic { p.UpdatedAt = field.NewTime(table, "updated_at") p.DeletedAt = field.NewField(table, "deleted_at") p.PromptType = field.NewString(table, "prompt_type") + p.SecurityLevel = field.NewString(table, "security_level") p.fillFieldMap() @@ -119,7 +122,7 @@ func (p *promptBasic) GetFieldByName(fieldName string) (field.OrderExpr, bool) { } func (p *promptBasic) fillFieldMap() { - p.fieldMap = make(map[string]field.Expr, 13) + p.fieldMap = make(map[string]field.Expr, 14) p.fieldMap["id"] = p.ID p.fieldMap["space_id"] = p.SpaceID p.fieldMap["prompt_key"] = p.PromptKey @@ -133,6 +136,7 @@ func (p *promptBasic) fillFieldMap() { p.fieldMap["updated_at"] = p.UpdatedAt p.fieldMap["deleted_at"] = p.DeletedAt p.fieldMap["prompt_type"] = p.PromptType + p.fieldMap["security_level"] = p.SecurityLevel } func (p promptBasic) clone(db *gorm.DB) promptBasic { diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_commit.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_commit.gen.go index 33de37829..7db1b07c6 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_commit.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_commit.gen.go @@ -47,6 +47,7 @@ func newPromptCommit(db *gorm.DB, opts ...gen.DOOption) promptCommit { _promptCommit.CreatedAt = field.NewTime(tableName, "created_at") _promptCommit.UpdatedAt = field.NewTime(tableName, "updated_at") _promptCommit.HasSnippets = field.NewBool(tableName, "has_snippets") + _promptCommit.EncryptMessages = field.NewString(tableName, "encrypt_messages") _promptCommit.fillFieldMap() @@ -57,27 +58,28 @@ func newPromptCommit(db *gorm.DB, opts ...gen.DOOption) promptCommit { type promptCommit struct { promptCommitDo promptCommitDo - ALL field.Asterisk - ID field.Int64 // 主键ID - SpaceID field.Int64 // 空间ID - PromptID field.Int64 // Prompt ID - PromptKey field.String // Prompt key - TemplateType field.String // 模版类型 - Messages field.String // 托管消息列表 - ModelConfig field.String // 模型配置 - VariableDefs field.String // 变量定义 - Tools field.String // tools - ToolCallConfig field.String // tool调用配置 - Metadata field.String // 模板元信息 - McpConfig field.String // mcp config info - Version field.String // 版本 - BaseVersion field.String // 来源版本 - CommittedBy field.String // 提交人 - Description field.String // 提交版本描述 - ExtInfo field.String // 扩展字段 - CreatedAt field.Time // 创建时间 - UpdatedAt field.Time // 更新时间 - HasSnippets field.Bool // 是否包含prompt片段 + ALL field.Asterisk + ID field.Int64 // 主键ID + SpaceID field.Int64 // 空间ID + PromptID field.Int64 // Prompt ID + PromptKey field.String // Prompt key + TemplateType field.String // 模版类型 + Messages field.String // 托管消息列表 + ModelConfig field.String // 模型配置 + VariableDefs field.String // 变量定义 + Tools field.String // tools + ToolCallConfig field.String // tool调用配置 + Metadata field.String // 模板元信息 + McpConfig field.String // mcp config info + Version field.String // 版本 + BaseVersion field.String // 来源版本 + CommittedBy field.String // 提交人 + Description field.String // 提交版本描述 + ExtInfo field.String // 扩展字段 + CreatedAt field.Time // 创建时间 + UpdatedAt field.Time // 更新时间 + HasSnippets field.Bool // 是否包含prompt片段 + EncryptMessages field.String // encrypt message list fieldMap map[string]field.Expr } @@ -114,6 +116,7 @@ func (p *promptCommit) updateTableName(table string) *promptCommit { p.CreatedAt = field.NewTime(table, "created_at") p.UpdatedAt = field.NewTime(table, "updated_at") p.HasSnippets = field.NewBool(table, "has_snippets") + p.EncryptMessages = field.NewString(table, "encrypt_messages") p.fillFieldMap() @@ -142,7 +145,7 @@ func (p *promptCommit) GetFieldByName(fieldName string) (field.OrderExpr, bool) } func (p *promptCommit) fillFieldMap() { - p.fieldMap = make(map[string]field.Expr, 20) + p.fieldMap = make(map[string]field.Expr, 21) p.fieldMap["id"] = p.ID p.fieldMap["space_id"] = p.SpaceID p.fieldMap["prompt_id"] = p.PromptID @@ -163,6 +166,7 @@ func (p *promptCommit) fillFieldMap() { p.fieldMap["created_at"] = p.CreatedAt p.fieldMap["updated_at"] = p.UpdatedAt p.fieldMap["has_snippets"] = p.HasSnippets + p.fieldMap["encrypt_messages"] = p.EncryptMessages } func (p promptCommit) clone(db *gorm.DB) promptCommit { diff --git a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_user_draft.gen.go b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_user_draft.gen.go index ddc543753..15d9fcfb4 100644 --- a/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_user_draft.gen.go +++ b/backend/modules/prompt/infra/repo/mysql/gorm_gen/query/prompt_user_draft.gen.go @@ -46,6 +46,7 @@ func newPromptUserDraft(db *gorm.DB, opts ...gen.DOOption) promptUserDraft { _promptUserDraft.UpdatedAt = field.NewTime(tableName, "updated_at") _promptUserDraft.DeletedAt = field.NewField(tableName, "deleted_at") _promptUserDraft.HasSnippets = field.NewBool(tableName, "has_snippets") + _promptUserDraft.EncryptMessages = field.NewString(tableName, "encrypt_messages") _promptUserDraft.fillFieldMap() @@ -56,26 +57,27 @@ func newPromptUserDraft(db *gorm.DB, opts ...gen.DOOption) promptUserDraft { type promptUserDraft struct { promptUserDraftDo promptUserDraftDo - ALL field.Asterisk - ID field.Int64 // 主键ID - SpaceID field.Int64 // 空间ID - PromptID field.Int64 // Prompt ID - UserID field.String // 用户ID - TemplateType field.String // 模版类型 - Messages field.String // 托管消息列表 - ModelConfig field.String // 模型配置 - VariableDefs field.String // 变量定义 - Tools field.String // tools - ToolCallConfig field.String // tool调用配置 - Metadata field.String // 模板元信息 - McpConfig field.String // mcp config info - BaseVersion field.String // 草稿关联版本 - IsDraftEdited field.Int32 // 草稿内容是否基于BaseVersion有变更 - ExtInfo field.String // 扩展字段 - CreatedAt field.Time // 创建时间 - UpdatedAt field.Time // 更新时间 - DeletedAt field.Field // 删除时间 - HasSnippets field.Bool // 是否包含prompt片段 + ALL field.Asterisk + ID field.Int64 // 主键ID + SpaceID field.Int64 // 空间ID + PromptID field.Int64 // Prompt ID + UserID field.String // 用户ID + TemplateType field.String // 模版类型 + Messages field.String // 托管消息列表 + ModelConfig field.String // 模型配置 + VariableDefs field.String // 变量定义 + Tools field.String // tools + ToolCallConfig field.String // tool调用配置 + Metadata field.String // 模板元信息 + McpConfig field.String // mcp config info + BaseVersion field.String // 草稿关联版本 + IsDraftEdited field.Int32 // 草稿内容是否基于BaseVersion有变更 + ExtInfo field.String // 扩展字段 + CreatedAt field.Time // 创建时间 + UpdatedAt field.Time // 更新时间 + DeletedAt field.Field // 删除时间 + HasSnippets field.Bool // 是否包含prompt片段 + EncryptMessages field.String // encrypt message list fieldMap map[string]field.Expr } @@ -111,6 +113,7 @@ func (p *promptUserDraft) updateTableName(table string) *promptUserDraft { p.UpdatedAt = field.NewTime(table, "updated_at") p.DeletedAt = field.NewField(table, "deleted_at") p.HasSnippets = field.NewBool(table, "has_snippets") + p.EncryptMessages = field.NewString(table, "encrypt_messages") p.fillFieldMap() @@ -139,7 +142,7 @@ func (p *promptUserDraft) GetFieldByName(fieldName string) (field.OrderExpr, boo } func (p *promptUserDraft) fillFieldMap() { - p.fieldMap = make(map[string]field.Expr, 19) + p.fieldMap = make(map[string]field.Expr, 20) p.fieldMap["id"] = p.ID p.fieldMap["space_id"] = p.SpaceID p.fieldMap["prompt_id"] = p.PromptID @@ -159,6 +162,7 @@ func (p *promptUserDraft) fillFieldMap() { p.fieldMap["updated_at"] = p.UpdatedAt p.fieldMap["deleted_at"] = p.DeletedAt p.fieldMap["has_snippets"] = p.HasSnippets + p.fieldMap["encrypt_messages"] = p.EncryptMessages } func (p promptUserDraft) clone(db *gorm.DB) promptUserDraft { diff --git a/backend/modules/prompt/infra/repo/mysql/hooks/prompt_commit_hook.go b/backend/modules/prompt/infra/repo/mysql/hooks/prompt_commit_hook.go new file mode 100644 index 000000000..31038b93e --- /dev/null +++ b/backend/modules/prompt/infra/repo/mysql/hooks/prompt_commit_hook.go @@ -0,0 +1,26 @@ +package hooks + +import ( + "context" + + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/gorm_gen/model" +) + +type IPromptCommitHook interface { + BeforeSave(context.Context, *model.PromptCommit) error + AfterFind(context.Context, []*model.PromptCommit) error +} + +type EmptyPromptCommitHook struct{} + +func NewEmptyPromptCommitHook() IPromptCommitHook { + return &EmptyPromptCommitHook{} +} + +func (h *EmptyPromptCommitHook) BeforeSave(_ context.Context, _ *model.PromptCommit) error { + return nil +} + +func (h *EmptyPromptCommitHook) AfterFind(_ context.Context, _ []*model.PromptCommit) error { + return nil +} diff --git a/backend/modules/prompt/infra/repo/mysql/hooks/prompt_user_draft_hook.go b/backend/modules/prompt/infra/repo/mysql/hooks/prompt_user_draft_hook.go new file mode 100644 index 000000000..cba896698 --- /dev/null +++ b/backend/modules/prompt/infra/repo/mysql/hooks/prompt_user_draft_hook.go @@ -0,0 +1,26 @@ +package hooks + +import ( + "context" + + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/gorm_gen/model" +) + +type IPromptUserDraftHook interface { + BeforeSave(context.Context, *model.PromptUserDraft) error + AfterFind(context.Context, []*model.PromptUserDraft) error +} + +type EmptyPromptUserDraftHook struct{} + +func NewEmptyPromptUserDraftHook() IPromptUserDraftHook { + return &EmptyPromptUserDraftHook{} +} + +func (h *EmptyPromptUserDraftHook) BeforeSave(_ context.Context, _ *model.PromptUserDraft) error { + return nil +} + +func (h *EmptyPromptUserDraftHook) AfterFind(_ context.Context, _ []*model.PromptUserDraft) error { + return nil +} diff --git a/backend/modules/prompt/infra/repo/mysql/prompt_commit.go b/backend/modules/prompt/infra/repo/mysql/prompt_commit.go index de0ba3b61..cd27de9eb 100644 --- a/backend/modules/prompt/infra/repo/mysql/prompt_commit.go +++ b/backend/modules/prompt/infra/repo/mysql/prompt_commit.go @@ -9,6 +9,7 @@ import ( "fmt" "time" + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/hooks" "gorm.io/gorm" "github.com/coze-dev/coze-loop/backend/infra/db" @@ -41,12 +42,14 @@ type ListCommitParam struct { type PromptCommitDAOImpl struct { db db.Provider writeTracker platestwrite.ILatestWriteTracker + hook hooks.IPromptCommitHook } -func NewPromptCommitDAO(db db.Provider, redisCli redis.Cmdable) IPromptCommitDAO { +func NewPromptCommitDAO(db db.Provider, redisCli redis.Cmdable, hook hooks.IPromptCommitHook) IPromptCommitDAO { return &PromptCommitDAOImpl{ db: db, writeTracker: platestwrite.NewLatestWriteTracker(redisCli), + hook: hook, } } @@ -62,6 +65,9 @@ func (d *PromptCommitDAOImpl) Create(ctx context.Context, promptCommitPO *model. q := query.Use(d.db.NewSession(ctx, opts...)).WithContext(ctx) promptCommitPO.CreatedAt = timeNow promptCommitPO.UpdatedAt = timeNow + if err := d.hook.BeforeSave(ctx, promptCommitPO); err != nil { + return errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } err = q.PromptCommit.Create(promptCommitPO) if err != nil { if errors.Is(err, gorm.ErrDuplicatedKey) { @@ -90,6 +96,9 @@ func (d *PromptCommitDAOImpl) Get(ctx context.Context, promptID int64, commitVer if len(promptCommitPOs) <= 0 { return nil, nil } + if err := d.hook.AfterFind(ctx, promptCommitPOs); err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } return promptCommitPOs[0], nil } @@ -111,6 +120,9 @@ func (d *PromptCommitDAOImpl) MGet(ctx context.Context, pairs []PromptIDCommitVe if len(promptCommitPOs) <= 0 { return nil, nil } + if err := d.hook.AfterFind(ctx, promptCommitPOs); err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } pairCommitPOMap = make(map[PromptIDCommitVersionPair]*model.PromptCommit) for _, po := range promptCommitPOs { pairCommitPOMap[PromptIDCommitVersionPair{ @@ -153,6 +165,9 @@ func (d *PromptCommitDAOImpl) List(ctx context.Context, param ListCommitParam, o if len(commitPOs) <= 0 { return nil, nil } + if err := d.hook.AfterFind(ctx, commitPOs); err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } return commitPOs, nil } @@ -175,6 +190,9 @@ func (d *PromptCommitDAOImpl) MGetVersionsByPromptID(ctx context.Context, prompt if len(commitPOs) == 0 { return nil, nil } + if err := d.hook.AfterFind(ctx, commitPOs); err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } versions = make([]string, 0, len(commitPOs)) for _, po := range commitPOs { if po == nil || po.Version == "" { diff --git a/backend/modules/prompt/infra/repo/mysql/prompt_user_draft.go b/backend/modules/prompt/infra/repo/mysql/prompt_user_draft.go index 9243a9e8f..7fb45049c 100644 --- a/backend/modules/prompt/infra/repo/mysql/prompt_user_draft.go +++ b/backend/modules/prompt/infra/repo/mysql/prompt_user_draft.go @@ -8,6 +8,7 @@ import ( "fmt" "time" + "github.com/coze-dev/coze-loop/backend/modules/prompt/infra/repo/mysql/hooks" "github.com/samber/lo" "github.com/coze-dev/coze-loop/backend/infra/db" @@ -32,12 +33,14 @@ type IPromptUserDraftDAO interface { type PromptUserDraftDAOImpl struct { db db.Provider writeTracker platestwrite.ILatestWriteTracker + hook hooks.IPromptUserDraftHook } -func NewPromptUserDraftDAO(db db.Provider, redisCli redis.Cmdable) IPromptUserDraftDAO { +func NewPromptUserDraftDAO(db db.Provider, redisCli redis.Cmdable, hook hooks.IPromptUserDraftHook) IPromptUserDraftDAO { return &PromptUserDraftDAOImpl{ db: db, writeTracker: platestwrite.NewLatestWriteTracker(redisCli), + hook: hook, } } @@ -55,6 +58,11 @@ func (d *PromptUserDraftDAOImpl) Create(ctx context.Context, promptDraftPO *mode q := query.Use(d.db.NewSession(ctx, opts...)).WithContext(ctx) promptDraftPO.CreatedAt = time.Time{} promptDraftPO.UpdatedAt = time.Time{} + err = d.hook.BeforeSave(ctx, promptDraftPO) + if err != nil { + return errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } + err = q.PromptUserDraft.Create(promptDraftPO) if err != nil { return errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) @@ -80,6 +88,10 @@ func (d *PromptUserDraftDAOImpl) Get(ctx context.Context, promptID int64, userID if len(promptDraftPOs) <= 0 { return nil, nil } + err = d.hook.AfterFind(ctx, promptDraftPOs) + if err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } return promptDraftPOs[0], nil } @@ -97,6 +109,10 @@ func (d *PromptUserDraftDAOImpl) GetByID(ctx context.Context, draftID int64, opt if len(promptDraftPOs) <= 0 { return nil, nil } + err = d.hook.AfterFind(ctx, promptDraftPOs) + if err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } return promptDraftPOs[0], nil } @@ -120,6 +136,10 @@ func (d *PromptUserDraftDAOImpl) MGet(ctx context.Context, pairs []PromptIDUserI if len(promptDraftPOs) <= 0 { return nil, nil } + err = d.hook.AfterFind(ctx, promptDraftPOs) + if err != nil { + return nil, errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } pairDraftPOMap = make(map[PromptIDUserIDPair]*model.PromptUserDraft, len(promptDraftPOs)) for _, promptDraftPO := range promptDraftPOs { if promptDraftPO == nil { @@ -140,21 +160,26 @@ func (d *PromptUserDraftDAOImpl) Update(ctx context.Context, promptDraftPO *mode if promptDraftPO == nil { return errorx.New("promptDraftPO is empty") } + err = d.hook.BeforeSave(ctx, promptDraftPO) + if err != nil { + return errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) + } q := query.Use(d.db.NewSession(ctx, opts...)) _, err = q.PromptUserDraft.WithContext(ctx).Where(q.PromptUserDraft.ID.Eq(promptDraftPO.ID)). Updates(map[string]interface{}{ - q.PromptUserDraft.Messages.ColumnName().String(): promptDraftPO.Messages, - q.PromptUserDraft.ModelConfig.ColumnName().String(): promptDraftPO.ModelConfig, - q.PromptUserDraft.BaseVersion.ColumnName().String(): promptDraftPO.BaseVersion, - q.PromptUserDraft.Tools.ColumnName().String(): promptDraftPO.Tools, - q.PromptUserDraft.ToolCallConfig.ColumnName().String(): promptDraftPO.ToolCallConfig, - q.PromptUserDraft.TemplateType.ColumnName().String(): promptDraftPO.TemplateType, - q.PromptUserDraft.VariableDefs.ColumnName().String(): promptDraftPO.VariableDefs, - q.PromptUserDraft.Metadata.ColumnName().String(): promptDraftPO.Metadata, - q.PromptUserDraft.McpConfig.ColumnName().String(): promptDraftPO.McpConfig, - q.PromptUserDraft.IsDraftEdited.ColumnName().String(): promptDraftPO.IsDraftEdited, - q.PromptUserDraft.HasSnippets.ColumnName().String(): promptDraftPO.HasSnippets, + q.PromptUserDraft.Messages.ColumnName().String(): promptDraftPO.Messages, + q.PromptUserDraft.ModelConfig.ColumnName().String(): promptDraftPO.ModelConfig, + q.PromptUserDraft.BaseVersion.ColumnName().String(): promptDraftPO.BaseVersion, + q.PromptUserDraft.Tools.ColumnName().String(): promptDraftPO.Tools, + q.PromptUserDraft.ToolCallConfig.ColumnName().String(): promptDraftPO.ToolCallConfig, + q.PromptUserDraft.TemplateType.ColumnName().String(): promptDraftPO.TemplateType, + q.PromptUserDraft.VariableDefs.ColumnName().String(): promptDraftPO.VariableDefs, + q.PromptUserDraft.Metadata.ColumnName().String(): promptDraftPO.Metadata, + q.PromptUserDraft.McpConfig.ColumnName().String(): promptDraftPO.McpConfig, + q.PromptUserDraft.IsDraftEdited.ColumnName().String(): promptDraftPO.IsDraftEdited, + q.PromptUserDraft.HasSnippets.ColumnName().String(): promptDraftPO.HasSnippets, + q.PromptUserDraft.EncryptMessages.ColumnName().String(): promptDraftPO.EncryptMessages, }) if err != nil { return errorx.WrapByCode(err, prompterr.CommonMySqlErrorCode) diff --git a/backend/modules/prompt/pkg/consts/auth.go b/backend/modules/prompt/pkg/consts/auth.go index 27a845a31..8dab10862 100644 --- a/backend/modules/prompt/pkg/consts/auth.go +++ b/backend/modules/prompt/pkg/consts/auth.go @@ -8,6 +8,7 @@ const ( ActionLoopPromptEdit = "edit" ActionLoopPromptDebug = "debug" ActionLoopPromptExecute = "execute" + ActionLoopPromptEditSecLevel = "editSecLevel" ActionWorkspaceListLoopPrompt = "listLoopPrompt" ActionWorkspaceCreateLoopPrompt = "createLoopPrompt" ) diff --git a/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift b/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift index b19e453db..5a326f1a3 100644 --- a/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift +++ b/idl/thrift/coze/loop/prompt/coze.loop.prompt.manage.thrift @@ -53,6 +53,7 @@ struct CreatePromptRequest { 12: optional string prompt_key (vt.not_nil="true", vt.min_size="1") 13: optional string prompt_description 14: optional prompt.PromptType prompt_type + 15: optional prompt.SecurityLevel security_level 21: optional prompt.PromptDetail draft_detail @@ -169,6 +170,8 @@ struct UpdatePromptRequest { 11: optional string prompt_name (vt.not_nil="true", vt.min_size="1") 12: optional string prompt_description + 13: optional prompt.SecurityLevel security_level + 14: optional string downgrade_reason 255: optional base.Base Base } diff --git a/idl/thrift/coze/loop/prompt/domain/prompt.thrift b/idl/thrift/coze/loop/prompt/domain/prompt.thrift index e349906a8..d74d3b426 100644 --- a/idl/thrift/coze/loop/prompt/domain/prompt.thrift +++ b/idl/thrift/coze/loop/prompt/domain/prompt.thrift @@ -19,6 +19,7 @@ struct PromptBasic { 7: optional i64 updated_at (api.js_conv="true", go.tag='json:"updated_at"') 8: optional i64 latest_committed_at (api.js_conv="true", go.tag='json:"latest_committed_at"') 9: optional PromptType prompt_type + 10: optional SecurityLevel security_level } @@ -26,6 +27,12 @@ typedef string PromptType (ts.enum="true") const PromptType PromptType_Normal = "normal" const PromptType PromptType_Snippet = "snippet" +typedef string SecurityLevel (ts.enum="true") +const SecurityLevel SecurityLevel_L1 = "L1" +const SecurityLevel SecurityLevel_L2 = "L2" +const SecurityLevel SecurityLevel_L3 = "L3" +const SecurityLevel SecurityLevel_L4 = "L4" + struct PromptCommit { 1: optional PromptDetail detail 2: optional CommitInfo commit_info diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_basic.sql b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_basic.sql index 55a27c93d..fe6e650d3 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_basic.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_basic.sql @@ -14,6 +14,7 @@ CREATE TABLE IF NOT EXISTS `prompt_basic` `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` bigint NOT NULL DEFAULT '0' COMMENT '删除时间', `prompt_type` varchar(64) NOT NULL DEFAULT 'normal' COMMENT 'Prompt类型', + `security_level` varchar(64) NOT NULL DEFAULT 'L3' COMMENT 'security level', PRIMARY KEY (`id`), UNIQUE KEY `uniq_space_id_prompt_key_deleted_at` (`space_id`, `prompt_key`, `deleted_at`), KEY `idx_created_at` (`created_at`) USING BTREE, diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_commit.sql b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_commit.sql index 0ef0feeed..2c0150311 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_commit.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_commit.sql @@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS `prompt_commit` `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段', + `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list', PRIMARY KEY (`id`), UNIQUE KEY `uniq_prompt_id_version` (`prompt_id`, `version`), KEY `idx_prompt_key_version` (`prompt_key`, `version`) USING BTREE diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_user_draft.sql b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_user_draft.sql index a85aeff79..8270ad65f 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_user_draft.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/init-sql/prompt_user_draft.sql @@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS `prompt_user_draft` `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` bigint NOT NULL DEFAULT '0' COMMENT '删除时间', `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段', + `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list', PRIMARY KEY (`id`), UNIQUE KEY `uniq_prompt_id_user_id_deleted_at` (`prompt_id`, `user_id`, `deleted_at`), KEY `idx_prompt_id_user_id` (`prompt_id`, `user_id`) diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_basic_alter.sql b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_basic_alter.sql index a51a2becf..937fa9c76 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_basic_alter.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_basic_alter.sql @@ -1,2 +1,3 @@ ALTER TABLE `prompt_basic` ADD COLUMN `prompt_type` varchar(64) NOT NULL DEFAULT 'normal' COMMENT 'Prompt类型'; -ALTER TABLE `prompt_basic` ADD KEY `idx_pid_ptype_delat` (`space_id`, `prompt_type`, `deleted_at`) USING BTREE; \ No newline at end of file +ALTER TABLE `prompt_basic` ADD KEY `idx_pid_ptype_delat` (`space_id`, `prompt_type`, `deleted_at`) USING BTREE; +ALTER TABLE `prompt_basic` ADD COLUMN `security_level` varchar(64) NOT NULL DEFAULT 'L3' COMMENT 'security level'; \ No newline at end of file diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_commit_alter.sql b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_commit_alter.sql index 924cec27e..d1128d188 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_commit_alter.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_commit_alter.sql @@ -1,4 +1,5 @@ ALTER TABLE `prompt_commit` ADD COLUMN `ext_info` text COLLATE utf8mb4_general_ci COMMENT 'Extended information field'; ALTER TABLE `prompt_commit` ADD COLUMN `metadata` text COLLATE utf8mb4_general_ci COMMENT 'Template metadata field'; ALTER TABLE `prompt_commit` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; -ALTER TABLE `prompt_commit` ADD COLUMN `mcp_config` text COLLATE utf8mb4_general_ci COMMENT 'mcp config info'; \ No newline at end of file +ALTER TABLE `prompt_commit` ADD COLUMN `mcp_config` text COLLATE utf8mb4_general_ci COMMENT 'mcp config info'; +ALTER TABLE `prompt_commit` ADD COLUMN `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list'; diff --git a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_user_draft_alter.sql b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_user_draft_alter.sql index bd897e3c7..969c35bbf 100644 --- a/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_user_draft_alter.sql +++ b/release/deployment/docker-compose/bootstrap/mysql-init/patch-sql/prompt_user_draft_alter.sql @@ -1,4 +1,5 @@ ALTER TABLE `prompt_user_draft` ADD COLUMN `ext_info` text COLLATE utf8mb4_general_ci COMMENT 'Extended information field'; ALTER TABLE `prompt_user_draft` ADD COLUMN `metadata` text COLLATE utf8mb4_general_ci COMMENT 'Template metadata field'; ALTER TABLE `prompt_user_draft` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; -ALTER TABLE `prompt_user_draft` ADD COLUMN `mcp_config` text COLLATE utf8mb4_general_ci COMMENT 'mcp config info'; \ No newline at end of file +ALTER TABLE `prompt_user_draft` ADD COLUMN `mcp_config` text COLLATE utf8mb4_general_ci COMMENT 'mcp config info'; +ALTER TABLE `prompt_user_draft` ADD COLUMN `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list'; diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic.sql index d461043f5..da310fb51 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic.sql @@ -14,6 +14,7 @@ CREATE TABLE IF NOT EXISTS `prompt_basic` `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` bigint NOT NULL DEFAULT '0' COMMENT '删除时间', `prompt_type` varchar(64) NOT NULL DEFAULT 'normal' COMMENT 'Prompt类型', + `security_level` varchar(64) NOT NULL DEFAULT 'L3' COMMENT 'security level', PRIMARY KEY (`id`), UNIQUE KEY `uniq_space_id_prompt_key_deleted_at` (`space_id`, `prompt_key`, `deleted_at`), KEY `idx_created_at` (`created_at`) USING BTREE, diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic_alter.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic_alter.sql index a51a2becf..937fa9c76 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic_alter.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_basic_alter.sql @@ -1,2 +1,3 @@ ALTER TABLE `prompt_basic` ADD COLUMN `prompt_type` varchar(64) NOT NULL DEFAULT 'normal' COMMENT 'Prompt类型'; -ALTER TABLE `prompt_basic` ADD KEY `idx_pid_ptype_delat` (`space_id`, `prompt_type`, `deleted_at`) USING BTREE; \ No newline at end of file +ALTER TABLE `prompt_basic` ADD KEY `idx_pid_ptype_delat` (`space_id`, `prompt_type`, `deleted_at`) USING BTREE; +ALTER TABLE `prompt_basic` ADD COLUMN `security_level` varchar(64) NOT NULL DEFAULT 'L3' COMMENT 'security level'; \ No newline at end of file diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit.sql index bbe022bad..492efbedb 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit.sql @@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS `prompt_commit` `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段', + `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list', PRIMARY KEY (`id`), UNIQUE KEY `uniq_prompt_id_version` (`prompt_id`, `version`), KEY `idx_prompt_key_version` (`prompt_key`, `version`) USING BTREE diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit_alter.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit_alter.sql index d4919bfee..a39593938 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit_alter.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_commit_alter.sql @@ -1,3 +1,4 @@ ALTER TABLE `prompt_commit` ADD COLUMN `ext_info` text COLLATE utf8mb4_general_ci COMMENT 'Extended information field'; ALTER TABLE `prompt_commit` ADD COLUMN `metadata` text COLLATE utf8mb4_general_ci COMMENT 'Template metadata field'; -ALTER TABLE `prompt_commit` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; \ No newline at end of file +ALTER TABLE `prompt_commit` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; +ALTER TABLE `prompt_commit` ADD COLUMN `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list'; \ No newline at end of file diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft.sql index be460369f..fd642119b 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft.sql @@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS `prompt_user_draft` `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` bigint NOT NULL DEFAULT '0' COMMENT '删除时间', `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段', + `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list', PRIMARY KEY (`id`), UNIQUE KEY `uniq_prompt_id_user_id_deleted_at` (`prompt_id`, `user_id`, `deleted_at`), KEY `idx_prompt_id_user_id` (`prompt_id`, `user_id`) diff --git a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft_alter.sql b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft_alter.sql index 8ecb3d12e..9a5ea9e21 100644 --- a/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft_alter.sql +++ b/release/deployment/helm-chart/charts/app/bootstrap/init/mysql/init-sql/prompt_user_draft_alter.sql @@ -1,3 +1,4 @@ ALTER TABLE `prompt_user_draft` ADD COLUMN `ext_info` text COLLATE utf8mb4_general_ci COMMENT 'Extended information field'; ALTER TABLE `prompt_user_draft` ADD COLUMN `metadata` text COLLATE utf8mb4_general_ci COMMENT 'Template metadata field'; -ALTER TABLE `prompt_user_draft` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; \ No newline at end of file +ALTER TABLE `prompt_user_draft` ADD COLUMN `has_snippets` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含prompt片段'; +ALTER TABLE `prompt_user_draft` ADD COLUMN `encrypt_messages` longtext COLLATE utf8mb4_general_ci COMMENT 'encrypt message list'; \ No newline at end of file