From 66df21c6c9f43dbcf5ed03be2bfcfee7cb92988c Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Thu, 21 Nov 2024 02:10:29 +0700 Subject: [PATCH] update api --- api/smm_core.proto | 188 +++- proto/smm_core.pb.go | 1597 +++++++++++++++++++++++++++---- proto/smm_core.pb.gw.go | 1170 +++++++++++++++++++++- proto/smm_core_grpc.pb.go | 512 +++++++++- resources/smm_core.swagger.json | 579 ++++++++++- 5 files changed, 3772 insertions(+), 274 deletions(-) diff --git a/api/smm_core.proto b/api/smm_core.proto index 81295dd..40f641a 100644 --- a/api/smm_core.proto +++ b/api/smm_core.proto @@ -10,6 +10,8 @@ option go_package = "pkg/proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {}; service SmmCore { + + // ping rpc Ping(PingReq) returns (PingRsp) { option (google.api.http) = { get: "/ping" @@ -17,15 +19,62 @@ service SmmCore { } // users - rpc AddUser(CreateUserReq) returns (User) { + rpc AddUser(AddUserReq) returns (User) { option (google.api.http) = { post: "/users", body: "*" }; } + rpc Login(LoginReq) returns (User) { + option (google.api.http) = { + post: "/login", + body: "*" + }; + } + + // budgets + rpc AddBudget(AddBudgetReq) returns (Budget) { + option (google.api.http) = { + post: "/budgets", + body: "*" + }; + } + rpc UpdateBudget(UpdateBudgetReq) returns (Budget) { + option (google.api.http) = { + put: "/budgets/{id}", + body: "*" + }; + } + rpc GetBudgets(GetBudgetsReq) returns (Budgets) { + option (google.api.http) = { + get: "/budgets" + }; + } + rpc DeleteBudget(DeleteBudgetReq) returns (Budget) { + option (google.api.http) = { + delete: "/budgets/{id}" + }; + } + + // budget users + rpc AddUserToBudget(AddUserToBudgetReq) returns (Budget) { + option (google.api.http) = { + put: "/budgets/{budget_id}/users" + }; + } + rpc GetBudgetUsers(GetBudgetUsersReq) returns (Users) { + option (google.api.http) = { + get: "/budgets/{id}/users" + }; + } + rpc RemoveUserFromBudget(RemoveUserFromBudgetReq) returns (Budget) { + option (google.api.http) = { + delete: "/budgets/{budget_id}/users/{user_id}" + }; + } // categories - rpc AddCategory(CreateCategoryReq) returns (Category) { + rpc AddCategory(AddCategoryReq) returns (Category) { option (google.api.http) = { post: "/categories", body: "*" @@ -36,51 +85,168 @@ service SmmCore { put: "/categories/{id}" }; } - rpc GetCategories(CategoryFilterReq) returns (Categories) { + rpc GetCategories(GetCategoriesReq) returns (Categories) { option (google.api.http) = { get: "/categories" }; } + rpc DeleteCategories(DeleteCategoriesReq) returns (Category) { + option (google.api.http) = { + delete: "/categories/{id}" + }; + } + + // positions + rpc AddPosition(AddPositionReq) returns (Position) { + option (google.api.http) = { + post: "/positions", + body: "*" + }; + } + rpc DeletePosition(DeletePositionReq) returns (Position) { + option (google.api.http) = { + delete: "/positions/{id}" + }; + } + + // stat + rpc GetCategoriesStat(GetCategoriesStatReq) returns (CategoriesStat) { + option (google.api.http) = { + get: "/stat" + }; + } } message PingReq {} message PingRsp {} -message CreateUserReq { +message AddUserReq { string username = 1; string password = 2; } message User { - int32 id = 1; + string id = 1; string username = 2; } -message CreateCategoryReq { +message LoginReq { + string username = 1; + string password = 2; +} + +message AddBudgetReq { string name = 1; - bool favorite = 2; + int32 start_day = 2; int32 monthly_limit = 3; } -message UpdateCategoryReq { - int32 id = 1; +message Budget { + string id = 1; string name = 2; + int32 start_day = 3; + int32 monthly_limit = 4; +} + +message UpdateBudgetReq { + string id = 1; + string name = 2; + int32 start_day = 3; + int32 monthly_limit = 4; +} + +message GetBudgetsReq {} + +message Budgets { + repeated Budget budgets = 1; +} + +message DeleteBudgetReq { + string id = 1; +} + +message AddUserToBudgetReq { + string user_id = 1; + string budget_id = 2; +} + +message GetBudgetUsersReq { + string id = 1; +} + +message Users { + repeated User users = 1; +} + +message RemoveUserFromBudgetReq { + string user_id = 1; + string budget_id = 2; +} + +message AddCategoryReq { + string name = 1; + int32 budget_id = 2; bool favorite = 3; int32 monthly_limit = 4; } message Category { - int32 id = 1; + string id = 1; string name = 2; + int32 budget_id = 3; bool favorite = 4; int32 monthly_limit = 5; } -message CategoryFilterReq { +message UpdateCategoryReq { + string id = 1; + string name = 2; + bool favorite = 3; + int32 monthly_limit = 4; +} + +message GetCategoriesReq { bool favorite = 1; + int32 budget_id = 2; } message Categories { repeated Category categories = 1; } + +message DeleteCategoriesReq { + string id = 1; +} + +message AddPositionReq { + string name = 1; + int32 price = 2; + float amount = 3; + int32 category_id = 4; +} + +message Position { + string id = 1; + string name = 2; + int32 price = 3; + float amount = 4; +} + +message DeletePositionReq { + string id = 1; +} + +message GetCategoriesStatReq { + repeated int32 ids = 1; +} + +message CategoriesStat { + repeated CategoriesStat stat = 1; +} + +message CategoryStat { + string name = 1; + int32 monthly_limit = 2; + int32 amount = 3; +} diff --git a/proto/smm_core.pb.go b/proto/smm_core.pb.go index f3a14a6..acfd97d 100644 --- a/proto/smm_core.pb.go +++ b/proto/smm_core.pb.go @@ -94,7 +94,7 @@ func (*PingRsp) Descriptor() ([]byte, []int) { return file_smm_core_proto_rawDescGZIP(), []int{1} } -type CreateUserReq struct { +type AddUserReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -103,20 +103,20 @@ type CreateUserReq struct { Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } -func (x *CreateUserReq) Reset() { - *x = CreateUserReq{} +func (x *AddUserReq) Reset() { + *x = AddUserReq{} mi := &file_smm_core_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *CreateUserReq) String() string { +func (x *AddUserReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateUserReq) ProtoMessage() {} +func (*AddUserReq) ProtoMessage() {} -func (x *CreateUserReq) ProtoReflect() protoreflect.Message { +func (x *AddUserReq) ProtoReflect() protoreflect.Message { mi := &file_smm_core_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -128,19 +128,19 @@ func (x *CreateUserReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateUserReq.ProtoReflect.Descriptor instead. -func (*CreateUserReq) Descriptor() ([]byte, []int) { +// Deprecated: Use AddUserReq.ProtoReflect.Descriptor instead. +func (*AddUserReq) Descriptor() ([]byte, []int) { return file_smm_core_proto_rawDescGZIP(), []int{2} } -func (x *CreateUserReq) GetUsername() string { +func (x *AddUserReq) GetUsername() string { if x != nil { return x.Username } return "" } -func (x *CreateUserReq) GetPassword() string { +func (x *AddUserReq) GetPassword() string { if x != nil { return x.Password } @@ -152,7 +152,7 @@ type User struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` } @@ -186,11 +186,11 @@ func (*User) Descriptor() ([]byte, []int) { return file_smm_core_proto_rawDescGZIP(), []int{3} } -func (x *User) GetId() int32 { +func (x *User) GetId() string { if x != nil { return x.Id } - return 0 + return "" } func (x *User) GetUsername() string { @@ -200,30 +200,29 @@ func (x *User) GetUsername() string { return "" } -type CreateCategoryReq struct { +type LoginReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Favorite bool `protobuf:"varint,2,opt,name=favorite,proto3" json:"favorite,omitempty"` - MonthlyLimit int32 `protobuf:"varint,3,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } -func (x *CreateCategoryReq) Reset() { - *x = CreateCategoryReq{} +func (x *LoginReq) Reset() { + *x = LoginReq{} mi := &file_smm_core_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *CreateCategoryReq) String() string { +func (x *LoginReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateCategoryReq) ProtoMessage() {} +func (*LoginReq) ProtoMessage() {} -func (x *CreateCategoryReq) ProtoReflect() protoreflect.Message { +func (x *LoginReq) ProtoReflect() protoreflect.Message { mi := &file_smm_core_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -235,26 +234,686 @@ func (x *CreateCategoryReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateCategoryReq.ProtoReflect.Descriptor instead. -func (*CreateCategoryReq) Descriptor() ([]byte, []int) { +// Deprecated: Use LoginReq.ProtoReflect.Descriptor instead. +func (*LoginReq) Descriptor() ([]byte, []int) { return file_smm_core_proto_rawDescGZIP(), []int{4} } -func (x *CreateCategoryReq) GetName() string { +func (x *LoginReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginReq) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type AddBudgetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + StartDay int32 `protobuf:"varint,2,opt,name=start_day,json=startDay,proto3" json:"start_day,omitempty"` + MonthlyLimit int32 `protobuf:"varint,3,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` +} + +func (x *AddBudgetReq) Reset() { + *x = AddBudgetReq{} + mi := &file_smm_core_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddBudgetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddBudgetReq) ProtoMessage() {} + +func (x *AddBudgetReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddBudgetReq.ProtoReflect.Descriptor instead. +func (*AddBudgetReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{5} +} + +func (x *AddBudgetReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *CreateCategoryReq) GetFavorite() bool { +func (x *AddBudgetReq) GetStartDay() int32 { + if x != nil { + return x.StartDay + } + return 0 +} + +func (x *AddBudgetReq) GetMonthlyLimit() int32 { + if x != nil { + return x.MonthlyLimit + } + return 0 +} + +type Budget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + StartDay int32 `protobuf:"varint,3,opt,name=start_day,json=startDay,proto3" json:"start_day,omitempty"` + MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` +} + +func (x *Budget) Reset() { + *x = Budget{} + mi := &file_smm_core_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Budget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Budget) ProtoMessage() {} + +func (x *Budget) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Budget.ProtoReflect.Descriptor instead. +func (*Budget) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{6} +} + +func (x *Budget) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Budget) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Budget) GetStartDay() int32 { + if x != nil { + return x.StartDay + } + return 0 +} + +func (x *Budget) GetMonthlyLimit() int32 { + if x != nil { + return x.MonthlyLimit + } + return 0 +} + +type UpdateBudgetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + StartDay int32 `protobuf:"varint,3,opt,name=start_day,json=startDay,proto3" json:"start_day,omitempty"` + MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` +} + +func (x *UpdateBudgetReq) Reset() { + *x = UpdateBudgetReq{} + mi := &file_smm_core_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateBudgetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBudgetReq) ProtoMessage() {} + +func (x *UpdateBudgetReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBudgetReq.ProtoReflect.Descriptor instead. +func (*UpdateBudgetReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateBudgetReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateBudgetReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateBudgetReq) GetStartDay() int32 { + if x != nil { + return x.StartDay + } + return 0 +} + +func (x *UpdateBudgetReq) GetMonthlyLimit() int32 { + if x != nil { + return x.MonthlyLimit + } + return 0 +} + +type GetBudgetsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetBudgetsReq) Reset() { + *x = GetBudgetsReq{} + mi := &file_smm_core_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBudgetsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBudgetsReq) ProtoMessage() {} + +func (x *GetBudgetsReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBudgetsReq.ProtoReflect.Descriptor instead. +func (*GetBudgetsReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{8} +} + +type Budgets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Budgets []*Budget `protobuf:"bytes,1,rep,name=budgets,proto3" json:"budgets,omitempty"` +} + +func (x *Budgets) Reset() { + *x = Budgets{} + mi := &file_smm_core_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Budgets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Budgets) ProtoMessage() {} + +func (x *Budgets) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Budgets.ProtoReflect.Descriptor instead. +func (*Budgets) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{9} +} + +func (x *Budgets) GetBudgets() []*Budget { + if x != nil { + return x.Budgets + } + return nil +} + +type DeleteBudgetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteBudgetReq) Reset() { + *x = DeleteBudgetReq{} + mi := &file_smm_core_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteBudgetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBudgetReq) ProtoMessage() {} + +func (x *DeleteBudgetReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBudgetReq.ProtoReflect.Descriptor instead. +func (*DeleteBudgetReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteBudgetReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type AddUserToBudgetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + BudgetId string `protobuf:"bytes,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` +} + +func (x *AddUserToBudgetReq) Reset() { + *x = AddUserToBudgetReq{} + mi := &file_smm_core_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddUserToBudgetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddUserToBudgetReq) ProtoMessage() {} + +func (x *AddUserToBudgetReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddUserToBudgetReq.ProtoReflect.Descriptor instead. +func (*AddUserToBudgetReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{11} +} + +func (x *AddUserToBudgetReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AddUserToBudgetReq) GetBudgetId() string { + if x != nil { + return x.BudgetId + } + return "" +} + +type GetBudgetUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetBudgetUsersReq) Reset() { + *x = GetBudgetUsersReq{} + mi := &file_smm_core_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBudgetUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBudgetUsersReq) ProtoMessage() {} + +func (x *GetBudgetUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBudgetUsersReq.ProtoReflect.Descriptor instead. +func (*GetBudgetUsersReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{12} +} + +func (x *GetBudgetUsersReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type Users struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *Users) Reset() { + *x = Users{} + mi := &file_smm_core_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Users) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Users) ProtoMessage() {} + +func (x *Users) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Users.ProtoReflect.Descriptor instead. +func (*Users) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{13} +} + +func (x *Users) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +type RemoveUserFromBudgetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + BudgetId string `protobuf:"bytes,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` +} + +func (x *RemoveUserFromBudgetReq) Reset() { + *x = RemoveUserFromBudgetReq{} + mi := &file_smm_core_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveUserFromBudgetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveUserFromBudgetReq) ProtoMessage() {} + +func (x *RemoveUserFromBudgetReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveUserFromBudgetReq.ProtoReflect.Descriptor instead. +func (*RemoveUserFromBudgetReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{14} +} + +func (x *RemoveUserFromBudgetReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *RemoveUserFromBudgetReq) GetBudgetId() string { + if x != nil { + return x.BudgetId + } + return "" +} + +type AddCategoryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + BudgetId int32 `protobuf:"varint,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` + Favorite bool `protobuf:"varint,3,opt,name=favorite,proto3" json:"favorite,omitempty"` + MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` +} + +func (x *AddCategoryReq) Reset() { + *x = AddCategoryReq{} + mi := &file_smm_core_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCategoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCategoryReq) ProtoMessage() {} + +func (x *AddCategoryReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCategoryReq.ProtoReflect.Descriptor instead. +func (*AddCategoryReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{15} +} + +func (x *AddCategoryReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddCategoryReq) GetBudgetId() int32 { + if x != nil { + return x.BudgetId + } + return 0 +} + +func (x *AddCategoryReq) GetFavorite() bool { if x != nil { return x.Favorite } return false } -func (x *CreateCategoryReq) GetMonthlyLimit() int32 { +func (x *AddCategoryReq) GetMonthlyLimit() int32 { + if x != nil { + return x.MonthlyLimit + } + return 0 +} + +type Category struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + BudgetId int32 `protobuf:"varint,3,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` + Favorite bool `protobuf:"varint,4,opt,name=favorite,proto3" json:"favorite,omitempty"` + MonthlyLimit int32 `protobuf:"varint,5,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` +} + +func (x *Category) Reset() { + *x = Category{} + mi := &file_smm_core_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Category) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Category) ProtoMessage() {} + +func (x *Category) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Category.ProtoReflect.Descriptor instead. +func (*Category) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{16} +} + +func (x *Category) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Category) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Category) GetBudgetId() int32 { + if x != nil { + return x.BudgetId + } + return 0 +} + +func (x *Category) GetFavorite() bool { + if x != nil { + return x.Favorite + } + return false +} + +func (x *Category) GetMonthlyLimit() int32 { if x != nil { return x.MonthlyLimit } @@ -266,7 +925,7 @@ type UpdateCategoryReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Favorite bool `protobuf:"varint,3,opt,name=favorite,proto3" json:"favorite,omitempty"` MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` @@ -274,7 +933,7 @@ type UpdateCategoryReq struct { func (x *UpdateCategoryReq) Reset() { *x = UpdateCategoryReq{} - mi := &file_smm_core_proto_msgTypes[5] + mi := &file_smm_core_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -286,7 +945,7 @@ func (x *UpdateCategoryReq) String() string { func (*UpdateCategoryReq) ProtoMessage() {} func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[5] + mi := &file_smm_core_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -299,14 +958,14 @@ func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateCategoryReq.ProtoReflect.Descriptor instead. func (*UpdateCategoryReq) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{5} + return file_smm_core_proto_rawDescGZIP(), []int{17} } -func (x *UpdateCategoryReq) GetId() int32 { +func (x *UpdateCategoryReq) GetId() string { if x != nil { return x.Id } - return 0 + return "" } func (x *UpdateCategoryReq) GetName() string { @@ -330,32 +989,30 @@ func (x *UpdateCategoryReq) GetMonthlyLimit() int32 { return 0 } -type Category struct { +type GetCategoriesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Favorite bool `protobuf:"varint,4,opt,name=favorite,proto3" json:"favorite,omitempty"` - MonthlyLimit int32 `protobuf:"varint,5,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` + Favorite bool `protobuf:"varint,1,opt,name=favorite,proto3" json:"favorite,omitempty"` + BudgetId int32 `protobuf:"varint,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` } -func (x *Category) Reset() { - *x = Category{} - mi := &file_smm_core_proto_msgTypes[6] +func (x *GetCategoriesReq) Reset() { + *x = GetCategoriesReq{} + mi := &file_smm_core_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Category) String() string { +func (x *GetCategoriesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Category) ProtoMessage() {} +func (*GetCategoriesReq) ProtoMessage() {} -func (x *Category) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[6] +func (x *GetCategoriesReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -366,84 +1023,25 @@ func (x *Category) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Category.ProtoReflect.Descriptor instead. -func (*Category) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{6} +// Deprecated: Use GetCategoriesReq.ProtoReflect.Descriptor instead. +func (*GetCategoriesReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{18} } -func (x *Category) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Category) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Category) GetFavorite() bool { +func (x *GetCategoriesReq) GetFavorite() bool { if x != nil { return x.Favorite } return false } -func (x *Category) GetMonthlyLimit() int32 { +func (x *GetCategoriesReq) GetBudgetId() int32 { if x != nil { - return x.MonthlyLimit + return x.BudgetId } return 0 } -type CategoryFilterReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Favorite bool `protobuf:"varint,1,opt,name=favorite,proto3" json:"favorite,omitempty"` -} - -func (x *CategoryFilterReq) Reset() { - *x = CategoryFilterReq{} - mi := &file_smm_core_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CategoryFilterReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CategoryFilterReq) ProtoMessage() {} - -func (x *CategoryFilterReq) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CategoryFilterReq.ProtoReflect.Descriptor instead. -func (*CategoryFilterReq) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{7} -} - -func (x *CategoryFilterReq) GetFavorite() bool { - if x != nil { - return x.Favorite - } - return false -} - type Categories struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -454,7 +1052,7 @@ type Categories struct { func (x *Categories) Reset() { *x = Categories{} - mi := &file_smm_core_proto_msgTypes[8] + mi := &file_smm_core_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -466,7 +1064,7 @@ func (x *Categories) String() string { func (*Categories) ProtoMessage() {} func (x *Categories) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[8] + mi := &file_smm_core_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -479,7 +1077,7 @@ func (x *Categories) ProtoReflect() protoreflect.Message { // Deprecated: Use Categories.ProtoReflect.Descriptor instead. func (*Categories) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{8} + return file_smm_core_proto_rawDescGZIP(), []int{19} } func (x *Categories) GetCategories() []*Category { @@ -489,6 +1087,385 @@ func (x *Categories) GetCategories() []*Category { return nil } +type DeleteCategoriesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteCategoriesReq) Reset() { + *x = DeleteCategoriesReq{} + mi := &file_smm_core_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteCategoriesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCategoriesReq) ProtoMessage() {} + +func (x *DeleteCategoriesReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCategoriesReq.ProtoReflect.Descriptor instead. +func (*DeleteCategoriesReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{20} +} + +func (x *DeleteCategoriesReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type AddPositionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Price int32 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` + Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` + CategoryId int32 `protobuf:"varint,4,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` +} + +func (x *AddPositionReq) Reset() { + *x = AddPositionReq{} + mi := &file_smm_core_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddPositionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddPositionReq) ProtoMessage() {} + +func (x *AddPositionReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddPositionReq.ProtoReflect.Descriptor instead. +func (*AddPositionReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{21} +} + +func (x *AddPositionReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddPositionReq) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *AddPositionReq) GetAmount() float32 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *AddPositionReq) GetCategoryId() int32 { + if x != nil { + return x.CategoryId + } + return 0 +} + +type Position struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Price int32 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` + Amount float32 `protobuf:"fixed32,4,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *Position) Reset() { + *x = Position{} + mi := &file_smm_core_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Position) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Position) ProtoMessage() {} + +func (x *Position) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Position.ProtoReflect.Descriptor instead. +func (*Position) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{22} +} + +func (x *Position) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Position) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Position) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *Position) GetAmount() float32 { + if x != nil { + return x.Amount + } + return 0 +} + +type DeletePositionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeletePositionReq) Reset() { + *x = DeletePositionReq{} + mi := &file_smm_core_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeletePositionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePositionReq) ProtoMessage() {} + +func (x *DeletePositionReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePositionReq.ProtoReflect.Descriptor instead. +func (*DeletePositionReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{23} +} + +func (x *DeletePositionReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetCategoriesStatReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []int32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` +} + +func (x *GetCategoriesStatReq) Reset() { + *x = GetCategoriesStatReq{} + mi := &file_smm_core_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetCategoriesStatReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCategoriesStatReq) ProtoMessage() {} + +func (x *GetCategoriesStatReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCategoriesStatReq.ProtoReflect.Descriptor instead. +func (*GetCategoriesStatReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{24} +} + +func (x *GetCategoriesStatReq) GetIds() []int32 { + if x != nil { + return x.Ids + } + return nil +} + +type CategoriesStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stat []*CategoriesStat `protobuf:"bytes,1,rep,name=stat,proto3" json:"stat,omitempty"` +} + +func (x *CategoriesStat) Reset() { + *x = CategoriesStat{} + mi := &file_smm_core_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CategoriesStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoriesStat) ProtoMessage() {} + +func (x *CategoriesStat) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoriesStat.ProtoReflect.Descriptor instead. +func (*CategoriesStat) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{25} +} + +func (x *CategoriesStat) GetStat() []*CategoriesStat { + if x != nil { + return x.Stat + } + return nil +} + +type CategoryStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + MonthlyLimit int32 `protobuf:"varint,2,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` + Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *CategoryStat) Reset() { + *x = CategoryStat{} + mi := &file_smm_core_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CategoryStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryStat) ProtoMessage() {} + +func (x *CategoryStat) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryStat.ProtoReflect.Descriptor instead. +func (*CategoryStat) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{26} +} + +func (x *CategoryStat) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CategoryStat) GetMonthlyLimit() int32 { + if x != nil { + return x.MonthlyLimit + } + return 0 +} + +func (x *CategoryStat) GetAmount() int32 { + if x != nil { + return x.Amount + } + return 0 +} + var File_smm_core_proto protoreflect.FileDescriptor var file_smm_core_proto_rawDesc = []byte{ @@ -500,75 +1477,234 @@ var file_smm_core_proto_rawDesc = []byte{ 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, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e, - 0x67, 0x52, 0x73, 0x70, 0x22, 0x47, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x32, 0x0a, - 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x68, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, - 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, - 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, - 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, - 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x78, 0x0a, 0x11, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x6f, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, - 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x2f, 0x0a, 0x11, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, - 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, - 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x22, 0x46, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, - 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x32, - 0xd7, 0x03, 0x0a, 0x07, 0x53, 0x6d, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x50, - 0x69, 0x6e, 0x67, 0x12, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, - 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, - 0x6e, 0x67, 0x52, 0x73, 0x70, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, - 0x70, 0x69, 0x6e, 0x67, 0x12, 0x51, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x1d, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, + 0x67, 0x52, 0x73, 0x70, 0x22, 0x44, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x32, 0x0a, 0x04, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x42, + 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x22, 0x64, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, + 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x6e, 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, + 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x77, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, + 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, + 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x07, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x30, 0x0a, + 0x07, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, - 0x06, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x62, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, - 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, - 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, - 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x2e, - 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x12, 0x1a, 0x10, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x63, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, - 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, - 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x63, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x0e, 0x92, 0x41, 0x00, 0x5a, 0x09, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x22, + 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, 0x23, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x33, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x72, + 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x41, 0x64, + 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, + 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x8c, + 0x01, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, + 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, + 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x78, 0x0a, + 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, + 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, + 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x25, 0x0a, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x73, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 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, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x44, 0x0a, 0x0e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x5f, 0x0a, 0x0c, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x92, 0x0d, 0x0a, + 0x07, 0x53, 0x6d, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, + 0x12, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, + 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, + 0x73, 0x70, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x70, 0x69, 0x6e, + 0x67, 0x12, 0x4e, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x12, 0x4a, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, + 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x56, 0x0a, + 0x09, 0x41, 0x64, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x22, 0x08, 0x2f, 0x62, 0x75, + 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x61, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x18, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x1a, 0x0d, 0x2f, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x56, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x22, 0x10, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, + 0x12, 0x5e, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x12, 0x1f, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x0f, 0x2a, 0x0d, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x71, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, + 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, + 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, + 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x1a, 0x1a, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, + 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x85, 0x01, 0x0a, + 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x27, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, + 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a, 0x24, + 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x5f, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x16, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, + 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x1a, 0x10, 0x2f, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x62, + 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x20, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x13, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x12, 0x6b, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, + 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x10, 0x2f, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, + 0x5e, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, + 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x18, + 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, + 0x3a, 0x01, 0x2a, 0x22, 0x0a, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x66, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, + 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x17, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x2a, 0x0f, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x68, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x12, 0x24, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x42, 0x0e, 0x92, 0x41, 0x00, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -583,35 +1719,80 @@ func file_smm_core_proto_rawDescGZIP() []byte { return file_smm_core_proto_rawDescData } -var file_smm_core_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_smm_core_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_smm_core_proto_goTypes = []any{ - (*PingReq)(nil), // 0: crabs.smm_core.PingReq - (*PingRsp)(nil), // 1: crabs.smm_core.PingRsp - (*CreateUserReq)(nil), // 2: crabs.smm_core.CreateUserReq - (*User)(nil), // 3: crabs.smm_core.User - (*CreateCategoryReq)(nil), // 4: crabs.smm_core.CreateCategoryReq - (*UpdateCategoryReq)(nil), // 5: crabs.smm_core.UpdateCategoryReq - (*Category)(nil), // 6: crabs.smm_core.Category - (*CategoryFilterReq)(nil), // 7: crabs.smm_core.CategoryFilterReq - (*Categories)(nil), // 8: crabs.smm_core.Categories + (*PingReq)(nil), // 0: crabs.smm_core.PingReq + (*PingRsp)(nil), // 1: crabs.smm_core.PingRsp + (*AddUserReq)(nil), // 2: crabs.smm_core.AddUserReq + (*User)(nil), // 3: crabs.smm_core.User + (*LoginReq)(nil), // 4: crabs.smm_core.LoginReq + (*AddBudgetReq)(nil), // 5: crabs.smm_core.AddBudgetReq + (*Budget)(nil), // 6: crabs.smm_core.Budget + (*UpdateBudgetReq)(nil), // 7: crabs.smm_core.UpdateBudgetReq + (*GetBudgetsReq)(nil), // 8: crabs.smm_core.GetBudgetsReq + (*Budgets)(nil), // 9: crabs.smm_core.Budgets + (*DeleteBudgetReq)(nil), // 10: crabs.smm_core.DeleteBudgetReq + (*AddUserToBudgetReq)(nil), // 11: crabs.smm_core.AddUserToBudgetReq + (*GetBudgetUsersReq)(nil), // 12: crabs.smm_core.GetBudgetUsersReq + (*Users)(nil), // 13: crabs.smm_core.Users + (*RemoveUserFromBudgetReq)(nil), // 14: crabs.smm_core.RemoveUserFromBudgetReq + (*AddCategoryReq)(nil), // 15: crabs.smm_core.AddCategoryReq + (*Category)(nil), // 16: crabs.smm_core.Category + (*UpdateCategoryReq)(nil), // 17: crabs.smm_core.UpdateCategoryReq + (*GetCategoriesReq)(nil), // 18: crabs.smm_core.GetCategoriesReq + (*Categories)(nil), // 19: crabs.smm_core.Categories + (*DeleteCategoriesReq)(nil), // 20: crabs.smm_core.DeleteCategoriesReq + (*AddPositionReq)(nil), // 21: crabs.smm_core.AddPositionReq + (*Position)(nil), // 22: crabs.smm_core.Position + (*DeletePositionReq)(nil), // 23: crabs.smm_core.DeletePositionReq + (*GetCategoriesStatReq)(nil), // 24: crabs.smm_core.GetCategoriesStatReq + (*CategoriesStat)(nil), // 25: crabs.smm_core.CategoriesStat + (*CategoryStat)(nil), // 26: crabs.smm_core.CategoryStat } var file_smm_core_proto_depIdxs = []int32{ - 6, // 0: crabs.smm_core.Categories.categories:type_name -> crabs.smm_core.Category - 0, // 1: crabs.smm_core.SmmCore.Ping:input_type -> crabs.smm_core.PingReq - 2, // 2: crabs.smm_core.SmmCore.AddUser:input_type -> crabs.smm_core.CreateUserReq - 4, // 3: crabs.smm_core.SmmCore.AddCategory:input_type -> crabs.smm_core.CreateCategoryReq - 5, // 4: crabs.smm_core.SmmCore.UpdateCategory:input_type -> crabs.smm_core.UpdateCategoryReq - 7, // 5: crabs.smm_core.SmmCore.GetCategories:input_type -> crabs.smm_core.CategoryFilterReq - 1, // 6: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp - 3, // 7: crabs.smm_core.SmmCore.AddUser:output_type -> crabs.smm_core.User - 6, // 8: crabs.smm_core.SmmCore.AddCategory:output_type -> crabs.smm_core.Category - 6, // 9: crabs.smm_core.SmmCore.UpdateCategory:output_type -> crabs.smm_core.Category - 8, // 10: crabs.smm_core.SmmCore.GetCategories:output_type -> crabs.smm_core.Categories - 6, // [6:11] is the sub-list for method output_type - 1, // [1:6] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 6, // 0: crabs.smm_core.Budgets.budgets:type_name -> crabs.smm_core.Budget + 3, // 1: crabs.smm_core.Users.users:type_name -> crabs.smm_core.User + 16, // 2: crabs.smm_core.Categories.categories:type_name -> crabs.smm_core.Category + 25, // 3: crabs.smm_core.CategoriesStat.stat:type_name -> crabs.smm_core.CategoriesStat + 0, // 4: crabs.smm_core.SmmCore.Ping:input_type -> crabs.smm_core.PingReq + 2, // 5: crabs.smm_core.SmmCore.AddUser:input_type -> crabs.smm_core.AddUserReq + 4, // 6: crabs.smm_core.SmmCore.Login:input_type -> crabs.smm_core.LoginReq + 5, // 7: crabs.smm_core.SmmCore.AddBudget:input_type -> crabs.smm_core.AddBudgetReq + 7, // 8: crabs.smm_core.SmmCore.UpdateBudget:input_type -> crabs.smm_core.UpdateBudgetReq + 8, // 9: crabs.smm_core.SmmCore.GetBudgets:input_type -> crabs.smm_core.GetBudgetsReq + 10, // 10: crabs.smm_core.SmmCore.DeleteBudget:input_type -> crabs.smm_core.DeleteBudgetReq + 11, // 11: crabs.smm_core.SmmCore.AddUserToBudget:input_type -> crabs.smm_core.AddUserToBudgetReq + 12, // 12: crabs.smm_core.SmmCore.GetBudgetUsers:input_type -> crabs.smm_core.GetBudgetUsersReq + 14, // 13: crabs.smm_core.SmmCore.RemoveUserFromBudget:input_type -> crabs.smm_core.RemoveUserFromBudgetReq + 15, // 14: crabs.smm_core.SmmCore.AddCategory:input_type -> crabs.smm_core.AddCategoryReq + 17, // 15: crabs.smm_core.SmmCore.UpdateCategory:input_type -> crabs.smm_core.UpdateCategoryReq + 18, // 16: crabs.smm_core.SmmCore.GetCategories:input_type -> crabs.smm_core.GetCategoriesReq + 20, // 17: crabs.smm_core.SmmCore.DeleteCategories:input_type -> crabs.smm_core.DeleteCategoriesReq + 21, // 18: crabs.smm_core.SmmCore.AddPosition:input_type -> crabs.smm_core.AddPositionReq + 23, // 19: crabs.smm_core.SmmCore.DeletePosition:input_type -> crabs.smm_core.DeletePositionReq + 24, // 20: crabs.smm_core.SmmCore.GetCategoriesStat:input_type -> crabs.smm_core.GetCategoriesStatReq + 1, // 21: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp + 3, // 22: crabs.smm_core.SmmCore.AddUser:output_type -> crabs.smm_core.User + 3, // 23: crabs.smm_core.SmmCore.Login:output_type -> crabs.smm_core.User + 6, // 24: crabs.smm_core.SmmCore.AddBudget:output_type -> crabs.smm_core.Budget + 6, // 25: crabs.smm_core.SmmCore.UpdateBudget:output_type -> crabs.smm_core.Budget + 9, // 26: crabs.smm_core.SmmCore.GetBudgets:output_type -> crabs.smm_core.Budgets + 6, // 27: crabs.smm_core.SmmCore.DeleteBudget:output_type -> crabs.smm_core.Budget + 6, // 28: crabs.smm_core.SmmCore.AddUserToBudget:output_type -> crabs.smm_core.Budget + 13, // 29: crabs.smm_core.SmmCore.GetBudgetUsers:output_type -> crabs.smm_core.Users + 6, // 30: crabs.smm_core.SmmCore.RemoveUserFromBudget:output_type -> crabs.smm_core.Budget + 16, // 31: crabs.smm_core.SmmCore.AddCategory:output_type -> crabs.smm_core.Category + 16, // 32: crabs.smm_core.SmmCore.UpdateCategory:output_type -> crabs.smm_core.Category + 19, // 33: crabs.smm_core.SmmCore.GetCategories:output_type -> crabs.smm_core.Categories + 16, // 34: crabs.smm_core.SmmCore.DeleteCategories:output_type -> crabs.smm_core.Category + 22, // 35: crabs.smm_core.SmmCore.AddPosition:output_type -> crabs.smm_core.Position + 22, // 36: crabs.smm_core.SmmCore.DeletePosition:output_type -> crabs.smm_core.Position + 25, // 37: crabs.smm_core.SmmCore.GetCategoriesStat:output_type -> crabs.smm_core.CategoriesStat + 21, // [21:38] is the sub-list for method output_type + 4, // [4:21] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_smm_core_proto_init() } @@ -625,7 +1806,7 @@ func file_smm_core_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_smm_core_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/smm_core.pb.gw.go b/proto/smm_core.pb.gw.go index a003627..cb5e6b0 100644 --- a/proto/smm_core.pb.gw.go +++ b/proto/smm_core.pb.gw.go @@ -50,7 +50,7 @@ func local_request_SmmCore_Ping_0(ctx context.Context, marshaler runtime.Marshal } func request_SmmCore_AddUser_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserReq + var protoReq AddUserReq var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { @@ -63,7 +63,7 @@ func request_SmmCore_AddUser_0(ctx context.Context, marshaler runtime.Marshaler, } func local_request_SmmCore_AddUser_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserReq + var protoReq AddUserReq var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { @@ -75,8 +75,384 @@ func local_request_SmmCore_AddUser_0(ctx context.Context, marshaler runtime.Mars } +func request_SmmCore_Login_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq LoginReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_Login_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq LoginReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Login(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_AddBudget_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddBudgetReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_AddBudget_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddBudgetReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddBudget(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_UpdateBudget_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateBudgetReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.UpdateBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_UpdateBudget_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateBudgetReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.UpdateBudget(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_GetBudgets_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetsReq + var metadata runtime.ServerMetadata + + msg, err := client.GetBudgets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_GetBudgets_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetsReq + var metadata runtime.ServerMetadata + + msg, err := server.GetBudgets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_DeleteBudget_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_DeleteBudget_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteBudget(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SmmCore_AddUserToBudget_0 = &utilities.DoubleArray{Encoding: map[string]int{"budget_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_SmmCore_AddUserToBudget_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddUserToBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SmmCore_AddUserToBudget_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddUserToBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_AddUserToBudget_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddUserToBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SmmCore_AddUserToBudget_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddUserToBudget(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_GetBudgetUsers_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetUsersReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetBudgetUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_GetBudgetUsers_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetUsersReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetBudgetUsers(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_RemoveUserFromBudget_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveUserFromBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + val, ok = pathParams["user_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user_id") + } + + protoReq.UserId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user_id", err) + } + + msg, err := client.RemoveUserFromBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_RemoveUserFromBudget_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveUserFromBudgetReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + val, ok = pathParams["user_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user_id") + } + + protoReq.UserId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user_id", err) + } + + msg, err := server.RemoveUserFromBudget(ctx, &protoReq) + return msg, metadata, err + +} + func request_SmmCore_AddCategory_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateCategoryReq + var protoReq AddCategoryReq var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { @@ -89,7 +465,7 @@ func request_SmmCore_AddCategory_0(ctx context.Context, marshaler runtime.Marsha } func local_request_SmmCore_AddCategory_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateCategoryReq + var protoReq AddCategoryReq var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { @@ -121,7 +497,7 @@ func request_SmmCore_UpdateCategory_0(ctx context.Context, marshaler runtime.Mar return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -154,7 +530,7 @@ func local_request_SmmCore_UpdateCategory_0(ctx context.Context, marshaler runti return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -176,7 +552,7 @@ var ( ) func request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CategoryFilterReq + var protoReq GetCategoriesReq var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -192,7 +568,7 @@ func request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtime.Mars } func local_request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CategoryFilterReq + var protoReq GetCategoriesReq var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -207,6 +583,172 @@ func local_request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtim } +func request_SmmCore_DeleteCategories_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCategoriesReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_DeleteCategories_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCategoriesReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteCategories(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_AddPosition_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddPositionReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddPosition(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_AddPosition_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddPositionReq + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddPosition(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SmmCore_DeletePosition_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePositionReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeletePosition(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_DeletePosition_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePositionReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeletePosition(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SmmCore_GetCategoriesStat_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SmmCore_GetCategoriesStat_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCategoriesStatReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SmmCore_GetCategoriesStat_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetCategoriesStat(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_GetCategoriesStat_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCategoriesStatReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SmmCore_GetCategoriesStat_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetCategoriesStat(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterSmmCoreHandlerServer registers the http handlers for service SmmCore to "mux". // UnaryRPC :call SmmCoreServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -264,6 +806,206 @@ func RegisterSmmCoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("POST", pattern_SmmCore_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/Login", runtime.WithHTTPPathPattern("/login")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_Login_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmmCore_AddBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddBudget", runtime.WithHTTPPathPattern("/budgets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_AddBudget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_SmmCore_UpdateBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/UpdateBudget", runtime.WithHTTPPathPattern("/budgets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_UpdateBudget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_UpdateBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetBudgets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetBudgets", runtime.WithHTTPPathPattern("/budgets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_GetBudgets_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetBudgets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_DeleteBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeleteBudget", runtime.WithHTTPPathPattern("/budgets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_DeleteBudget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeleteBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_SmmCore_AddUserToBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddUserToBudget", runtime.WithHTTPPathPattern("/budgets/{budget_id}/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_AddUserToBudget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddUserToBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetBudgetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetBudgetUsers", runtime.WithHTTPPathPattern("/budgets/{id}/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_GetBudgetUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetBudgetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_RemoveUserFromBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/RemoveUserFromBudget", runtime.WithHTTPPathPattern("/budgets/{budget_id}/users/{user_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_RemoveUserFromBudget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_RemoveUserFromBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_SmmCore_AddCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -339,6 +1081,106 @@ func RegisterSmmCoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("DELETE", pattern_SmmCore_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeleteCategories", runtime.WithHTTPPathPattern("/categories/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_DeleteCategories_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeleteCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmmCore_AddPosition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddPosition", runtime.WithHTTPPathPattern("/positions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_AddPosition_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddPosition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_DeletePosition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeletePosition", runtime.WithHTTPPathPattern("/positions/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_DeletePosition_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeletePosition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetCategoriesStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetCategoriesStat", runtime.WithHTTPPathPattern("/stat")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_GetCategoriesStat_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetCategoriesStat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -424,6 +1266,182 @@ func RegisterSmmCoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("POST", pattern_SmmCore_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/Login", runtime.WithHTTPPathPattern("/login")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_Login_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmmCore_AddBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddBudget", runtime.WithHTTPPathPattern("/budgets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_AddBudget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_SmmCore_UpdateBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/UpdateBudget", runtime.WithHTTPPathPattern("/budgets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_UpdateBudget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_UpdateBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetBudgets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetBudgets", runtime.WithHTTPPathPattern("/budgets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_GetBudgets_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetBudgets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_DeleteBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeleteBudget", runtime.WithHTTPPathPattern("/budgets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_DeleteBudget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeleteBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_SmmCore_AddUserToBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddUserToBudget", runtime.WithHTTPPathPattern("/budgets/{budget_id}/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_AddUserToBudget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddUserToBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetBudgetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetBudgetUsers", runtime.WithHTTPPathPattern("/budgets/{id}/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_GetBudgetUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetBudgetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_RemoveUserFromBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/RemoveUserFromBudget", runtime.WithHTTPPathPattern("/budgets/{budget_id}/users/{user_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_RemoveUserFromBudget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_RemoveUserFromBudget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_SmmCore_AddCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -490,6 +1508,94 @@ func RegisterSmmCoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("DELETE", pattern_SmmCore_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeleteCategories", runtime.WithHTTPPathPattern("/categories/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_DeleteCategories_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeleteCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmmCore_AddPosition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddPosition", runtime.WithHTTPPathPattern("/positions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_AddPosition_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_AddPosition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_SmmCore_DeletePosition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/DeletePosition", runtime.WithHTTPPathPattern("/positions/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_DeletePosition_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_DeletePosition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SmmCore_GetCategoriesStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/GetCategoriesStat", runtime.WithHTTPPathPattern("/stat")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_GetCategoriesStat_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetCategoriesStat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -498,11 +1604,35 @@ var ( pattern_SmmCore_AddUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"users"}, "")) + pattern_SmmCore_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"login"}, "")) + + pattern_SmmCore_AddBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"budgets"}, "")) + + pattern_SmmCore_UpdateBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"budgets", "id"}, "")) + + pattern_SmmCore_GetBudgets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"budgets"}, "")) + + pattern_SmmCore_DeleteBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"budgets", "id"}, "")) + + pattern_SmmCore_AddUserToBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"budgets", "budget_id", "users"}, "")) + + pattern_SmmCore_GetBudgetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"budgets", "id", "users"}, "")) + + pattern_SmmCore_RemoveUserFromBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"budgets", "budget_id", "users", "user_id"}, "")) + pattern_SmmCore_AddCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"categories"}, "")) pattern_SmmCore_UpdateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"categories", "id"}, "")) pattern_SmmCore_GetCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"categories"}, "")) + + pattern_SmmCore_DeleteCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"categories", "id"}, "")) + + pattern_SmmCore_AddPosition_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"positions"}, "")) + + pattern_SmmCore_DeletePosition_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"positions", "id"}, "")) + + pattern_SmmCore_GetCategoriesStat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"stat"}, "")) ) var ( @@ -510,9 +1640,33 @@ var ( forward_SmmCore_AddUser_0 = runtime.ForwardResponseMessage + forward_SmmCore_Login_0 = runtime.ForwardResponseMessage + + forward_SmmCore_AddBudget_0 = runtime.ForwardResponseMessage + + forward_SmmCore_UpdateBudget_0 = runtime.ForwardResponseMessage + + forward_SmmCore_GetBudgets_0 = runtime.ForwardResponseMessage + + forward_SmmCore_DeleteBudget_0 = runtime.ForwardResponseMessage + + forward_SmmCore_AddUserToBudget_0 = runtime.ForwardResponseMessage + + forward_SmmCore_GetBudgetUsers_0 = runtime.ForwardResponseMessage + + forward_SmmCore_RemoveUserFromBudget_0 = runtime.ForwardResponseMessage + forward_SmmCore_AddCategory_0 = runtime.ForwardResponseMessage forward_SmmCore_UpdateCategory_0 = runtime.ForwardResponseMessage forward_SmmCore_GetCategories_0 = runtime.ForwardResponseMessage + + forward_SmmCore_DeleteCategories_0 = runtime.ForwardResponseMessage + + forward_SmmCore_AddPosition_0 = runtime.ForwardResponseMessage + + forward_SmmCore_DeletePosition_0 = runtime.ForwardResponseMessage + + forward_SmmCore_GetCategoriesStat_0 = runtime.ForwardResponseMessage ) diff --git a/proto/smm_core_grpc.pb.go b/proto/smm_core_grpc.pb.go index fea0317..22306b2 100644 --- a/proto/smm_core_grpc.pb.go +++ b/proto/smm_core_grpc.pb.go @@ -19,24 +19,53 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - SmmCore_Ping_FullMethodName = "/crabs.smm_core.SmmCore/Ping" - SmmCore_AddUser_FullMethodName = "/crabs.smm_core.SmmCore/AddUser" - SmmCore_AddCategory_FullMethodName = "/crabs.smm_core.SmmCore/AddCategory" - SmmCore_UpdateCategory_FullMethodName = "/crabs.smm_core.SmmCore/UpdateCategory" - SmmCore_GetCategories_FullMethodName = "/crabs.smm_core.SmmCore/GetCategories" + SmmCore_Ping_FullMethodName = "/crabs.smm_core.SmmCore/Ping" + SmmCore_AddUser_FullMethodName = "/crabs.smm_core.SmmCore/AddUser" + SmmCore_Login_FullMethodName = "/crabs.smm_core.SmmCore/Login" + SmmCore_AddBudget_FullMethodName = "/crabs.smm_core.SmmCore/AddBudget" + SmmCore_UpdateBudget_FullMethodName = "/crabs.smm_core.SmmCore/UpdateBudget" + SmmCore_GetBudgets_FullMethodName = "/crabs.smm_core.SmmCore/GetBudgets" + SmmCore_DeleteBudget_FullMethodName = "/crabs.smm_core.SmmCore/DeleteBudget" + SmmCore_AddUserToBudget_FullMethodName = "/crabs.smm_core.SmmCore/AddUserToBudget" + SmmCore_GetBudgetUsers_FullMethodName = "/crabs.smm_core.SmmCore/GetBudgetUsers" + SmmCore_RemoveUserFromBudget_FullMethodName = "/crabs.smm_core.SmmCore/RemoveUserFromBudget" + SmmCore_AddCategory_FullMethodName = "/crabs.smm_core.SmmCore/AddCategory" + SmmCore_UpdateCategory_FullMethodName = "/crabs.smm_core.SmmCore/UpdateCategory" + SmmCore_GetCategories_FullMethodName = "/crabs.smm_core.SmmCore/GetCategories" + SmmCore_DeleteCategories_FullMethodName = "/crabs.smm_core.SmmCore/DeleteCategories" + SmmCore_AddPosition_FullMethodName = "/crabs.smm_core.SmmCore/AddPosition" + SmmCore_DeletePosition_FullMethodName = "/crabs.smm_core.SmmCore/DeletePosition" + SmmCore_GetCategoriesStat_FullMethodName = "/crabs.smm_core.SmmCore/GetCategoriesStat" ) // SmmCoreClient is the client API for SmmCore 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 SmmCoreClient interface { + // ping Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error) // users - AddUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*User, error) + AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*User, error) + Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*User, error) + // budgets + AddBudget(ctx context.Context, in *AddBudgetReq, opts ...grpc.CallOption) (*Budget, error) + UpdateBudget(ctx context.Context, in *UpdateBudgetReq, opts ...grpc.CallOption) (*Budget, error) + GetBudgets(ctx context.Context, in *GetBudgetsReq, opts ...grpc.CallOption) (*Budgets, error) + DeleteBudget(ctx context.Context, in *DeleteBudgetReq, opts ...grpc.CallOption) (*Budget, error) + // budget users + AddUserToBudget(ctx context.Context, in *AddUserToBudgetReq, opts ...grpc.CallOption) (*Budget, error) + GetBudgetUsers(ctx context.Context, in *GetBudgetUsersReq, opts ...grpc.CallOption) (*Users, error) + RemoveUserFromBudget(ctx context.Context, in *RemoveUserFromBudgetReq, opts ...grpc.CallOption) (*Budget, error) // categories - AddCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*Category, error) + AddCategory(ctx context.Context, in *AddCategoryReq, opts ...grpc.CallOption) (*Category, error) UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*Category, error) - GetCategories(ctx context.Context, in *CategoryFilterReq, opts ...grpc.CallOption) (*Categories, error) + GetCategories(ctx context.Context, in *GetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) + DeleteCategories(ctx context.Context, in *DeleteCategoriesReq, opts ...grpc.CallOption) (*Category, error) + // positions + AddPosition(ctx context.Context, in *AddPositionReq, opts ...grpc.CallOption) (*Position, error) + DeletePosition(ctx context.Context, in *DeletePositionReq, opts ...grpc.CallOption) (*Position, error) + // stat + GetCategoriesStat(ctx context.Context, in *GetCategoriesStatReq, opts ...grpc.CallOption) (*CategoriesStat, error) } type smmCoreClient struct { @@ -57,7 +86,7 @@ func (c *smmCoreClient) Ping(ctx context.Context, in *PingReq, opts ...grpc.Call return out, nil } -func (c *smmCoreClient) AddUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*User, error) { +func (c *smmCoreClient) AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*User, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(User) err := c.cc.Invoke(ctx, SmmCore_AddUser_FullMethodName, in, out, cOpts...) @@ -67,7 +96,87 @@ func (c *smmCoreClient) AddUser(ctx context.Context, in *CreateUserReq, opts ... return out, nil } -func (c *smmCoreClient) AddCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*Category, error) { +func (c *smmCoreClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, SmmCore_Login_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) AddBudget(ctx context.Context, in *AddBudgetReq, opts ...grpc.CallOption) (*Budget, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budget) + err := c.cc.Invoke(ctx, SmmCore_AddBudget_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) UpdateBudget(ctx context.Context, in *UpdateBudgetReq, opts ...grpc.CallOption) (*Budget, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budget) + err := c.cc.Invoke(ctx, SmmCore_UpdateBudget_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) GetBudgets(ctx context.Context, in *GetBudgetsReq, opts ...grpc.CallOption) (*Budgets, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budgets) + err := c.cc.Invoke(ctx, SmmCore_GetBudgets_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) DeleteBudget(ctx context.Context, in *DeleteBudgetReq, opts ...grpc.CallOption) (*Budget, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budget) + err := c.cc.Invoke(ctx, SmmCore_DeleteBudget_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) AddUserToBudget(ctx context.Context, in *AddUserToBudgetReq, opts ...grpc.CallOption) (*Budget, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budget) + err := c.cc.Invoke(ctx, SmmCore_AddUserToBudget_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) GetBudgetUsers(ctx context.Context, in *GetBudgetUsersReq, opts ...grpc.CallOption) (*Users, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Users) + err := c.cc.Invoke(ctx, SmmCore_GetBudgetUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) RemoveUserFromBudget(ctx context.Context, in *RemoveUserFromBudgetReq, opts ...grpc.CallOption) (*Budget, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Budget) + err := c.cc.Invoke(ctx, SmmCore_RemoveUserFromBudget_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) AddCategory(ctx context.Context, in *AddCategoryReq, opts ...grpc.CallOption) (*Category, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Category) err := c.cc.Invoke(ctx, SmmCore_AddCategory_FullMethodName, in, out, cOpts...) @@ -87,7 +196,7 @@ func (c *smmCoreClient) UpdateCategory(ctx context.Context, in *UpdateCategoryRe return out, nil } -func (c *smmCoreClient) GetCategories(ctx context.Context, in *CategoryFilterReq, opts ...grpc.CallOption) (*Categories, error) { +func (c *smmCoreClient) GetCategories(ctx context.Context, in *GetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Categories) err := c.cc.Invoke(ctx, SmmCore_GetCategories_FullMethodName, in, out, cOpts...) @@ -97,17 +206,74 @@ func (c *smmCoreClient) GetCategories(ctx context.Context, in *CategoryFilterReq return out, nil } +func (c *smmCoreClient) DeleteCategories(ctx context.Context, in *DeleteCategoriesReq, opts ...grpc.CallOption) (*Category, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Category) + err := c.cc.Invoke(ctx, SmmCore_DeleteCategories_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) AddPosition(ctx context.Context, in *AddPositionReq, opts ...grpc.CallOption) (*Position, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Position) + err := c.cc.Invoke(ctx, SmmCore_AddPosition_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) DeletePosition(ctx context.Context, in *DeletePositionReq, opts ...grpc.CallOption) (*Position, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Position) + err := c.cc.Invoke(ctx, SmmCore_DeletePosition_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *smmCoreClient) GetCategoriesStat(ctx context.Context, in *GetCategoriesStatReq, opts ...grpc.CallOption) (*CategoriesStat, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CategoriesStat) + err := c.cc.Invoke(ctx, SmmCore_GetCategoriesStat_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // SmmCoreServer is the server API for SmmCore service. // All implementations must embed UnimplementedSmmCoreServer // for forward compatibility. type SmmCoreServer interface { + // ping Ping(context.Context, *PingReq) (*PingRsp, error) // users - AddUser(context.Context, *CreateUserReq) (*User, error) + AddUser(context.Context, *AddUserReq) (*User, error) + Login(context.Context, *LoginReq) (*User, error) + // budgets + AddBudget(context.Context, *AddBudgetReq) (*Budget, error) + UpdateBudget(context.Context, *UpdateBudgetReq) (*Budget, error) + GetBudgets(context.Context, *GetBudgetsReq) (*Budgets, error) + DeleteBudget(context.Context, *DeleteBudgetReq) (*Budget, error) + // budget users + AddUserToBudget(context.Context, *AddUserToBudgetReq) (*Budget, error) + GetBudgetUsers(context.Context, *GetBudgetUsersReq) (*Users, error) + RemoveUserFromBudget(context.Context, *RemoveUserFromBudgetReq) (*Budget, error) // categories - AddCategory(context.Context, *CreateCategoryReq) (*Category, error) + AddCategory(context.Context, *AddCategoryReq) (*Category, error) UpdateCategory(context.Context, *UpdateCategoryReq) (*Category, error) - GetCategories(context.Context, *CategoryFilterReq) (*Categories, error) + GetCategories(context.Context, *GetCategoriesReq) (*Categories, error) + DeleteCategories(context.Context, *DeleteCategoriesReq) (*Category, error) + // positions + AddPosition(context.Context, *AddPositionReq) (*Position, error) + DeletePosition(context.Context, *DeletePositionReq) (*Position, error) + // stat + GetCategoriesStat(context.Context, *GetCategoriesStatReq) (*CategoriesStat, error) mustEmbedUnimplementedSmmCoreServer() } @@ -121,18 +287,54 @@ type UnimplementedSmmCoreServer struct{} func (UnimplementedSmmCoreServer) Ping(context.Context, *PingReq) (*PingRsp, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } -func (UnimplementedSmmCoreServer) AddUser(context.Context, *CreateUserReq) (*User, error) { +func (UnimplementedSmmCoreServer) AddUser(context.Context, *AddUserReq) (*User, error) { return nil, status.Errorf(codes.Unimplemented, "method AddUser not implemented") } -func (UnimplementedSmmCoreServer) AddCategory(context.Context, *CreateCategoryReq) (*Category, error) { +func (UnimplementedSmmCoreServer) Login(context.Context, *LoginReq) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedSmmCoreServer) AddBudget(context.Context, *AddBudgetReq) (*Budget, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddBudget not implemented") +} +func (UnimplementedSmmCoreServer) UpdateBudget(context.Context, *UpdateBudgetReq) (*Budget, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBudget not implemented") +} +func (UnimplementedSmmCoreServer) GetBudgets(context.Context, *GetBudgetsReq) (*Budgets, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBudgets not implemented") +} +func (UnimplementedSmmCoreServer) DeleteBudget(context.Context, *DeleteBudgetReq) (*Budget, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBudget not implemented") +} +func (UnimplementedSmmCoreServer) AddUserToBudget(context.Context, *AddUserToBudgetReq) (*Budget, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddUserToBudget not implemented") +} +func (UnimplementedSmmCoreServer) GetBudgetUsers(context.Context, *GetBudgetUsersReq) (*Users, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBudgetUsers not implemented") +} +func (UnimplementedSmmCoreServer) RemoveUserFromBudget(context.Context, *RemoveUserFromBudgetReq) (*Budget, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveUserFromBudget not implemented") +} +func (UnimplementedSmmCoreServer) AddCategory(context.Context, *AddCategoryReq) (*Category, error) { return nil, status.Errorf(codes.Unimplemented, "method AddCategory not implemented") } func (UnimplementedSmmCoreServer) UpdateCategory(context.Context, *UpdateCategoryReq) (*Category, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") } -func (UnimplementedSmmCoreServer) GetCategories(context.Context, *CategoryFilterReq) (*Categories, error) { +func (UnimplementedSmmCoreServer) GetCategories(context.Context, *GetCategoriesReq) (*Categories, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCategories not implemented") } +func (UnimplementedSmmCoreServer) DeleteCategories(context.Context, *DeleteCategoriesReq) (*Category, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteCategories not implemented") +} +func (UnimplementedSmmCoreServer) AddPosition(context.Context, *AddPositionReq) (*Position, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddPosition not implemented") +} +func (UnimplementedSmmCoreServer) DeletePosition(context.Context, *DeletePositionReq) (*Position, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePosition not implemented") +} +func (UnimplementedSmmCoreServer) GetCategoriesStat(context.Context, *GetCategoriesStatReq) (*CategoriesStat, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCategoriesStat not implemented") +} func (UnimplementedSmmCoreServer) mustEmbedUnimplementedSmmCoreServer() {} func (UnimplementedSmmCoreServer) testEmbeddedByValue() {} @@ -173,7 +375,7 @@ func _SmmCore_Ping_Handler(srv interface{}, ctx context.Context, dec func(interf } func _SmmCore_AddUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUserReq) + in := new(AddUserReq) if err := dec(in); err != nil { return nil, err } @@ -185,13 +387,157 @@ func _SmmCore_AddUser_Handler(srv interface{}, ctx context.Context, dec func(int FullMethod: SmmCore_AddUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SmmCoreServer).AddUser(ctx, req.(*CreateUserReq)) + return srv.(SmmCoreServer).AddUser(ctx, req.(*AddUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).Login(ctx, req.(*LoginReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_AddBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddBudgetReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).AddBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_AddBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).AddBudget(ctx, req.(*AddBudgetReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_UpdateBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBudgetReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).UpdateBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_UpdateBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).UpdateBudget(ctx, req.(*UpdateBudgetReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_GetBudgets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBudgetsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).GetBudgets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_GetBudgets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).GetBudgets(ctx, req.(*GetBudgetsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_DeleteBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBudgetReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).DeleteBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_DeleteBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).DeleteBudget(ctx, req.(*DeleteBudgetReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_AddUserToBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddUserToBudgetReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).AddUserToBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_AddUserToBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).AddUserToBudget(ctx, req.(*AddUserToBudgetReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_GetBudgetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBudgetUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).GetBudgetUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_GetBudgetUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).GetBudgetUsers(ctx, req.(*GetBudgetUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_RemoveUserFromBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveUserFromBudgetReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).RemoveUserFromBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_RemoveUserFromBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).RemoveUserFromBudget(ctx, req.(*RemoveUserFromBudgetReq)) } return interceptor(ctx, in, info, handler) } func _SmmCore_AddCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCategoryReq) + in := new(AddCategoryReq) if err := dec(in); err != nil { return nil, err } @@ -203,7 +549,7 @@ func _SmmCore_AddCategory_Handler(srv interface{}, ctx context.Context, dec func FullMethod: SmmCore_AddCategory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SmmCoreServer).AddCategory(ctx, req.(*CreateCategoryReq)) + return srv.(SmmCoreServer).AddCategory(ctx, req.(*AddCategoryReq)) } return interceptor(ctx, in, info, handler) } @@ -227,7 +573,7 @@ func _SmmCore_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec f } func _SmmCore_GetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CategoryFilterReq) + in := new(GetCategoriesReq) if err := dec(in); err != nil { return nil, err } @@ -239,7 +585,79 @@ func _SmmCore_GetCategories_Handler(srv interface{}, ctx context.Context, dec fu FullMethod: SmmCore_GetCategories_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SmmCoreServer).GetCategories(ctx, req.(*CategoryFilterReq)) + return srv.(SmmCoreServer).GetCategories(ctx, req.(*GetCategoriesReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_DeleteCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteCategoriesReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).DeleteCategories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_DeleteCategories_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).DeleteCategories(ctx, req.(*DeleteCategoriesReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_AddPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddPositionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).AddPosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_AddPosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).AddPosition(ctx, req.(*AddPositionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_DeletePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePositionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).DeletePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_DeletePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).DeletePosition(ctx, req.(*DeletePositionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SmmCore_GetCategoriesStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCategoriesStatReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).GetCategoriesStat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_GetCategoriesStat_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).GetCategoriesStat(ctx, req.(*GetCategoriesStatReq)) } return interceptor(ctx, in, info, handler) } @@ -259,6 +677,38 @@ var SmmCore_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddUser", Handler: _SmmCore_AddUser_Handler, }, + { + MethodName: "Login", + Handler: _SmmCore_Login_Handler, + }, + { + MethodName: "AddBudget", + Handler: _SmmCore_AddBudget_Handler, + }, + { + MethodName: "UpdateBudget", + Handler: _SmmCore_UpdateBudget_Handler, + }, + { + MethodName: "GetBudgets", + Handler: _SmmCore_GetBudgets_Handler, + }, + { + MethodName: "DeleteBudget", + Handler: _SmmCore_DeleteBudget_Handler, + }, + { + MethodName: "AddUserToBudget", + Handler: _SmmCore_AddUserToBudget_Handler, + }, + { + MethodName: "GetBudgetUsers", + Handler: _SmmCore_GetBudgetUsers_Handler, + }, + { + MethodName: "RemoveUserFromBudget", + Handler: _SmmCore_RemoveUserFromBudget_Handler, + }, { MethodName: "AddCategory", Handler: _SmmCore_AddCategory_Handler, @@ -271,6 +721,22 @@ var SmmCore_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCategories", Handler: _SmmCore_GetCategories_Handler, }, + { + MethodName: "DeleteCategories", + Handler: _SmmCore_DeleteCategories_Handler, + }, + { + MethodName: "AddPosition", + Handler: _SmmCore_AddPosition_Handler, + }, + { + MethodName: "DeletePosition", + Handler: _SmmCore_DeletePosition_Handler, + }, + { + MethodName: "GetCategoriesStat", + Handler: _SmmCore_GetCategoriesStat_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "smm_core.proto", diff --git a/resources/smm_core.swagger.json b/resources/smm_core.swagger.json index 49fb046..9eb7195 100644 --- a/resources/smm_core.swagger.json +++ b/resources/smm_core.swagger.json @@ -16,6 +16,228 @@ "application/json" ], "paths": { + "/budgets": { + "get": { + "operationId": "SmmCore_GetBudgets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudgets" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "SmmCore" + ] + }, + "post": { + "summary": "budgets", + "operationId": "SmmCore_AddBudget", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/smm_coreAddBudgetReq" + } + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/budgets/{budgetId}/users": { + "put": { + "summary": "budget users", + "operationId": "SmmCore_AddUserToBudget", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "budgetId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "userId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/budgets/{budgetId}/users/{userId}": { + "delete": { + "operationId": "SmmCore_RemoveUserFromBudget", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "budgetId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "userId", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/budgets/{id}": { + "delete": { + "operationId": "SmmCore_DeleteBudget", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + }, + "put": { + "operationId": "SmmCore_UpdateBudget", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreBudget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SmmCoreUpdateBudgetBody" + } + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/budgets/{id}/users": { + "get": { + "operationId": "SmmCore_GetBudgetUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreUsers" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + } + }, "/categories": { "get": { "operationId": "SmmCore_GetCategories", @@ -39,6 +261,13 @@ "in": "query", "required": false, "type": "boolean" + }, + { + "name": "budgetId", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" } ], "tags": [ @@ -68,7 +297,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/smm_coreCreateCategoryReq" + "$ref": "#/definitions/smm_coreAddCategoryReq" } } ], @@ -78,6 +307,34 @@ } }, "/categories/{id}": { + "delete": { + "operationId": "SmmCore_DeleteCategories", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + }, "put": { "operationId": "SmmCore_UpdateCategory", "responses": { @@ -99,8 +356,7 @@ "name": "id", "in": "path", "required": true, - "type": "integer", - "format": "int32" + "type": "string" }, { "name": "name", @@ -127,8 +383,41 @@ ] } }, + "/login": { + "post": { + "operationId": "SmmCore_Login", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreUser" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/smm_coreLoginReq" + } + } + ], + "tags": [ + "SmmCore" + ] + } + }, "/ping": { "get": { + "summary": "ping", "operationId": "SmmCore_Ping", "responses": { "200": { @@ -149,6 +438,105 @@ ] } }, + "/positions": { + "post": { + "summary": "positions", + "operationId": "SmmCore_AddPosition", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_corePosition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/smm_coreAddPositionReq" + } + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/positions/{id}": { + "delete": { + "operationId": "SmmCore_DeletePosition", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_corePosition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "SmmCore" + ] + } + }, + "/stat": { + "get": { + "summary": "stat", + "operationId": "SmmCore_GetCategoriesStat", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreCategoriesStat" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "ids", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi" + } + ], + "tags": [ + "SmmCore" + ] + } + }, "/users": { "post": { "summary": "users", @@ -173,7 +561,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/smm_coreCreateUserReq" + "$ref": "#/definitions/smm_coreAddUserReq" } } ], @@ -184,6 +572,22 @@ } }, "definitions": { + "SmmCoreUpdateBudgetBody": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "startDay": { + "type": "integer", + "format": "int32" + }, + "monthlyLimit": { + "type": "integer", + "format": "int32" + } + } + }, "protobufAny": { "type": "object", "properties": { @@ -212,6 +616,103 @@ } } }, + "smm_coreAddBudgetReq": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "startDay": { + "type": "integer", + "format": "int32" + }, + "monthlyLimit": { + "type": "integer", + "format": "int32" + } + } + }, + "smm_coreAddCategoryReq": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "budgetId": { + "type": "integer", + "format": "int32" + }, + "favorite": { + "type": "boolean" + }, + "monthlyLimit": { + "type": "integer", + "format": "int32" + } + } + }, + "smm_coreAddPositionReq": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "price": { + "type": "integer", + "format": "int32" + }, + "amount": { + "type": "number", + "format": "float" + }, + "categoryId": { + "type": "integer", + "format": "int32" + } + } + }, + "smm_coreAddUserReq": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "smm_coreBudget": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "startDay": { + "type": "integer", + "format": "int32" + }, + "monthlyLimit": { + "type": "integer", + "format": "int32" + } + } + }, + "smm_coreBudgets": { + "type": "object", + "properties": { + "budgets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/smm_coreBudget" + } + } + } + }, "smm_coreCategories": { "type": "object", "properties": { @@ -224,16 +725,31 @@ } } }, + "smm_coreCategoriesStat": { + "type": "object", + "properties": { + "stat": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/smm_coreCategoriesStat" + } + } + } + }, "smm_coreCategory": { "type": "object", "properties": { "id": { - "type": "integer", - "format": "int32" + "type": "string" }, "name": { "type": "string" }, + "budgetId": { + "type": "integer", + "format": "int32" + }, "favorite": { "type": "boolean" }, @@ -243,22 +759,7 @@ } } }, - "smm_coreCreateCategoryReq": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "favorite": { - "type": "boolean" - }, - "monthlyLimit": { - "type": "integer", - "format": "int32" - } - } - }, - "smm_coreCreateUserReq": { + "smm_coreLoginReq": { "type": "object", "properties": { "username": { @@ -272,17 +773,47 @@ "smm_corePingRsp": { "type": "object" }, + "smm_corePosition": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer", + "format": "int32" + }, + "amount": { + "type": "number", + "format": "float" + } + } + }, "smm_coreUser": { "type": "object", "properties": { "id": { - "type": "integer", - "format": "int32" + "type": "string" }, "username": { "type": "string" } } + }, + "smm_coreUsers": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/smm_coreUser" + } + } + } } } }