You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2188 lines
55 KiB

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api/v1/category.proto
package v1
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
math_bits "math/bits"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 文档分类
type Category struct {
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
ParentId int32 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty" validate:"required"`
DocCount int32 `protobuf:"varint,4,opt,name=doc_count,json=docCount,proto3" json:"doc_count,omitempty"`
Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"`
Enable bool `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"`
Cover string `protobuf:"bytes,9,opt,name=cover,proto3" json:"cover,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"`
Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"`
ShowDescription bool `protobuf:"varint,12,opt,name=show_description,json=showDescription,proto3" json:"show_description,omitempty"`
}
func (m *Category) Reset() { *m = Category{} }
func (m *Category) String() string { return proto.CompactTextString(m) }
func (*Category) ProtoMessage() {}
func (*Category) Descriptor() ([]byte, []int) {
return fileDescriptor_1f1bb9165c79c987, []int{0}
}
func (m *Category) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Category) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Category.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Category) XXX_Merge(src proto.Message) {
xxx_messageInfo_Category.Merge(m, src)
}
func (m *Category) XXX_Size() int {
return m.Size()
}
func (m *Category) XXX_DiscardUnknown() {
xxx_messageInfo_Category.DiscardUnknown(m)
}
var xxx_messageInfo_Category proto.InternalMessageInfo
func (m *Category) GetId() int32 {
if m != nil {
return m.Id
}
return 0
}
func (m *Category) GetParentId() int32 {
if m != nil {
return m.ParentId
}
return 0
}
func (m *Category) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *Category) GetDocCount() int32 {
if m != nil {
return m.DocCount
}
return 0
}
func (m *Category) GetSort() int32 {
if m != nil {
return m.Sort
}
return 0
}
func (m *Category) GetEnable() bool {
if m != nil {
return m.Enable
}
return false
}
func (m *Category) GetCover() string {
if m != nil {
return m.Cover
}
return ""
}
func (m *Category) GetCreatedAt() *time.Time {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Category) GetUpdatedAt() *time.Time {
if m != nil {
return m.UpdatedAt
}
return nil
}
func (m *Category) GetIcon() string {
if m != nil {
return m.Icon
}
return ""
}
func (m *Category) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *Category) GetShowDescription() bool {
if m != nil {
return m.ShowDescription
}
return false
}
// 分类列表请求
type ListCategoryRequest struct {
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
ParentId []int64 `protobuf:"varint,3,rep,packed,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
Wd string `protobuf:"bytes,4,opt,name=wd,proto3" json:"wd,omitempty"`
Enable []bool `protobuf:"varint,5,rep,packed,name=enable,proto3" json:"enable,omitempty"`
Field []string `protobuf:"bytes,6,rep,name=field,proto3" json:"field,omitempty"`
}
func (m *ListCategoryRequest) Reset() { *m = ListCategoryRequest{} }
func (m *ListCategoryRequest) String() string { return proto.CompactTextString(m) }
func (*ListCategoryRequest) ProtoMessage() {}
func (*ListCategoryRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_1f1bb9165c79c987, []int{1}
}
func (m *ListCategoryRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ListCategoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ListCategoryRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ListCategoryRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListCategoryRequest.Merge(m, src)
}
func (m *ListCategoryRequest) XXX_Size() int {
return m.Size()
}
func (m *ListCategoryRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListCategoryRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListCategoryRequest proto.InternalMessageInfo
func (m *ListCategoryRequest) GetPage() int64 {
if m != nil {
return m.Page
}
return 0
}
func (m *ListCategoryRequest) GetSize_() int64 {
if m != nil {
return m.Size_
}
return 0
}
func (m *ListCategoryRequest) GetParentId() []int64 {
if m != nil {
return m.ParentId
}
return nil
}
func (m *ListCategoryRequest) GetWd() string {
if m != nil {
return m.Wd
}
return ""
}
func (m *ListCategoryRequest) GetEnable() []bool {
if m != nil {
return m.Enable
}
return nil
}
func (m *ListCategoryRequest) GetField() []string {
if m != nil {
return m.Field
}
return nil
}
// 分类列表响应
type ListCategoryReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Category []*Category `protobuf:"bytes,2,rep,name=category,proto3" json:"category,omitempty"`
}
func (m *ListCategoryReply) Reset() { *m = ListCategoryReply{} }
func (m *ListCategoryReply) String() string { return proto.CompactTextString(m) }
func (*ListCategoryReply) ProtoMessage() {}
func (*ListCategoryReply) Descriptor() ([]byte, []int) {
return fileDescriptor_1f1bb9165c79c987, []int{2}
}
func (m *ListCategoryReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ListCategoryReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ListCategoryReply.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ListCategoryReply) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListCategoryReply.Merge(m, src)
}
func (m *ListCategoryReply) XXX_Size() int {
return m.Size()
}
func (m *ListCategoryReply) XXX_DiscardUnknown() {
xxx_messageInfo_ListCategoryReply.DiscardUnknown(m)
}
var xxx_messageInfo_ListCategoryReply proto.InternalMessageInfo
func (m *ListCategoryReply) GetTotal() int64 {
if m != nil {
return m.Total
}
return 0
}
func (m *ListCategoryReply) GetCategory() []*Category {
if m != nil {
return m.Category
}
return nil
}
// 删除分类请求
type DeleteCategoryRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
func (m *DeleteCategoryRequest) Reset() { *m = DeleteCategoryRequest{} }
func (m *DeleteCategoryRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteCategoryRequest) ProtoMessage() {}
func (*DeleteCategoryRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_1f1bb9165c79c987, []int{3}
}
func (m *DeleteCategoryRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *DeleteCategoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_DeleteCategoryRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *DeleteCategoryRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteCategoryRequest.Merge(m, src)
}
func (m *DeleteCategoryRequest) XXX_Size() int {
return m.Size()
}
func (m *DeleteCategoryRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteCategoryRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteCategoryRequest proto.InternalMessageInfo
func (m *DeleteCategoryRequest) GetId() []int64 {
if m != nil {
return m.Id
}
return nil
}
// 获取分类请求
type GetCategoryRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (m *GetCategoryRequest) Reset() { *m = GetCategoryRequest{} }
func (m *GetCategoryRequest) String() string { return proto.CompactTextString(m) }
func (*GetCategoryRequest) ProtoMessage() {}
func (*GetCategoryRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_1f1bb9165c79c987, []int{4}
}
func (m *GetCategoryRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GetCategoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GetCategoryRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *GetCategoryRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetCategoryRequest.Merge(m, src)
}
func (m *GetCategoryRequest) XXX_Size() int {
return m.Size()
}
func (m *GetCategoryRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetCategoryRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetCategoryRequest proto.InternalMessageInfo
func (m *GetCategoryRequest) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func init() {
proto.RegisterType((*Category)(nil), "api.v1.Category")
proto.RegisterType((*ListCategoryRequest)(nil), "api.v1.ListCategoryRequest")
proto.RegisterType((*ListCategoryReply)(nil), "api.v1.ListCategoryReply")
proto.RegisterType((*DeleteCategoryRequest)(nil), "api.v1.DeleteCategoryRequest")
proto.RegisterType((*GetCategoryRequest)(nil), "api.v1.GetCategoryRequest")
}
func init() { proto.RegisterFile("api/v1/category.proto", fileDescriptor_1f1bb9165c79c987) }
var fileDescriptor_1f1bb9165c79c987 = []byte{
// 690 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6e, 0xd3, 0x4e,
0x10, 0xae, 0xed, 0x26, 0xbf, 0x64, 0x53, 0xe5, 0xd7, 0x6e, 0x9b, 0xd6, 0x38, 0x34, 0xb5, 0x2c,
0x24, 0x42, 0x05, 0xb6, 0x5a, 0xc4, 0xa5, 0x1c, 0x50, 0xff, 0x20, 0x54, 0x89, 0x43, 0x65, 0x51,
0x55, 0xe2, 0x12, 0x6d, 0xbd, 0xd3, 0xb0, 0x92, 0xe3, 0x75, 0xed, 0x4d, 0xaa, 0x72, 0xe4, 0x09,
0x2a, 0x71, 0xe1, 0x11, 0x78, 0x14, 0x8e, 0x95, 0xb8, 0x70, 0x82, 0xaa, 0xe5, 0x09, 0x78, 0x02,
0xb4, 0x6b, 0xbb, 0xe4, 0x5f, 0x25, 0xc4, 0x6d, 0x66, 0x3c, 0xf3, 0xcd, 0xcc, 0x37, 0xdf, 0x1a,
0x35, 0x48, 0xcc, 0xbc, 0xc1, 0x86, 0x17, 0x10, 0x01, 0x5d, 0x9e, 0x9c, 0xbb, 0x71, 0x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x04, 0x28, 0x0f, 0x72, 0x84, 0xe7, 0x83, 0x8d, 0xe3,
0xb2, 0xa2, 0xe7, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0xb7, 0x49, 0x9f, 0xa1, 0x05,
0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// CategoryAPIClient is the client API for CategoryAPI service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type CategoryAPIClient interface {
// 创建分类
CreateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 更新分类
UpdateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除分类
DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 获取分类
GetCategory(ctx context.Context, in *GetCategoryRequest, opts ...grpc.CallOption) (*Category, error)
// 分类列表
ListCategory(ctx context.Context, in *ListCategoryRequest, opts ...grpc.CallOption) (*ListCategoryReply, error)
}
type categoryAPIClient struct {
cc *grpc.ClientConn
}
func NewCategoryAPIClient(cc *grpc.ClientConn) CategoryAPIClient {
return &categoryAPIClient{cc}
}
func (c *categoryAPIClient) CreateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/api.v1.CategoryAPI/CreateCategory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryAPIClient) UpdateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/api.v1.CategoryAPI/UpdateCategory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryAPIClient) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/api.v1.CategoryAPI/DeleteCategory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryAPIClient) GetCategory(ctx context.Context, in *GetCategoryRequest, opts ...grpc.CallOption) (*Category, error) {
out := new(Category)
err := c.cc.Invoke(ctx, "/api.v1.CategoryAPI/GetCategory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryAPIClient) ListCategory(ctx context.Context, in *ListCategoryRequest, opts ...grpc.CallOption) (*ListCategoryReply, error) {
out := new(ListCategoryReply)
err := c.cc.Invoke(ctx, "/api.v1.CategoryAPI/ListCategory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CategoryAPIServer is the server API for CategoryAPI service.
type CategoryAPIServer interface {
// 创建分类
CreateCategory(context.Context, *Category) (*emptypb.Empty, error)
// 更新分类
UpdateCategory(context.Context, *Category) (*emptypb.Empty, error)
// 删除分类
DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error)
// 获取分类
GetCategory(context.Context, *GetCategoryRequest) (*Category, error)
// 分类列表
ListCategory(context.Context, *ListCategoryRequest) (*ListCategoryReply, error)
}
// UnimplementedCategoryAPIServer can be embedded to have forward compatible implementations.
type UnimplementedCategoryAPIServer struct {
}
func (*UnimplementedCategoryAPIServer) CreateCategory(ctx context.Context, req *Category) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented")
}
func (*UnimplementedCategoryAPIServer) UpdateCategory(ctx context.Context, req *Category) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented")
}
func (*UnimplementedCategoryAPIServer) DeleteCategory(ctx context.Context, req *DeleteCategoryRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented")
}
func (*UnimplementedCategoryAPIServer) GetCategory(ctx context.Context, req *GetCategoryRequest) (*Category, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCategory not implemented")
}
func (*UnimplementedCategoryAPIServer) ListCategory(ctx context.Context, req *ListCategoryRequest) (*ListCategoryReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListCategory not implemented")
}
func RegisterCategoryAPIServer(s *grpc.Server, srv CategoryAPIServer) {
s.RegisterService(&_CategoryAPI_serviceDesc, srv)
}
func _CategoryAPI_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Category)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryAPIServer).CreateCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.CategoryAPI/CreateCategory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryAPIServer).CreateCategory(ctx, req.(*Category))
}
return interceptor(ctx, in, info, handler)
}
func _CategoryAPI_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Category)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryAPIServer).UpdateCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.CategoryAPI/UpdateCategory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryAPIServer).UpdateCategory(ctx, req.(*Category))
}
return interceptor(ctx, in, info, handler)
}
func _CategoryAPI_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryAPIServer).DeleteCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.CategoryAPI/DeleteCategory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryAPIServer).DeleteCategory(ctx, req.(*DeleteCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CategoryAPI_GetCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryAPIServer).GetCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.CategoryAPI/GetCategory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryAPIServer).GetCategory(ctx, req.(*GetCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CategoryAPI_ListCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryAPIServer).ListCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.CategoryAPI/ListCategory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryAPIServer).ListCategory(ctx, req.(*ListCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
var _CategoryAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.CategoryAPI",
HandlerType: (*CategoryAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateCategory",
Handler: _CategoryAPI_CreateCategory_Handler,
},
{
MethodName: "UpdateCategory",
Handler: _CategoryAPI_UpdateCategory_Handler,
},
{
MethodName: "DeleteCategory",
Handler: _CategoryAPI_DeleteCategory_Handler,
},
{
MethodName: "GetCategory",
Handler: _CategoryAPI_GetCategory_Handler,
},
{
MethodName: "ListCategory",
Handler: _CategoryAPI_ListCategory_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v1/category.proto",
}
func (m *Category) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Category) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Category) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.ShowDescription {
i--
if m.ShowDescription {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x60
}
if len(m.Description) > 0 {
i -= len(m.Description)
copy(dAtA[i:], m.Description)
i = encodeVarintCategory(dAtA, i, uint64(len(m.Description)))
i--
dAtA[i] = 0x5a
}
if len(m.Icon) > 0 {
i -= len(m.Icon)
copy(dAtA[i:], m.Icon)
i = encodeVarintCategory(dAtA, i, uint64(len(m.Icon)))
i--
dAtA[i] = 0x52
}
if len(m.Cover) > 0 {
i -= len(m.Cover)
copy(dAtA[i:], m.Cover)
i = encodeVarintCategory(dAtA, i, uint64(len(m.Cover)))
i--
dAtA[i] = 0x4a
}
if m.UpdatedAt != nil {
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintCategory(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x42
}
if m.CreatedAt != nil {
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintCategory(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x3a
}
if m.Enable {
i--
if m.Enable {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x30
}
if m.Sort != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Sort))
i--
dAtA[i] = 0x28
}
if m.DocCount != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.DocCount))
i--
dAtA[i] = 0x20
}
if len(m.Title) > 0 {
i -= len(m.Title)
copy(dAtA[i:], m.Title)
i = encodeVarintCategory(dAtA, i, uint64(len(m.Title)))
i--
dAtA[i] = 0x1a
}
if m.ParentId != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.ParentId))
i--
dAtA[i] = 0x10
}
if m.Id != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *ListCategoryRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ListCategoryRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListCategoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Field) > 0 {
for iNdEx := len(m.Field) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Field[iNdEx])
copy(dAtA[i:], m.Field[iNdEx])
i = encodeVarintCategory(dAtA, i, uint64(len(m.Field[iNdEx])))
i--
dAtA[i] = 0x32
}
}
if len(m.Enable) > 0 {
for iNdEx := len(m.Enable) - 1; iNdEx >= 0; iNdEx-- {
i--
if m.Enable[iNdEx] {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
}
i = encodeVarintCategory(dAtA, i, uint64(len(m.Enable)))
i--
dAtA[i] = 0x2a
}
if len(m.Wd) > 0 {
i -= len(m.Wd)
copy(dAtA[i:], m.Wd)
i = encodeVarintCategory(dAtA, i, uint64(len(m.Wd)))
i--
dAtA[i] = 0x22
}
if len(m.ParentId) > 0 {
dAtA4 := make([]byte, len(m.ParentId)*10)
var j3 int
for _, num1 := range m.ParentId {
num := uint64(num1)
for num >= 1<<7 {
dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j3++
}
dAtA4[j3] = uint8(num)
j3++
}
i -= j3
copy(dAtA[i:], dAtA4[:j3])
i = encodeVarintCategory(dAtA, i, uint64(j3))
i--
dAtA[i] = 0x1a
}
if m.Size_ != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Size_))
i--
dAtA[i] = 0x10
}
if m.Page != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Page))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *ListCategoryReply) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ListCategoryReply) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListCategoryReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Category) > 0 {
for iNdEx := len(m.Category) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Category[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintCategory(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
if m.Total != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Total))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *DeleteCategoryRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DeleteCategoryRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteCategoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Id) > 0 {
dAtA6 := make([]byte, len(m.Id)*10)
var j5 int
for _, num1 := range m.Id {
num := uint64(num1)
for num >= 1<<7 {
dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j5++
}
dAtA6[j5] = uint8(num)
j5++
}
i -= j5
copy(dAtA[i:], dAtA6[:j5])
i = encodeVarintCategory(dAtA, i, uint64(j5))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *GetCategoryRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GetCategoryRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetCategoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Id != 0 {
i = encodeVarintCategory(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintCategory(dAtA []byte, offset int, v uint64) int {
offset -= sovCategory(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Category) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovCategory(uint64(m.Id))
}
if m.ParentId != 0 {
n += 1 + sovCategory(uint64(m.ParentId))
}
l = len(m.Title)
if l > 0 {
n += 1 + l + sovCategory(uint64(l))
}
if m.DocCount != 0 {
n += 1 + sovCategory(uint64(m.DocCount))
}
if m.Sort != 0 {
n += 1 + sovCategory(uint64(m.Sort))
}
if m.Enable {
n += 2
}
if m.CreatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
n += 1 + l + sovCategory(uint64(l))
}
if m.UpdatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
n += 1 + l + sovCategory(uint64(l))
}
l = len(m.Cover)
if l > 0 {
n += 1 + l + sovCategory(uint64(l))
}
l = len(m.Icon)
if l > 0 {
n += 1 + l + sovCategory(uint64(l))
}
l = len(m.Description)
if l > 0 {
n += 1 + l + sovCategory(uint64(l))
}
if m.ShowDescription {
n += 2
}
return n
}
func (m *ListCategoryRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Page != 0 {
n += 1 + sovCategory(uint64(m.Page))
}
if m.Size_ != 0 {
n += 1 + sovCategory(uint64(m.Size_))
}
if len(m.ParentId) > 0 {
l = 0
for _, e := range m.ParentId {
l += sovCategory(uint64(e))
}
n += 1 + sovCategory(uint64(l)) + l
}
l = len(m.Wd)
if l > 0 {
n += 1 + l + sovCategory(uint64(l))
}
if len(m.Enable) > 0 {
n += 1 + sovCategory(uint64(len(m.Enable))) + len(m.Enable)*1
}
if len(m.Field) > 0 {
for _, s := range m.Field {
l = len(s)
n += 1 + l + sovCategory(uint64(l))
}
}
return n
}
func (m *ListCategoryReply) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Total != 0 {
n += 1 + sovCategory(uint64(m.Total))
}
if len(m.Category) > 0 {
for _, e := range m.Category {
l = e.Size()
n += 1 + l + sovCategory(uint64(l))
}
}
return n
}
func (m *DeleteCategoryRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Id) > 0 {
l = 0
for _, e := range m.Id {
l += sovCategory(uint64(e))
}
n += 1 + sovCategory(uint64(l)) + l
}
return n
}
func (m *GetCategoryRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovCategory(uint64(m.Id))
}
return n
}
func sovCategory(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozCategory(x uint64) (n int) {
return sovCategory(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Category) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Category: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Category: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ParentId", wireType)
}
m.ParentId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ParentId |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field DocCount", wireType)
}
m.DocCount = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.DocCount |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Sort", wireType)
}
m.Sort = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Sort |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enable", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Enable = bool(v != 0)
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.CreatedAt == nil {
m.CreatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.UpdatedAt == nil {
m.UpdatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Cover", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Cover = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Icon = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 11:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Description = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 12:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ShowDescription", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.ShowDescription = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipCategory(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCategory
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ListCategoryRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ListCategoryRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ListCategoryRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType)
}
m.Page = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Page |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
}
m.Size_ = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Size_ |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.ParentId = append(m.ParentId, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
var count int
for _, integer := range dAtA[iNdEx:postIndex] {
if integer < 128 {
count++
}
}
elementCount = count
if elementCount != 0 && len(m.ParentId) == 0 {
m.ParentId = make([]int64, 0, elementCount)
}
for iNdEx < postIndex {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.ParentId = append(m.ParentId, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field ParentId", wireType)
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Wd", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Wd = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType == 0 {
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Enable = append(m.Enable, bool(v != 0))
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
elementCount = packedLen
if elementCount != 0 && len(m.Enable) == 0 {
m.Enable = make([]bool, 0, elementCount)
}
for iNdEx < postIndex {
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Enable = append(m.Enable, bool(v != 0))
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Enable", wireType)
}
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Field = append(m.Field, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipCategory(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCategory
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ListCategoryReply) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ListCategoryReply: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ListCategoryReply: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
}
m.Total = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Total |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Category = append(m.Category, &Category{})
if err := m.Category[len(m.Category)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipCategory(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCategory
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *DeleteCategoryRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: DeleteCategoryRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: DeleteCategoryRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthCategory
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthCategory
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
var count int
for _, integer := range dAtA[iNdEx:postIndex] {
if integer < 128 {
count++
}
}
elementCount = count
if elementCount != 0 && len(m.Id) == 0 {
m.Id = make([]int64, 0, elementCount)
}
for iNdEx < postIndex {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
default:
iNdEx = preIndex
skippy, err := skipCategory(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCategory
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GetCategoryRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GetCategoryRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GetCategoryRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCategory
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipCategory(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCategory
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipCategory(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCategory
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCategory
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCategory
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthCategory
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupCategory
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthCategory
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthCategory = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowCategory = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupCategory = fmt.Errorf("proto: unexpected end of group")
)