This commit is contained in:
2024-11-19 15:13:01 +07:00
parent 55ee2bccbc
commit be0ce71de6
5 changed files with 1003 additions and 33 deletions
+383 -27
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.35.1
// protoc-gen-go v1.35.2
// protoc v5.27.2
// source: smm_core.proto
@@ -9,7 +9,6 @@ package proto
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/httpbody"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -95,26 +94,371 @@ func (*PingRsp) Descriptor() ([]byte, []int) {
return file_smm_core_proto_rawDescGZIP(), []int{1}
}
type CreateCategoryReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
UserId int32 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_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 *CreateCategoryReq) Reset() {
*x = CreateCategoryReq{}
mi := &file_smm_core_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateCategoryReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateCategoryReq) ProtoMessage() {}
func (x *CreateCategoryReq) ProtoReflect() protoreflect.Message {
mi := &file_smm_core_proto_msgTypes[2]
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 CreateCategoryReq.ProtoReflect.Descriptor instead.
func (*CreateCategoryReq) Descriptor() ([]byte, []int) {
return file_smm_core_proto_rawDescGZIP(), []int{2}
}
func (x *CreateCategoryReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CreateCategoryReq) GetUserId() int32 {
if x != nil {
return x.UserId
}
return 0
}
func (x *CreateCategoryReq) GetFavorite() bool {
if x != nil {
return x.Favorite
}
return false
}
func (x *CreateCategoryReq) GetMonthlyLimit() int32 {
if x != nil {
return x.MonthlyLimit
}
return 0
}
type UpdateCategoryReq 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,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 *UpdateCategoryReq) Reset() {
*x = UpdateCategoryReq{}
mi := &file_smm_core_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateCategoryReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateCategoryReq) ProtoMessage() {}
func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message {
mi := &file_smm_core_proto_msgTypes[3]
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 UpdateCategoryReq.ProtoReflect.Descriptor instead.
func (*UpdateCategoryReq) Descriptor() ([]byte, []int) {
return file_smm_core_proto_rawDescGZIP(), []int{3}
}
func (x *UpdateCategoryReq) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *UpdateCategoryReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *UpdateCategoryReq) GetFavorite() bool {
if x != nil {
return x.Favorite
}
return false
}
func (x *UpdateCategoryReq) GetMonthlyLimit() int32 {
if x != nil {
return x.MonthlyLimit
}
return 0
}
type Category 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"`
}
func (x *Category) Reset() {
*x = Category{}
mi := &file_smm_core_proto_msgTypes[4]
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[4]
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{4}
}
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 {
if x != nil {
return x.Favorite
}
return false
}
func (x *Category) GetMonthlyLimit() int32 {
if x != nil {
return x.MonthlyLimit
}
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[5]
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[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 CategoryFilterReq.ProtoReflect.Descriptor instead.
func (*CategoryFilterReq) Descriptor() ([]byte, []int) {
return file_smm_core_proto_rawDescGZIP(), []int{5}
}
func (x *CategoryFilterReq) GetFavorite() bool {
if x != nil {
return x.Favorite
}
return false
}
type Categories struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Categories []*Category `protobuf:"bytes,1,rep,name=categories,proto3" json:"categories,omitempty"`
}
func (x *Categories) Reset() {
*x = Categories{}
mi := &file_smm_core_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Categories) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Categories) ProtoMessage() {}
func (x *Categories) 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 Categories.ProtoReflect.Descriptor instead.
func (*Categories) Descriptor() ([]byte, []int) {
return file_smm_core_proto_rawDescGZIP(), []int{6}
}
func (x *Categories) GetCategories() []*Category {
if x != nil {
return x.Categories
}
return nil
}
var File_smm_core_proto protoreflect.FileDescriptor
var file_smm_core_proto_rawDesc = []byte{
0x0a, 0x0e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65,
0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x62,
0x6f, 0x64, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f,
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e,
0x67, 0x52, 0x65, 0x71, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x32,
0x52, 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, 0x42, 0x0e, 0x92, 0x41, 0x00, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61,
0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x09,
0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e,
0x67, 0x52, 0x73, 0x70, 0x22, 0x81, 0x01, 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, 0x17,
0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x75, 0x73, 0x65, 0x72, 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, 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, 0x81, 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, 0x5f, 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, 0x13, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x0d, 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,
}
var (
@@ -129,19 +473,31 @@ func file_smm_core_proto_rawDescGZIP() []byte {
return file_smm_core_proto_rawDescData
}
var file_smm_core_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_smm_core_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_smm_core_proto_goTypes = []any{
(*PingReq)(nil), // 0: crabs.smm_core.PingReq
(*PingRsp)(nil), // 1: crabs.smm_core.PingRsp
(*PingReq)(nil), // 0: crabs.smm_core.PingReq
(*PingRsp)(nil), // 1: crabs.smm_core.PingRsp
(*CreateCategoryReq)(nil), // 2: crabs.smm_core.CreateCategoryReq
(*UpdateCategoryReq)(nil), // 3: crabs.smm_core.UpdateCategoryReq
(*Category)(nil), // 4: crabs.smm_core.Category
(*CategoryFilterReq)(nil), // 5: crabs.smm_core.CategoryFilterReq
(*Categories)(nil), // 6: crabs.smm_core.Categories
}
var file_smm_core_proto_depIdxs = []int32{
0, // 0: crabs.smm_core.SmmCore.Ping:input_type -> crabs.smm_core.PingReq
1, // 1: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
4, // 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.AddCategory:input_type -> crabs.smm_core.CreateCategoryReq
3, // 3: crabs.smm_core.SmmCore.UpdateCategory:input_type -> crabs.smm_core.UpdateCategoryReq
5, // 4: crabs.smm_core.SmmCore.GetCategories:input_type -> crabs.smm_core.CategoryFilterReq
1, // 5: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp
4, // 6: crabs.smm_core.SmmCore.AddCategory:output_type -> crabs.smm_core.Category
4, // 7: crabs.smm_core.SmmCore.UpdateCategory:output_type -> crabs.smm_core.Category
6, // 8: crabs.smm_core.SmmCore.GetCategories:output_type -> crabs.smm_core.Categories
5, // [5:9] is the sub-list for method output_type
1, // [1:5] 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
}
func init() { file_smm_core_proto_init() }
@@ -155,7 +511,7 @@ func file_smm_core_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_smm_core_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
+295
View File
@@ -49,6 +49,148 @@ func local_request_SmmCore_Ping_0(ctx context.Context, marshaler runtime.Marshal
}
var (
filter_SmmCore_AddCategory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
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 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_AddCategory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AddCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
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 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_AddCategory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AddCategory(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_SmmCore_UpdateCategory_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
func request_SmmCore_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateCategoryReq
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.Int32(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "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_UpdateCategory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.UpdateCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_SmmCore_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateCategoryReq
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.Int32(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "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_UpdateCategory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.UpdateCategory(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_SmmCore_GetCategories_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
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 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_GetCategories_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
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 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_GetCategories_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetCategories(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.
@@ -81,6 +223,81 @@ func RegisterSmmCoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, se
})
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()
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/AddCategory", runtime.WithHTTPPathPattern("/categories"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_SmmCore_AddCategory_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_AddCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_SmmCore_UpdateCategory_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/UpdateCategory", runtime.WithHTTPPathPattern("/categories/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_SmmCore_UpdateCategory_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_UpdateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_SmmCore_GetCategories_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/GetCategories", runtime.WithHTTPPathPattern("/categories"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_SmmCore_GetCategories_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_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -144,13 +361,91 @@ func RegisterSmmCoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
})
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()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/crabs.smm_core.SmmCore/AddCategory", runtime.WithHTTPPathPattern("/categories"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SmmCore_AddCategory_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_AddCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_SmmCore_UpdateCategory_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/UpdateCategory", runtime.WithHTTPPathPattern("/categories/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SmmCore_UpdateCategory_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_UpdateCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_SmmCore_GetCategories_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/GetCategories", runtime.WithHTTPPathPattern("/categories"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SmmCore_GetCategories_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_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_SmmCore_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ping"}, ""))
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"}, ""))
)
var (
forward_SmmCore_Ping_0 = runtime.ForwardResponseMessage
forward_SmmCore_AddCategory_0 = runtime.ForwardResponseMessage
forward_SmmCore_UpdateCategory_0 = runtime.ForwardResponseMessage
forward_SmmCore_GetCategories_0 = runtime.ForwardResponseMessage
)
+117 -1
View File
@@ -19,7 +19,10 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
SmmCore_Ping_FullMethodName = "/crabs.smm_core.SmmCore/Ping"
SmmCore_Ping_FullMethodName = "/crabs.smm_core.SmmCore/Ping"
SmmCore_AddCategory_FullMethodName = "/crabs.smm_core.SmmCore/AddCategory"
SmmCore_UpdateCategory_FullMethodName = "/crabs.smm_core.SmmCore/UpdateCategory"
SmmCore_GetCategories_FullMethodName = "/crabs.smm_core.SmmCore/GetCategories"
)
// SmmCoreClient is the client API for SmmCore service.
@@ -27,6 +30,10 @@ const (
// 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(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error)
// categories
AddCategory(ctx context.Context, in *CreateCategoryReq, 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)
}
type smmCoreClient struct {
@@ -47,11 +54,45 @@ func (c *smmCoreClient) Ping(ctx context.Context, in *PingReq, opts ...grpc.Call
return out, nil
}
func (c *smmCoreClient) AddCategory(ctx context.Context, in *CreateCategoryReq, 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...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *smmCoreClient) UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*Category, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Category)
err := c.cc.Invoke(ctx, SmmCore_UpdateCategory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *smmCoreClient) GetCategories(ctx context.Context, in *CategoryFilterReq, 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...)
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(context.Context, *PingReq) (*PingRsp, error)
// categories
AddCategory(context.Context, *CreateCategoryReq) (*Category, error)
UpdateCategory(context.Context, *UpdateCategoryReq) (*Category, error)
GetCategories(context.Context, *CategoryFilterReq) (*Categories, error)
mustEmbedUnimplementedSmmCoreServer()
}
@@ -65,6 +106,15 @@ type UnimplementedSmmCoreServer struct{}
func (UnimplementedSmmCoreServer) Ping(context.Context, *PingReq) (*PingRsp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedSmmCoreServer) AddCategory(context.Context, *CreateCategoryReq) (*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) {
return nil, status.Errorf(codes.Unimplemented, "method GetCategories not implemented")
}
func (UnimplementedSmmCoreServer) mustEmbedUnimplementedSmmCoreServer() {}
func (UnimplementedSmmCoreServer) testEmbeddedByValue() {}
@@ -104,6 +154,60 @@ func _SmmCore_Ping_Handler(srv interface{}, ctx context.Context, dec func(interf
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)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SmmCoreServer).AddCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SmmCore_AddCategory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SmmCoreServer).AddCategory(ctx, req.(*CreateCategoryReq))
}
return interceptor(ctx, in, info, handler)
}
func _SmmCore_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateCategoryReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SmmCoreServer).UpdateCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SmmCore_UpdateCategory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SmmCoreServer).UpdateCategory(ctx, req.(*UpdateCategoryReq))
}
return interceptor(ctx, in, info, handler)
}
func _SmmCore_GetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CategoryFilterReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SmmCoreServer).GetCategories(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SmmCore_GetCategories_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SmmCoreServer).GetCategories(ctx, req.(*CategoryFilterReq))
}
return interceptor(ctx, in, info, handler)
}
// SmmCore_ServiceDesc is the grpc.ServiceDesc for SmmCore service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -115,6 +219,18 @@ var SmmCore_ServiceDesc = grpc.ServiceDesc{
MethodName: "Ping",
Handler: _SmmCore_Ping_Handler,
},
{
MethodName: "AddCategory",
Handler: _SmmCore_AddCategory_Handler,
},
{
MethodName: "UpdateCategory",
Handler: _SmmCore_UpdateCategory_Handler,
},
{
MethodName: "GetCategories",
Handler: _SmmCore_GetCategories_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "smm_core.proto",