From 49c14083287c04aed58cf670e4aa5ab6001861fe Mon Sep 17 00:00:00 2001 From: suifri Date: Mon, 27 Jul 2026 21:48:24 +0300 Subject: [PATCH] [WTEL-5264]feature(skill_preser): add skil preset CRUD APIs --- app/skill_preset_store.go | 37 + controller/skill_preset_store.go | 124 +++ gen/engine/skill_preset.pb.go | 1327 ++++++++++++++++++++++++++ gen/engine/skill_preset_grpc.pb.go | 308 ++++++ grpc_api/api.go | 3 + grpc_api/skill_preset_store.go | 166 ++++ model/skill_preset.go | 175 ++++ store/layered_store.go | 2 + store/sqlstore/skill_preset_store.go | 317 ++++++ store/sqlstore/supplier.go | 4 + store/store.go | 10 + 11 files changed, 2473 insertions(+) create mode 100644 app/skill_preset_store.go create mode 100644 controller/skill_preset_store.go create mode 100644 gen/engine/skill_preset.pb.go create mode 100644 gen/engine/skill_preset_grpc.pb.go create mode 100644 grpc_api/skill_preset_store.go create mode 100644 model/skill_preset.go create mode 100644 store/sqlstore/skill_preset_store.go diff --git a/app/skill_preset_store.go b/app/skill_preset_store.go new file mode 100644 index 00000000..b72d4bec --- /dev/null +++ b/app/skill_preset_store.go @@ -0,0 +1,37 @@ +package app + +import ( + "context" + + "github.com/webitel/engine/model" +) + +func (app *App) CreateSkillPreset(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) { + preset.PreSave() + + return app.Store.SkillPreset().Create(ctx, preset) +} + +func (app *App) GetSkillPreset(ctx context.Context, query *model.GetSkillPresetQuery) (*model.SkillPreset, model.AppError) { + return app.Store.SkillPreset().Get(ctx, query) +} + +func (app *App) SearchSkillPreset(ctx context.Context, query *model.SearchSkillPresetQuery) ([]*model.SkillPreset, model.AppError) { + return app.Store.SkillPreset().Search(ctx, query) +} + +func (app *App) UpdateSkillPreset(ctx context.Context, cmd *model.SkillPreset) (*model.SkillPreset, model.AppError) { + cmd.PreSave() + + return app.Store.SkillPreset().Update(ctx, cmd) +} + +func (app *App) PatchSkillPreset(ctx context.Context, cmd *model.PatchSkillPresetCmd) (*model.SkillPreset, model.AppError) { + cmd.PrePatch() + + return app.Store.SkillPreset().Patch(ctx, cmd) +} + +func (app *App) DeleteSkillPreset(ctx context.Context, cmd *model.DeleteSkillPresetCmd) ([]*model.SkillPreset, model.AppError) { + return app.Store.SkillPreset().Delete(ctx, cmd) +} diff --git a/controller/skill_preset_store.go b/controller/skill_preset_store.go new file mode 100644 index 00000000..fe9e0021 --- /dev/null +++ b/controller/skill_preset_store.go @@ -0,0 +1,124 @@ +package controller + +import ( + "context" + + "github.com/webitel/engine/model" + "github.com/webitel/engine/pkg/wbt/auth_manager" +) + +func (c *Controller) CreateSkillPreset(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanCreate() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_CREATE) + } + + preset.CreatedBy = &model.Lookup{Id: int(session.UserId)} + preset.UpdatedBy = &model.Lookup{Id: int(session.UserId)} + preset.DomainID = session.Domain(0) + + if err := preset.Validate(); err != nil { + return nil, err + } + + return c.app.CreateSkillPreset(ctx, preset) +} + +func (c *Controller) GetSkillPreset(ctx context.Context, query *model.GetSkillPresetQuery) (*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanRead() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_READ) + } + + query.DomainID = session.Domain(0) + + if err := query.Validate(); err != nil { + return nil, err + } + + return c.app.GetSkillPreset(ctx, query) +} + +func (c *Controller) SearchSkillPreset(ctx context.Context, query *model.SearchSkillPresetQuery) ([]*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanRead() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_READ) + } + + query.DomainId = session.Domain(0) + + return c.app.SearchSkillPreset(ctx, query) +} + +func (c *Controller) UpdateSkillPreset(ctx context.Context, cmd *model.SkillPreset) (*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanUpdate() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_UPDATE) + } + + cmd.UpdatedBy = &model.Lookup{Id: int(session.UserId)} + cmd.DomainID = session.Domain(0) + + if err := cmd.Validate(); err != nil { + return nil, err + } + + return c.app.Store.SkillPreset().Update(ctx, cmd) +} + +func (c *Controller) PatchSkillPreset(ctx context.Context, cmd *model.PatchSkillPresetCmd) (*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanUpdate() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_UPDATE) + } + + cmd.UpdatedBy = model.Lookup{Id: int(session.UserId)} + cmd.DomainID = session.Domain(0) + + if err := cmd.Validate(); err != nil { + return nil, err + } + + return c.app.Store.SkillPreset().Patch(ctx, cmd) +} + +func (c *Controller) DeleteSkillPreset(ctx context.Context, cmd *model.DeleteSkillPresetCmd) ([]*model.SkillPreset, model.AppError) { + session, err := c.app.GetSessionFromCtx(ctx) + if err != nil { + return nil, err + } + + permission := session.GetPermission(model.PermissionSkill) + if !permission.CanDelete() { + return nil, c.app.MakePermissionError(session, permission, auth_manager.PERMISSION_ACCESS_DELETE) + } + + cmd.DomainID = session.Domain(0) + + return c.app.DeleteSkillPreset(ctx, cmd) +} diff --git a/gen/engine/skill_preset.pb.go b/gen/engine/skill_preset.pb.go new file mode 100644 index 00000000..d4d8d56b --- /dev/null +++ b/gen/engine/skill_preset.pb.go @@ -0,0 +1,1327 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: skill_preset.proto + +package engine + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SkillPreset represents a reusable collection +// of skills that can be assigned within the Call Center. +type SkillPreset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique preset identifier. + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // User who created the preset. + CreatedBy *Lookup `protobuf:"bytes,2,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` + // Creation timestamp (Unix time, milliseconds). + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + // User who last updated the preset. + UpdatedBy *Lookup `protobuf:"bytes,4,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` + // Last update timestamp (Unix time, milliseconds). + UpdatedAt int64 `protobuf:"varint,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + // Display name of the preset. + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` + // Optional preset description. + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + // Skills included in the preset. + Skills []*Lookup `protobuf:"bytes,8,rep,name=skills,proto3" json:"skills,omitempty"` +} + +func (x *SkillPreset) Reset() { + *x = SkillPreset{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SkillPreset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SkillPreset) ProtoMessage() {} + +func (x *SkillPreset) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SkillPreset.ProtoReflect.Descriptor instead. +func (*SkillPreset) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{0} +} + +func (x *SkillPreset) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SkillPreset) GetCreatedBy() *Lookup { + if x != nil { + return x.CreatedBy + } + return nil +} + +func (x *SkillPreset) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *SkillPreset) GetUpdatedBy() *Lookup { + if x != nil { + return x.UpdatedBy + } + return nil +} + +func (x *SkillPreset) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *SkillPreset) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SkillPreset) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *SkillPreset) GetSkills() []*Lookup { + if x != nil { + return x.Skills + } + return nil +} + +// Request for creating a skill preset. +type CreateSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Display name of the preset. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Optional description. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Skills included in the preset. + Skills []*Lookup `protobuf:"bytes,3,rep,name=skills,proto3" json:"skills,omitempty"` +} + +func (x *CreateSkillPresetRequest) Reset() { + *x = CreateSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSkillPresetRequest) ProtoMessage() {} + +func (x *CreateSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*CreateSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateSkillPresetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateSkillPresetRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateSkillPresetRequest) GetSkills() []*Lookup { + if x != nil { + return x.Skills + } + return nil +} + +// Response containing the created skill preset. +type CreateSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Created skill preset. + Item *SkillPreset `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *CreateSkillPresetResponse) Reset() { + *x = CreateSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSkillPresetResponse) ProtoMessage() {} + +func (x *CreateSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*CreateSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateSkillPresetResponse) GetItem() *SkillPreset { + if x != nil { + return x.Item + } + return nil +} + +// Request for deleting one or more skill presets. +type DeleteSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifiers of skill presets to delete. + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` +} + +func (x *DeleteSkillPresetRequest) Reset() { + *x = DeleteSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSkillPresetRequest) ProtoMessage() {} + +func (x *DeleteSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*DeleteSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteSkillPresetRequest) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +// Response containing deleted skill presets. +type DeleteSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Deleted skill presets. + Items []*SkillPreset `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *DeleteSkillPresetResponse) Reset() { + *x = DeleteSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSkillPresetResponse) ProtoMessage() {} + +func (x *DeleteSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*DeleteSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteSkillPresetResponse) GetItems() []*SkillPreset { + if x != nil { + return x.Items + } + return nil +} + +// Request for replacing a skill preset. +type UpdateSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Skill preset identifier. + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Display name. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Optional description. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Skills assigned to the preset. + Skills []*Lookup `protobuf:"bytes,4,rep,name=skills,proto3" json:"skills,omitempty"` +} + +func (x *UpdateSkillPresetRequest) Reset() { + *x = UpdateSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSkillPresetRequest) ProtoMessage() {} + +func (x *UpdateSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*UpdateSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateSkillPresetRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateSkillPresetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateSkillPresetRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpdateSkillPresetRequest) GetSkills() []*Lookup { + if x != nil { + return x.Skills + } + return nil +} + +// Response containing updated skill preset. +type UpdateSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Updated skill preset. + Item *SkillPreset `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *UpdateSkillPresetResponse) Reset() { + *x = UpdateSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSkillPresetResponse) ProtoMessage() {} + +func (x *UpdateSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*UpdateSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateSkillPresetResponse) GetItem() *SkillPreset { + if x != nil { + return x.Item + } + return nil +} + +// Request for partially updating a skill preset. +type PatchSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of fields to update. + Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` + // Skill preset identifier. + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + // Updated preset name. + Name *string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` + // Updated preset description. + Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` + // Updated list of skills. + Skills []*Lookup `protobuf:"bytes,5,rep,name=skills,proto3" json:"skills,omitempty"` +} + +func (x *PatchSkillPresetRequest) Reset() { + *x = PatchSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchSkillPresetRequest) ProtoMessage() {} + +func (x *PatchSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*PatchSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{7} +} + +func (x *PatchSkillPresetRequest) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +func (x *PatchSkillPresetRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PatchSkillPresetRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *PatchSkillPresetRequest) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *PatchSkillPresetRequest) GetSkills() []*Lookup { + if x != nil { + return x.Skills + } + return nil +} + +// Response containing patched skill preset. +type PatchSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Patched skill preset item. + Item *SkillPreset `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *PatchSkillPresetResponse) Reset() { + *x = PatchSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchSkillPresetResponse) ProtoMessage() {} + +func (x *PatchSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*PatchSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{8} +} + +func (x *PatchSkillPresetResponse) GetItem() *SkillPreset { + if x != nil { + return x.Item + } + return nil +} + +// Search criteria for skill presets. +type SearchSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Page number (1-based). + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + // Maximum number of items per page. + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + // Search pattern applied to preset names. + Q string `protobuf:"bytes,3,opt,name=q,proto3" json:"q,omitempty"` + // Sort expression. + // Example: "-name", "+created_at". + Sort string `protobuf:"bytes,4,opt,name=sort,proto3" json:"sort,omitempty"` + // List of fields to include in the response. + Fields []string `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"` + // Filter by preset identifiers. + Ids []int64 `protobuf:"varint,6,rep,packed,name=ids,proto3" json:"ids,omitempty"` + // Filter by associated skill identifiers. + SkillIds []int64 `protobuf:"varint,7,rep,packed,name=skill_ids,json=skillIds,proto3" json:"skill_ids,omitempty"` + // Skip the default preset in the search results. + SkipDefault bool `protobuf:"varint,8,opt,name=skip_default,json=skipDefault,proto3" json:"skip_default,omitempty"` +} + +func (x *SearchSkillPresetRequest) Reset() { + *x = SearchSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchSkillPresetRequest) ProtoMessage() {} + +func (x *SearchSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*SearchSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{9} +} + +func (x *SearchSkillPresetRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SearchSkillPresetRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *SearchSkillPresetRequest) GetQ() string { + if x != nil { + return x.Q + } + return "" +} + +func (x *SearchSkillPresetRequest) GetSort() string { + if x != nil { + return x.Sort + } + return "" +} + +func (x *SearchSkillPresetRequest) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +func (x *SearchSkillPresetRequest) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +func (x *SearchSkillPresetRequest) GetSkillIds() []int64 { + if x != nil { + return x.SkillIds + } + return nil +} + +func (x *SearchSkillPresetRequest) GetSkipDefault() bool { + if x != nil { + return x.SkipDefault + } + return false +} + +// Search results for skill presets. +type SearchSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Matching skill presets. + Items []*SkillPreset `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + // Indicates whether another page of results exists. + Next bool `protobuf:"varint,2,opt,name=next,proto3" json:"next,omitempty"` +} + +func (x *SearchSkillPresetResponse) Reset() { + *x = SearchSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchSkillPresetResponse) ProtoMessage() {} + +func (x *SearchSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*SearchSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{10} +} + +func (x *SearchSkillPresetResponse) GetItems() []*SkillPreset { + if x != nil { + return x.Items + } + return nil +} + +func (x *SearchSkillPresetResponse) GetNext() bool { + if x != nil { + return x.Next + } + return false +} + +// Request for retrieving a skill preset. +type GetSkillPresetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Skill preset identifier. + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetSkillPresetRequest) Reset() { + *x = GetSkillPresetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSkillPresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSkillPresetRequest) ProtoMessage() {} + +func (x *GetSkillPresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSkillPresetRequest.ProtoReflect.Descriptor instead. +func (*GetSkillPresetRequest) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{11} +} + +func (x *GetSkillPresetRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +// Response containing the requested skill preset. +type GetSkillPresetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested skill preset. + Item *SkillPreset `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *GetSkillPresetResponse) Reset() { + *x = GetSkillPresetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_skill_preset_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSkillPresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSkillPresetResponse) ProtoMessage() {} + +func (x *GetSkillPresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_skill_preset_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSkillPresetResponse.ProtoReflect.Descriptor instead. +func (*GetSkillPresetResponse) Descriptor() ([]byte, []int) { + return file_skill_preset_proto_rawDescGZIP(), []int{12} +} + +func (x *GetSkillPresetResponse) GetItem() *SkillPreset { + if x != nil { + return x.Item + } + return nil +} + +var File_skill_preset_proto protoreflect.FileDescriptor + +var file_skill_preset_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x1a, 0x0b, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, 0x0a, 0x0b, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x6b, 0x69, + 0x6c, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, + 0x73, 0x22, 0x78, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, + 0x6b, 0x75, 0x70, 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x22, 0x44, 0x0a, 0x19, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, + 0x6d, 0x22, 0x2c, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, + 0x46, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, + 0x6c, 0x73, 0x22, 0x44, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x27, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xc2, 0x01, 0x0a, 0x17, 0x50, 0x61, 0x74, + 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x06, + 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, + 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x06, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0e, 0x0a, + 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, + 0x18, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x69, 0x74, 0x65, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x22, 0xce, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x01, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, + 0x69, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x22, 0x5a, 0x0a, 0x19, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x29, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x22, + 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, + 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x32, 0xfd, 0x0a, 0x0a, 0x12, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x82, 0x02, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa7, 0x01, + 0x92, 0x41, 0x7f, 0x0a, 0x0d, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x73, 0x12, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x73, 0x6b, 0x69, + 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x1a, 0x57, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x73, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, + 0x72, 0x65, 0x73, 0x65, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, + 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x63, 0x61, + 0x6c, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, + 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0xd7, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, + 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x01, 0x92, 0x41, 0x5b, 0x0a, + 0x0d, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x12, + 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x1a, 0x36, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x12, 0x1f, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, + 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0xe4, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x89, 0x01, 0x92, + 0x41, 0x64, 0x0a, 0x0d, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x73, 0x12, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, + 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x3d, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x20, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x63, 0x72, 0x69, + 0x74, 0x65, 0x72, 0x69, 0x61, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x63, + 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, + 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0xed, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x20, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6b, + 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x92, 0x01, 0x92, 0x41, 0x65, 0x0a, 0x0d, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x20, 0x61, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x1a, + 0x3d, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x65, 0x64, + 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, + 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x1a, 0x1f, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x63, + 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xe3, 0x01, 0x0a, 0x10, 0x50, 0x61, 0x74, + 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x8b, 0x01, 0x92, 0x41, 0x5e, 0x0a, 0x0d, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x14, 0x50, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61, 0x20, 0x73, + 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x1a, 0x37, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, + 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x32, 0x1f, 0x2f, + 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x6b, 0x69, 0x6c, + 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xca, + 0x01, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, 0x92, 0x41, 0x4b, 0x0a, 0x0d, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x14, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, + 0x65, 0x74, 0x73, 0x1a, 0x24, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, + 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x2a, + 0x1a, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x42, 0x99, 0x01, 0x92, 0x41, + 0x74, 0x12, 0x4a, 0x0a, 0x14, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x41, 0x50, 0x49, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6b, 0x69, 0x6c, + 0x6c, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x43, 0x61, 0x6c, + 0x6c, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, + 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x77, 0x65, 0x62, 0x69, 0x74, 0x65, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_skill_preset_proto_rawDescOnce sync.Once + file_skill_preset_proto_rawDescData = file_skill_preset_proto_rawDesc +) + +func file_skill_preset_proto_rawDescGZIP() []byte { + file_skill_preset_proto_rawDescOnce.Do(func() { + file_skill_preset_proto_rawDescData = protoimpl.X.CompressGZIP(file_skill_preset_proto_rawDescData) + }) + return file_skill_preset_proto_rawDescData +} + +var file_skill_preset_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_skill_preset_proto_goTypes = []interface{}{ + (*SkillPreset)(nil), // 0: engine.SkillPreset + (*CreateSkillPresetRequest)(nil), // 1: engine.CreateSkillPresetRequest + (*CreateSkillPresetResponse)(nil), // 2: engine.CreateSkillPresetResponse + (*DeleteSkillPresetRequest)(nil), // 3: engine.DeleteSkillPresetRequest + (*DeleteSkillPresetResponse)(nil), // 4: engine.DeleteSkillPresetResponse + (*UpdateSkillPresetRequest)(nil), // 5: engine.UpdateSkillPresetRequest + (*UpdateSkillPresetResponse)(nil), // 6: engine.UpdateSkillPresetResponse + (*PatchSkillPresetRequest)(nil), // 7: engine.PatchSkillPresetRequest + (*PatchSkillPresetResponse)(nil), // 8: engine.PatchSkillPresetResponse + (*SearchSkillPresetRequest)(nil), // 9: engine.SearchSkillPresetRequest + (*SearchSkillPresetResponse)(nil), // 10: engine.SearchSkillPresetResponse + (*GetSkillPresetRequest)(nil), // 11: engine.GetSkillPresetRequest + (*GetSkillPresetResponse)(nil), // 12: engine.GetSkillPresetResponse + (*Lookup)(nil), // 13: engine.Lookup +} +var file_skill_preset_proto_depIdxs = []int32{ + 13, // 0: engine.SkillPreset.created_by:type_name -> engine.Lookup + 13, // 1: engine.SkillPreset.updated_by:type_name -> engine.Lookup + 13, // 2: engine.SkillPreset.skills:type_name -> engine.Lookup + 13, // 3: engine.CreateSkillPresetRequest.skills:type_name -> engine.Lookup + 0, // 4: engine.CreateSkillPresetResponse.item:type_name -> engine.SkillPreset + 0, // 5: engine.DeleteSkillPresetResponse.items:type_name -> engine.SkillPreset + 13, // 6: engine.UpdateSkillPresetRequest.skills:type_name -> engine.Lookup + 0, // 7: engine.UpdateSkillPresetResponse.item:type_name -> engine.SkillPreset + 13, // 8: engine.PatchSkillPresetRequest.skills:type_name -> engine.Lookup + 0, // 9: engine.PatchSkillPresetResponse.item:type_name -> engine.SkillPreset + 0, // 10: engine.SearchSkillPresetResponse.items:type_name -> engine.SkillPreset + 0, // 11: engine.GetSkillPresetResponse.item:type_name -> engine.SkillPreset + 1, // 12: engine.SkillPresetService.CreateSkillPreset:input_type -> engine.CreateSkillPresetRequest + 11, // 13: engine.SkillPresetService.GetSkillPreset:input_type -> engine.GetSkillPresetRequest + 9, // 14: engine.SkillPresetService.SearchSkillPreset:input_type -> engine.SearchSkillPresetRequest + 5, // 15: engine.SkillPresetService.UpdateSkillPreset:input_type -> engine.UpdateSkillPresetRequest + 7, // 16: engine.SkillPresetService.PatchSkillPreset:input_type -> engine.PatchSkillPresetRequest + 3, // 17: engine.SkillPresetService.DeleteSkillPreset:input_type -> engine.DeleteSkillPresetRequest + 2, // 18: engine.SkillPresetService.CreateSkillPreset:output_type -> engine.CreateSkillPresetResponse + 12, // 19: engine.SkillPresetService.GetSkillPreset:output_type -> engine.GetSkillPresetResponse + 10, // 20: engine.SkillPresetService.SearchSkillPreset:output_type -> engine.SearchSkillPresetResponse + 6, // 21: engine.SkillPresetService.UpdateSkillPreset:output_type -> engine.UpdateSkillPresetResponse + 8, // 22: engine.SkillPresetService.PatchSkillPreset:output_type -> engine.PatchSkillPresetResponse + 4, // 23: engine.SkillPresetService.DeleteSkillPreset:output_type -> engine.DeleteSkillPresetResponse + 18, // [18:24] is the sub-list for method output_type + 12, // [12:18] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_skill_preset_proto_init() } +func file_skill_preset_proto_init() { + if File_skill_preset_proto != nil { + return + } + file_const_proto_init() + if !protoimpl.UnsafeEnabled { + file_skill_preset_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SkillPreset); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSkillPresetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_skill_preset_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSkillPresetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_skill_preset_proto_msgTypes[7].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_skill_preset_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_skill_preset_proto_goTypes, + DependencyIndexes: file_skill_preset_proto_depIdxs, + MessageInfos: file_skill_preset_proto_msgTypes, + }.Build() + File_skill_preset_proto = out.File + file_skill_preset_proto_rawDesc = nil + file_skill_preset_proto_goTypes = nil + file_skill_preset_proto_depIdxs = nil +} diff --git a/gen/engine/skill_preset_grpc.pb.go b/gen/engine/skill_preset_grpc.pb.go new file mode 100644 index 00000000..23b495a9 --- /dev/null +++ b/gen/engine/skill_preset_grpc.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: skill_preset.proto + +package engine + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + SkillPresetService_CreateSkillPreset_FullMethodName = "/engine.SkillPresetService/CreateSkillPreset" + SkillPresetService_GetSkillPreset_FullMethodName = "/engine.SkillPresetService/GetSkillPreset" + SkillPresetService_SearchSkillPreset_FullMethodName = "/engine.SkillPresetService/SearchSkillPreset" + SkillPresetService_UpdateSkillPreset_FullMethodName = "/engine.SkillPresetService/UpdateSkillPreset" + SkillPresetService_PatchSkillPreset_FullMethodName = "/engine.SkillPresetService/PatchSkillPreset" + SkillPresetService_DeleteSkillPreset_FullMethodName = "/engine.SkillPresetService/DeleteSkillPreset" +) + +// SkillPresetServiceClient is the client API for SkillPresetService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SkillPresetServiceClient interface { + // Created a new skill preset. + CreateSkillPreset(ctx context.Context, in *CreateSkillPresetRequest, opts ...grpc.CallOption) (*CreateSkillPresetResponse, error) + // Retrieves a skill preset by its identifier. + GetSkillPreset(ctx context.Context, in *GetSkillPresetRequest, opts ...grpc.CallOption) (*GetSkillPresetResponse, error) + // Searches skill presets using filtering, + // sorting and pagination options. + SearchSkillPreset(ctx context.Context, in *SearchSkillPresetRequest, opts ...grpc.CallOption) (*SearchSkillPresetResponse, error) + // Replaces an existing skill preset. + UpdateSkillPreset(ctx context.Context, in *UpdateSkillPresetRequest, opts ...grpc.CallOption) (*UpdateSkillPresetResponse, error) + // Updates selected fields of a skill preset. + PatchSkillPreset(ctx context.Context, in *PatchSkillPresetRequest, opts ...grpc.CallOption) (*PatchSkillPresetResponse, error) + // Deletes one or more skill presets. + DeleteSkillPreset(ctx context.Context, in *DeleteSkillPresetRequest, opts ...grpc.CallOption) (*DeleteSkillPresetResponse, error) +} + +type skillPresetServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSkillPresetServiceClient(cc grpc.ClientConnInterface) SkillPresetServiceClient { + return &skillPresetServiceClient{cc} +} + +func (c *skillPresetServiceClient) CreateSkillPreset(ctx context.Context, in *CreateSkillPresetRequest, opts ...grpc.CallOption) (*CreateSkillPresetResponse, error) { + out := new(CreateSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_CreateSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *skillPresetServiceClient) GetSkillPreset(ctx context.Context, in *GetSkillPresetRequest, opts ...grpc.CallOption) (*GetSkillPresetResponse, error) { + out := new(GetSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_GetSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *skillPresetServiceClient) SearchSkillPreset(ctx context.Context, in *SearchSkillPresetRequest, opts ...grpc.CallOption) (*SearchSkillPresetResponse, error) { + out := new(SearchSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_SearchSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *skillPresetServiceClient) UpdateSkillPreset(ctx context.Context, in *UpdateSkillPresetRequest, opts ...grpc.CallOption) (*UpdateSkillPresetResponse, error) { + out := new(UpdateSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_UpdateSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *skillPresetServiceClient) PatchSkillPreset(ctx context.Context, in *PatchSkillPresetRequest, opts ...grpc.CallOption) (*PatchSkillPresetResponse, error) { + out := new(PatchSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_PatchSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *skillPresetServiceClient) DeleteSkillPreset(ctx context.Context, in *DeleteSkillPresetRequest, opts ...grpc.CallOption) (*DeleteSkillPresetResponse, error) { + out := new(DeleteSkillPresetResponse) + err := c.cc.Invoke(ctx, SkillPresetService_DeleteSkillPreset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SkillPresetServiceServer is the server API for SkillPresetService service. +// All implementations must embed UnimplementedSkillPresetServiceServer +// for forward compatibility +type SkillPresetServiceServer interface { + // Created a new skill preset. + CreateSkillPreset(context.Context, *CreateSkillPresetRequest) (*CreateSkillPresetResponse, error) + // Retrieves a skill preset by its identifier. + GetSkillPreset(context.Context, *GetSkillPresetRequest) (*GetSkillPresetResponse, error) + // Searches skill presets using filtering, + // sorting and pagination options. + SearchSkillPreset(context.Context, *SearchSkillPresetRequest) (*SearchSkillPresetResponse, error) + // Replaces an existing skill preset. + UpdateSkillPreset(context.Context, *UpdateSkillPresetRequest) (*UpdateSkillPresetResponse, error) + // Updates selected fields of a skill preset. + PatchSkillPreset(context.Context, *PatchSkillPresetRequest) (*PatchSkillPresetResponse, error) + // Deletes one or more skill presets. + DeleteSkillPreset(context.Context, *DeleteSkillPresetRequest) (*DeleteSkillPresetResponse, error) + mustEmbedUnimplementedSkillPresetServiceServer() +} + +// UnimplementedSkillPresetServiceServer must be embedded to have forward compatible implementations. +type UnimplementedSkillPresetServiceServer struct { +} + +func (UnimplementedSkillPresetServiceServer) CreateSkillPreset(context.Context, *CreateSkillPresetRequest) (*CreateSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) GetSkillPreset(context.Context, *GetSkillPresetRequest) (*GetSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) SearchSkillPreset(context.Context, *SearchSkillPresetRequest) (*SearchSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) UpdateSkillPreset(context.Context, *UpdateSkillPresetRequest) (*UpdateSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) PatchSkillPreset(context.Context, *PatchSkillPresetRequest) (*PatchSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PatchSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) DeleteSkillPreset(context.Context, *DeleteSkillPresetRequest) (*DeleteSkillPresetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteSkillPreset not implemented") +} +func (UnimplementedSkillPresetServiceServer) mustEmbedUnimplementedSkillPresetServiceServer() {} + +// UnsafeSkillPresetServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SkillPresetServiceServer will +// result in compilation errors. +type UnsafeSkillPresetServiceServer interface { + mustEmbedUnimplementedSkillPresetServiceServer() +} + +func RegisterSkillPresetServiceServer(s grpc.ServiceRegistrar, srv SkillPresetServiceServer) { + s.RegisterService(&SkillPresetService_ServiceDesc, srv) +} + +func _SkillPresetService_CreateSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).CreateSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_CreateSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).CreateSkillPreset(ctx, req.(*CreateSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SkillPresetService_GetSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).GetSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_GetSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).GetSkillPreset(ctx, req.(*GetSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SkillPresetService_SearchSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).SearchSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_SearchSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).SearchSkillPreset(ctx, req.(*SearchSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SkillPresetService_UpdateSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).UpdateSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_UpdateSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).UpdateSkillPreset(ctx, req.(*UpdateSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SkillPresetService_PatchSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PatchSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).PatchSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_PatchSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).PatchSkillPreset(ctx, req.(*PatchSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SkillPresetService_DeleteSkillPreset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSkillPresetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SkillPresetServiceServer).DeleteSkillPreset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SkillPresetService_DeleteSkillPreset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SkillPresetServiceServer).DeleteSkillPreset(ctx, req.(*DeleteSkillPresetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SkillPresetService_ServiceDesc is the grpc.ServiceDesc for SkillPresetService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SkillPresetService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "engine.SkillPresetService", + HandlerType: (*SkillPresetServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSkillPreset", + Handler: _SkillPresetService_CreateSkillPreset_Handler, + }, + { + MethodName: "GetSkillPreset", + Handler: _SkillPresetService_GetSkillPreset_Handler, + }, + { + MethodName: "SearchSkillPreset", + Handler: _SkillPresetService_SearchSkillPreset_Handler, + }, + { + MethodName: "UpdateSkillPreset", + Handler: _SkillPresetService_UpdateSkillPreset_Handler, + }, + { + MethodName: "PatchSkillPreset", + Handler: _SkillPresetService_PatchSkillPreset_Handler, + }, + { + MethodName: "DeleteSkillPreset", + Handler: _SkillPresetService_DeleteSkillPreset_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "skill_preset.proto", +} diff --git a/grpc_api/api.go b/grpc_api/api.go index 84e9befe..c0704c76 100644 --- a/grpc_api/api.go +++ b/grpc_api/api.go @@ -51,6 +51,7 @@ type API struct { schemaVariable *schemaVariable push *push feedback *feedback + skillPreset *skillPreset } func Init(a *app.App, server *grpc.Server) { @@ -98,6 +99,7 @@ func Init(a *app.App, server *grpc.Server) { api.webHook = NewWebHookApi(api) api.push = NewPushApi(api, a.Config().MinimumNumberMaskLen, a.Config().PrefixNumberMaskLen, a.Config().SuffixNumberMaskLen) api.feedback = NewFeedbackApi(api) + api.skillPreset = NewSkillPresetApi(api) engine.RegisterCalendarServiceServer(server, api.calendar) engine.RegisterSkillServiceServer(server, api.skill) @@ -140,4 +142,5 @@ func Init(a *app.App, server *grpc.Server) { engine.RegisterSchemaVariablesServiceServer(server, api.schemaVariable) engine.RegisterPushServiceServer(server, api.push) engine.RegisterFeedbackServiceServer(server, api.feedback) + engine.RegisterSkillPresetServiceServer(server, api.skillPreset) } diff --git a/grpc_api/skill_preset_store.go b/grpc_api/skill_preset_store.go new file mode 100644 index 00000000..30456721 --- /dev/null +++ b/grpc_api/skill_preset_store.go @@ -0,0 +1,166 @@ +package grpc_api + +import ( + "context" + "strings" + + "github.com/webitel/engine/gen/engine" + "github.com/webitel/engine/model" +) + +type skillPreset struct { + *API + + engine.UnimplementedSkillPresetServiceServer +} + +func NewSkillPresetApi(api *API) *skillPreset { return &skillPreset{API: api} } + +func (api *skillPreset) CreateSkillPreset(ctx context.Context, in *engine.CreateSkillPresetRequest) (*engine.CreateSkillPresetResponse, error) { + skillPreset := model.SkillPreset{ + Name: in.GetName(), + Skills: make([]*model.Lookup, 0, len(in.GetSkills())), + } + + if strings.TrimSpace(in.GetDescription()) != "" { + skillPreset.Description = model.NewString(in.GetDescription()) + } + + for _, skill := range in.GetSkills() { + skillPreset.Skills = append(skillPreset.Skills, &model.Lookup{Id: int(skill.GetId())}) + } + + response, err := api.ctrl.CreateSkillPreset(ctx, &skillPreset) + if err != nil { + return nil, err + } + + return &engine.CreateSkillPresetResponse{Item: mapSkillPresetToProto(response)}, nil +} + +func (api *skillPreset) DeleteSkillPreset(ctx context.Context, in *engine.DeleteSkillPresetRequest) (*engine.DeleteSkillPresetResponse, error) { + deleteCmd := &model.DeleteSkillPresetCmd{ + IDs: in.GetIds(), + } + + result, err := api.ctrl.DeleteSkillPreset(ctx, deleteCmd) + if err != nil { + return nil, err + } + + return &engine.DeleteSkillPresetResponse{Items: mapSkillPresetsToProto(result)}, nil +} + +func (api *skillPreset) GetSkillPreset(ctx context.Context, in *engine.GetSkillPresetRequest) (*engine.GetSkillPresetResponse, error) { + query := &model.GetSkillPresetQuery{ + ID: in.GetId(), + } + + response, err := api.ctrl.GetSkillPreset(ctx, query) + if err != nil { + return nil, err + } + + return &engine.GetSkillPresetResponse{Item: mapSkillPresetToProto(response)}, nil +} + +func (api *skillPreset) PatchSkillPreset(ctx context.Context, in *engine.PatchSkillPresetRequest) (*engine.PatchSkillPresetResponse, error) { + patch := &model.PatchSkillPresetCmd{ + Fields: in.GetFields(), + ID: in.GetId(), + } + + for _, field := range in.GetFields() { + switch field { + case "name": + patch.Name = in.Name + case "description": + patch.Description = in.Description + case "skills": + patch.Skills = make([]*model.Lookup, 0, len(in.GetSkills())) + for _, skill := range in.GetSkills() { + patch.Skills = append(patch.Skills, &model.Lookup{Id: int(skill.GetId())}) + } + } + } + + result, err := api.ctrl.PatchSkillPreset(ctx, patch) + if err != nil { + return nil, err + } + + return &engine.PatchSkillPresetResponse{Item: mapSkillPresetToProto(result)}, nil +} + +func (api *skillPreset) SearchSkillPreset(ctx context.Context, in *engine.SearchSkillPresetRequest) (*engine.SearchSkillPresetResponse, error) { + query := &model.SearchSkillPresetQuery{ + ListRequest: model.ListRequest{ + Q: in.GetQ(), + Page: int(in.GetPage()), + PerPage: int(in.GetSize()), + Fields: in.GetFields(), + Sort: in.GetSort(), + }, + IDs: in.GetIds(), + SkillIDs: in.GetSkillIds(), + SkipDefault: in.GetSkipDefault(), + } + + response, err := api.ctrl.SearchSkillPreset(ctx, query) + if err != nil { + return nil, err + } + query.RemoveLastElemIfNeed(&response) + + return &engine.SearchSkillPresetResponse{ + Items: mapSkillPresetsToProto(response), + Next: !query.EndOfList(), + }, nil +} + +func (api *skillPreset) UpdateSkillPreset(ctx context.Context, in *engine.UpdateSkillPresetRequest) (*engine.UpdateSkillPresetResponse, error) { + updateCmd := model.SkillPreset{ + ID: in.GetId(), + Name: in.GetName(), + Description: model.NewString(in.GetDescription()), + Skills: make([]*model.Lookup, 0, len(in.GetSkills())), + } + + for _, skill := range in.GetSkills() { + updateCmd.Skills = append(updateCmd.Skills, &model.Lookup{Id: int(skill.GetId())}) + } + + response, err := api.ctrl.UpdateSkillPreset(ctx, &updateCmd) + if err != nil { + return nil, err + } + + return &engine.UpdateSkillPresetResponse{Item: mapSkillPresetToProto(response)}, nil +} + +func mapSkillPresetsToProto(in []*model.SkillPreset) []*engine.SkillPreset { + response := make([]*engine.SkillPreset, 0, len(in)) + + for _, skill := range in { + response = append(response, mapSkillPresetToProto(skill)) + } + + return response +} + +func mapSkillPresetToProto(in *model.SkillPreset) *engine.SkillPreset { + if in == nil { + return nil //nolint:nilnil + } + + return &engine.SkillPreset{ + Id: in.ID, + CreatedBy: GetProtoLookup(in.CreatedBy), + CreatedAt: in.CreatedAtUnix(), + UpdatedBy: GetProtoLookup(in.UpdatedBy), + UpdatedAt: in.UpdatedAtUnix(), + Name: in.Name, + Description: in.GetDescription(), + Skills: GetProtoLookups(in.Skills), + } +} diff --git a/model/skill_preset.go b/model/skill_preset.go new file mode 100644 index 00000000..2a56b8aa --- /dev/null +++ b/model/skill_preset.go @@ -0,0 +1,175 @@ +package model + +import ( + "cmp" + "strings" + "time" +) + +const StandartSkillPreset string = "Standart Online" + +var StandartSkillPresetValue = &SkillPreset{ + Name: StandartSkillPreset, +} + +type SkillPreset struct { + ID int64 `json:"id" db:"id"` + DomainID int64 `json:"domain_id" db:"domain_id"` + CreatedBy *Lookup `json:"created_by" db:"created_by"` + CreatedAt time.Time `json:"created_at" db:"created_at"` + UpdatedBy *Lookup `json:"updated_by" db:"updated_by"` + UpdatedAt time.Time `json:"updated_at" db:"updated_at"` + Name string `json:"name" db:"name"` + Description *string `json:"description" db:"description"` + + Skills []*Lookup `json:"skills" db:"skills"` +} + +func (s *SkillPreset) GetDescription() string { + return *(cmp.Or(s.Description, new(string))) +} + +func (s *SkillPreset) UpdatedAtUnix() int64 { + if s == nil { + return 0 + } + + return max(s.UpdatedAt.UTC().UnixMilli(), 0) +} + +func (s *SkillPreset) CreatedAtUnix() int64 { + if s == nil { + return 0 + } + + return max(s.CreatedAt.UTC().UnixMilli(), 0) +} + +func (s *SkillPreset) ReduceSkillsIDs() []int64 { + skillIDs := make([]int64, 0, len(s.Skills)) + + for _, s := range s.Skills { + skillIDs = append(skillIDs, int64(s.Id)) + } + + return skillIDs +} + +func (s SkillPreset) AllowFields() []string { + return []string{"id", "name", "description", "created_by", "created_at", "updated_by", "updated_at", "skills"} +} + +func (s SkillPreset) DefaultFields() []string { + return []string{"id", "name"} +} +func (s SkillPreset) EntityName() string { return "cc_skill_preset_view" } +func (s SkillPreset) DefaultOrder() string { return "+name" } + +func (s *SkillPreset) Validate() AppError { + if s == nil { + return NewBadRequestError("model.skill_preset.validate.nil_pointer_receiver", "Received empty skill preset call") + } + + trimmedName := strings.TrimSpace(s.Name) + + if trimmedName == "" { + return NewBadRequestError("model.skill_preset.validate.empty_name", "Name cannot be empty or contain only whitespaces") + } + + if strings.EqualFold(trimmedName, StandartSkillPreset) { + return NewBadRequestError("model.skill_preset.validate.reserved_name", `Name "Standart Online" is reserved`) + } + + return nil +} + +func (s *SkillPreset) PreSave() { + s.Name = strings.TrimSpace(s.Name) +} + +type DeleteSkillPresetCmd struct { + IDs []int64 + DomainID int64 +} + +type GetSkillPresetQuery struct { + ID int64 + DomainID int64 +} + +func (q *GetSkillPresetQuery) Validate() AppError { + if q == nil { + return NewBadRequestError("model.skill_preset.validate.empty_get_skill_preset_query", "Received empty get skill preset parameters") + } + + if q.ID <= 0 { + return NewBadRequestError("model.skill_preset.validate.id_required", "Skill preset ID is required during get request") + } + + if q.DomainID <= 0 { + return NewBadRequestError("model.skill_preset.validate.domain_id_required", "Skill preset Domain ID is required during get request") + } + return nil +} + +type SearchSkillPresetQuery struct { + ListRequest + + IDs []int64 + SkillIDs []int64 + SkipDefault bool +} + +func (s *SearchSkillPresetQuery) OrderBy() string { + if s.Sort == "" { + return "is_system desc, name asc" + } + + return s.Sort +} + +type PatchSkillPresetCmd struct { + Fields []string + DomainID int64 + ID int64 + Name *string + Description *string + Skills []*Lookup + UpdatedBy Lookup +} + +func (p *PatchSkillPresetCmd) ReduceSkillsIDs() []int64 { + ids := make([]int64, 0, len(p.Skills)) + + for _, s := range p.Skills { + if s != nil { + ids = append(ids, int64(s.Id)) + } + } + + return ids +} + +func (p *PatchSkillPresetCmd) Validate() AppError { + if p == nil { + return NewBadRequestError("model.skill_preset.validate.nil_pointer_patch", "Received empty patch skill preset request") + } + + if name := p.Name; name != nil { + trimmedName := strings.TrimSpace(*name) + + if trimmedName == "" { + return NewBadRequestError("model.skill_preset.validate.patch_empty_name", "Name field cannot be empty string") + } + + if strings.EqualFold(trimmedName, StandartSkillPreset) { + return NewBadRequestError("model.skill_preset.validate.patch_reserved_name", `Name "Standart Online" is reserved`) + } + } + + return nil +} + +func (p *PatchSkillPresetCmd) PrePatch() { + *p.Name = strings.TrimSpace(*p.Name) +} diff --git a/store/layered_store.go b/store/layered_store.go index 828e7afe..7426347a 100644 --- a/store/layered_store.go +++ b/store/layered_store.go @@ -121,6 +121,8 @@ func (s *LayeredStore) CommunicationType() CommunicationTypeStore { return s.DatabaseLayer.CommunicationType() } +func (s *LayeredStore) SkillPreset() SkillPresetStore { return s.DatabaseLayer.SkillPreset() } + func (s *LayeredStore) Member() MemberStore { return s.DatabaseLayer.Member() } diff --git a/store/sqlstore/skill_preset_store.go b/store/sqlstore/skill_preset_store.go new file mode 100644 index 00000000..b523ddf1 --- /dev/null +++ b/store/sqlstore/skill_preset_store.go @@ -0,0 +1,317 @@ +package sqlstore + +import ( + "context" + + "github.com/lib/pq" + "github.com/webitel/engine/model" +) + +type SqlSkillPresetStore struct { + SqlStore +} + +func NewSqlSkillPresetStore(sqlStore SqlStore) *SqlSkillPresetStore { + return &SqlSkillPresetStore{SqlStore: sqlStore} +} + +func (s *SqlSkillPresetStore) Create(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) { + query := ` + with preset_ins as ( + insert into "call_center"."skill_preset" ( + "domain_id", "created_by", "created_at", "updated_by", "updated_at", "name", "description" + ) + values ( + :DomainID, :CreatedBy, now(), :UpdatedBy, now(), :Name, :Description + ) + returning "id","domain_id", "name", "created_by", "created_at", "updated_by", "updated_at", "description" + ), + skills_in_preset_ins as ( + insert into "call_center"."skills_in_skill_preset" ( + "domain_id", "skill_preset_id", "skill_id" + ) + select + :DomainID, + p.id, + s.id + from unnest(:Skills::int8[]) s(id) + cross join preset_ins p + returning "skill_preset_id", "skill_id" + ) + select + p.id as id, + p.domain_id as domain_id, + call_center.cc_get_lookup(uc.id, uc.name) as created_by, + p.created_at as created_at, + call_center.cc_get_lookup(ua.id, ua.name) as updated_by, + p.updated_at as updated_at, + p.name as "name", + p.description as "description", + s.skills as "skills" + from preset_ins p + left join lateral ( + select jsonb_agg( + call_center.cc_get_lookup(s.id, s.name) + ) as skills + from skills_in_preset_ins si + inner join call_center.cc_skill s on s.id = si.skill_id + ) s on true + left join directory.wbt_user uc on uc.id = p.created_by + left join directory.wbt_user ua on ua.id = p.updated_by + ` + + args := map[string]any{ + "DomainID": preset.DomainID, + "CreatedBy": preset.CreatedBy.GetSafeId(), + "UpdatedBy": preset.UpdatedBy.GetSafeId(), + "Name": preset.Name, + "Description": preset.Description, + "Skills": pq.Int64Array(preset.ReduceSkillsIDs()), + } + + var result *model.SkillPreset + if err := s.GetMaster().WithContext(ctx).SelectOne(&result, query, args); err != nil { + if e, ok := err.(*pq.Error); ok { + if e.Code == DuplicationViolationErrorCode { + return nil, model.NewBadRequestError("sqlstore.skill_preset_store.create_already_exists", " Skill preset with this name already exists.") + } + } + + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.create", err.Error(), extractCodeFromErr(err)) + } + + return result, nil +} + +func (s *SqlSkillPresetStore) Update(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) { + query := ` + with preset_upd as ( + update "call_center"."skill_preset" + set "updated_by" = :UpdatedBy, + "updated_at" = now(), + "name" = :Name, + "description" = :Description + where "id" = :ID and "domain_id" = :DomainID + returning "id", "domain_id", "created_by", "created_at", "updated_by", "updated_at", "name", "description" + ), + binded_skills_del as ( + delete from "call_center"."skills_in_skill_preset" + where "skill_preset_id" = :ID + and "skill_id" <> all(:Skills::int8[]) + ), + new_skills_ins as ( + insert into "call_center"."skills_in_skill_preset" ( + "domain_id", "skill_preset_id", "skill_id" + ) + select + p.domain_id, + p.id, + s.id + from unnest(:Skills::int8[]) as s(id) + cross join preset_upd p + on conflict ("skill_preset_id", "skill_id") do nothing + returning "skill_id" + ), + actual_skills as ( + select skill_id + from new_skills_ins + union + select skill_id + from "call_center"."skills_in_skill_preset" + where skill_preset_id = :ID + and skill_id = any(:Skills::int8[]) + ) + select + p.id as id, + p.domain_id as domain_id, + call_center.cc_get_lookup(uc.id, uc.name) as created_by, + p.created_at as created_at, + call_center.cc_get_lookup(ua.id, ua.name) as updated_by, + p.updated_at as updated_at, + p.name as "name", + p.description as "description", + coalesce(s.skills, '[]'::jsonb) as "skills" + from preset_upd p + left join lateral ( + select jsonb_agg( + call_center.cc_get_lookup(s.id, s.name) + ) as skills + from actual_skills ask + inner join "call_center"."cc_skill" s on s.id = ask.skill_id + ) s on true + left join directory.wbt_user uc on uc.id = p.created_by + left join directory.wbt_user ua on ua.id = p.updated_by + ` + args := map[string]any{ + "ID": preset.ID, + "DomainID": preset.DomainID, + "UpdatedBy": preset.UpdatedBy.GetSafeId(), + "Name": preset.Name, + "Description": preset.Description, + "Skills": pq.Int64Array(preset.ReduceSkillsIDs()), + } + + var result *model.SkillPreset + if err := s.GetMaster().WithContext(ctx).SelectOne(&result, query, args); err != nil { + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.update", err.Error(), extractCodeFromErr(err)) + } + + return result, nil +} + +func (s *SqlSkillPresetStore) Patch(ctx context.Context, patchCmd *model.PatchSkillPresetCmd) (*model.SkillPreset, model.AppError) { + query := ` + select * from call_center.cc_patch_skill_preset( + :ID, + :DomainID, + :UpdatedBy, + :Name, + :Description, + :PatchDescription, + :Skills::int8[], + :PatchSkills + ) + ` + + args := map[string]any{ + "ID": patchCmd.ID, + "DomainID": patchCmd.DomainID, + "UpdatedBy": patchCmd.UpdatedBy.GetSafeId(), + "Name": nil, + "Description": nil, + "PatchDescription": false, + "Skills": pq.Int64Array([]int64{}), + "PatchSkills": false, + } + + for _, field := range patchCmd.Fields { + switch field { + case "name": + args["Name"] = patchCmd.Name + case "description": + args["Description"] = patchCmd.Description + args["PatchDescription"] = true + case "skills": + args["Skills"] = pq.Int64Array(patchCmd.ReduceSkillsIDs()) + args["PatchSkills"] = true + } + } + + var result model.SkillPreset + if err := s.GetMaster().WithContext(ctx).SelectOne(&result, query, args); err != nil { + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.patch", err.Error(), extractCodeFromErr(err)) + } + + return &result, nil +} + +func (s *SqlSkillPresetStore) Delete(ctx context.Context, deleteCmd *model.DeleteSkillPresetCmd) ([]*model.SkillPreset, model.AppError) { + query := ` + with preset_del as ( + delete from "call_center"."skill_preset" + where "domain_id" = :DomainID and "id" = any(:IDs) + returning "id", "domain_id", "created_by", "created_at", "updated_by", "updated_at", "name", "description" + ), + skills_del as ( + delete from "call_center"."skills_in_skill_preset" + where "skill_preset_id" in (select id from preset_del) + returning "skill_preset_id", "skill_id" + ) + select + p.id as id, + p.domain_id as domain_id, + call_center.cc_get_lookup(uc.id, uc.name) as created_by, + p.created_at as created_at, + call_center.cc_get_lookup(ua.id, ua.name) as updated_by, + p.updated_at as updated_at, + p.name as "name", + p.description as "description", + s.skills as "skills" + from preset_del p + left join lateral ( + select jsonb_agg( + call_center.cc_get_lookup(s.id, s.name) + ) as skills + from skills_del sd + inner join "call_center"."cc_skill" s on s.id = sd.skill_id + where sd.skill_preset_id = p.id + ) s on true + left join directory.wbt_user uc on uc.id = p.created_by + left join directory.wbt_user ua on ua.id = p.updated_by + ` + + args := map[string]any{ + "DomainID": deleteCmd.DomainID, + "IDs": pq.Int64Array(deleteCmd.IDs), + } + + var result []*model.SkillPreset + if _, err := s.GetMaster().WithContext(ctx).Select(&result, query, args); err != nil { + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.delete", err.Error(), extractCodeFromErr(err)) + } + + return result, nil +} + +func (s *SqlSkillPresetStore) Search(ctx context.Context, search *model.SearchSkillPresetQuery) ([]*model.SkillPreset, model.AppError) { + query := ` + "domain_id" = :DomainID + and (:IDs::int[] is null or "id" = any(:IDs::int[])) + and ( + cardinality(:SkillIDs::int8[]) = 0 or :SkillIDs::int8[] is null + or exists ( + select 1 + from "call_center"."skills_in_skill_preset" si + where si.skill_preset_id = id + and si.skill_id = any(:SkillIDs::int8[]) + ) + ) + and (:Q::text is null or "name" ilike :Q::text) + and (:SkipDefault is false or "is_system" is false) + ` + args := map[string]any{ + "DomainID": search.DomainId, + "IDs": pq.Int64Array(search.IDs), + "SkillIDs": pq.Int64Array(search.SkillIDs), + "Q": search.GetQ(), + "SkipDefault": search.SkipDefault, + } + + search.Sort = search.OrderBy() + + var result []*model.SkillPreset + if err := s.ListQuery(ctx, &result, search.ListRequest, query, model.SkillPreset{}, args); err != nil { + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.search", err.Error(), extractCodeFromErr(err)) + } + + return result, nil +} + +func (s *SqlSkillPresetStore) Get(ctx context.Context, search *model.GetSkillPresetQuery) (*model.SkillPreset, model.AppError) { + query := ` + select + id, + domain_id, + created_by, + created_at, + updated_by, + updated_at, + name, + description, + skills + from "call_center"."cc_skill_preset_view" + where "domain_id" = :DomainID and "id" = :ID + ` + + args := map[string]any{ + "DomainID": search.DomainID, + "ID": search.ID, + } + + var result *model.SkillPreset + if err := s.GetReplica().WithContext(ctx).SelectOne(&result, query, args); err != nil { + return nil, model.NewCustomCodeError("sqlstore.skill_preset_store.get", err.Error(), extractCodeFromErr(err)) + } + + return result, nil +} diff --git a/store/sqlstore/supplier.go b/store/sqlstore/supplier.go index 37aa5175..1a33f095 100644 --- a/store/sqlstore/supplier.go +++ b/store/sqlstore/supplier.go @@ -76,6 +76,7 @@ type SqlSupplierOldStores struct { schemeVariable store.SchemeVariablesStore socketSession store.SocketSessionStore feedback store.FeedbackStore + skillPreset store.SkillPresetStore } type SqlSupplier struct { @@ -145,6 +146,7 @@ func NewSqlSupplier(settings model.SqlSettings) *SqlSupplier { supplier.oldStores.chat = NewSqlChatStore(supplier) supplier.oldStores.chatPlan = NewSqlChatPlanStore(supplier) supplier.oldStores.feedback = NewSqlFeedbackStore(supplier) + supplier.oldStores.skillPreset = NewSqlSkillPresetStore(supplier) err := supplier.GetMaster().CreateTablesIfNotExists() if err != nil { @@ -453,6 +455,8 @@ func (ss *SqlSupplier) Feedback() store.FeedbackStore { return ss.oldStores.feedback } +func (ss *SqlSupplier) SkillPreset() store.SkillPresetStore { return ss.oldStores.skillPreset } + type typeConverter struct{} func (me typeConverter) ToDb(val any) (any, error) { diff --git a/store/store.go b/store/store.go index c33463eb..34de8fe1 100644 --- a/store/store.go +++ b/store/store.go @@ -80,6 +80,7 @@ type Store interface { SchemeVariable() SchemeVariablesStore SocketSession() SocketSessionStore Feedback() FeedbackStore + SkillPreset() SkillPresetStore } // todo deprecated @@ -551,6 +552,15 @@ type FeedbackStore interface { Create(ctx context.Context, key model.FeedbackKey, rating float32, description string) (model.Feedback, model.AppError) } +type SkillPresetStore interface { + Create(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) + Update(ctx context.Context, preset *model.SkillPreset) (*model.SkillPreset, model.AppError) + Patch(ctx context.Context, patchCmd *model.PatchSkillPresetCmd) (*model.SkillPreset, model.AppError) + Delete(ctx context.Context, deleteCmd *model.DeleteSkillPresetCmd) ([]*model.SkillPreset, model.AppError) + Search(ctx context.Context, search *model.SearchSkillPresetQuery) ([]*model.SkillPreset, model.AppError) + Get(ctx context.Context, search *model.GetSkillPresetQuery) (*model.SkillPreset, model.AppError) +} + // ApplyFiltersToBuilder determines type of {filters} parameter and applies {filters} to the {base} according to the determined type. // columnAlias is additional parameter applied to every model.Filter existing in {filters} and checks if {model.Filter.Column} has alias in the {columnAlias} func ApplyFiltersToBuilderBulk(base any, columnAlias map[string]string, filters any) (any, model.AppError) {