From aa609ece6b4e2a0deac6a051424a7d54e5e1437e Mon Sep 17 00:00:00 2001 From: truthhun <1272881215@qq.com> Date: Mon, 16 Jan 2023 12:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=BF=BD=E7=95=A5pb=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BB=A5=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=88=86=E6=94=AF=E4=B9=8B=E9=97=B4=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=97=B6=E7=94=B1=E4=BA=8E=E5=BF=BD=E7=95=A5pb?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=96=87=E4=BB=B6=E9=80=A0=E6=88=90=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 - api/v1/article.pb.go | 2016 +++++++++++ api/v1/article.pb.gw.go | 499 +++ api/v1/attachment.pb.go | 2516 +++++++++++++ api/v1/attachment.pb.gw.go | 418 +++ api/v1/banner.pb.go | 2091 +++++++++++ api/v1/banner.pb.gw.go | 499 +++ api/v1/category.pb.go | 2026 +++++++++++ api/v1/category.pb.gw.go | 499 +++ api/v1/comment.pb.go | 2955 +++++++++++++++ api/v1/comment.pb.gw.go | 580 +++ api/v1/config.pb.go | 4271 ++++++++++++++++++++++ api/v1/config.pb.gw.go | 383 ++ api/v1/document.pb.go | 6508 +++++++++++++++++++++++++++++++++ api/v1/document.pb.gw.go | 1279 +++++++ api/v1/favorite.pb.go | 1747 +++++++++ api/v1/favorite.pb.gw.go | 418 +++ api/v1/friendlink.pb.go | 1894 ++++++++++ api/v1/friendlink.pb.gw.go | 499 +++ api/v1/group.pb.go | 2804 +++++++++++++++ api/v1/group.pb.gw.go | 663 ++++ api/v1/health.pb.go | 679 ++++ api/v1/health.pb.gw.go | 237 ++ api/v1/permission.pb.go | 1930 ++++++++++ api/v1/permission.pb.gw.go | 335 ++ api/v1/report.pb.go | 1826 ++++++++++ api/v1/report.pb.gw.go | 416 +++ api/v1/user.pb.go | 6917 ++++++++++++++++++++++++++++++++++++ api/v1/user.pb.gw.go | 1477 ++++++++ 29 files changed, 48382 insertions(+), 4 deletions(-) create mode 100644 api/v1/article.pb.go create mode 100644 api/v1/article.pb.gw.go create mode 100644 api/v1/attachment.pb.go create mode 100644 api/v1/attachment.pb.gw.go create mode 100644 api/v1/banner.pb.go create mode 100644 api/v1/banner.pb.gw.go create mode 100644 api/v1/category.pb.go create mode 100644 api/v1/category.pb.gw.go create mode 100644 api/v1/comment.pb.go create mode 100644 api/v1/comment.pb.gw.go create mode 100644 api/v1/config.pb.go create mode 100644 api/v1/config.pb.gw.go create mode 100644 api/v1/document.pb.go create mode 100644 api/v1/document.pb.gw.go create mode 100644 api/v1/favorite.pb.go create mode 100644 api/v1/favorite.pb.gw.go create mode 100644 api/v1/friendlink.pb.go create mode 100644 api/v1/friendlink.pb.gw.go create mode 100644 api/v1/group.pb.go create mode 100644 api/v1/group.pb.gw.go create mode 100644 api/v1/health.pb.go create mode 100644 api/v1/health.pb.gw.go create mode 100644 api/v1/permission.pb.go create mode 100644 api/v1/permission.pb.gw.go create mode 100644 api/v1/report.pb.go create mode 100644 api/v1/report.pb.gw.go create mode 100644 api/v1/user.pb.go create mode 100644 api/v1/user.pb.gw.go diff --git a/.gitignore b/.gitignore index 36212fc..8feed14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,6 @@ !app.example.toml *.exe *.exe~ -# 忽略生成的proto go文件 -*.pb.go -*.pb.gw.go -*.pb.validate.go ginrpc* dist output diff --git a/api/v1/article.pb.go b/api/v1/article.pb.go new file mode 100644 index 0000000..508d362 --- /dev/null +++ b/api/v1/article.pb.go @@ -0,0 +1,2016 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/article.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 Article struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` + Author string `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` + ViewCount int64 `protobuf:"varint,4,opt,name=view_count,json=viewCount,proto3" json:"view_count,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + Keywords string `protobuf:"bytes,6,opt,name=keywords,proto3" json:"keywords,omitempty"` + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Article) Reset() { *m = Article{} } +func (m *Article) String() string { return proto.CompactTextString(m) } +func (*Article) ProtoMessage() {} +func (*Article) Descriptor() ([]byte, []int) { + return fileDescriptor_d5a9bcd2997b0bd3, []int{0} +} +func (m *Article) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Article) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Article.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 *Article) XXX_Merge(src proto.Message) { + xxx_messageInfo_Article.Merge(m, src) +} +func (m *Article) XXX_Size() int { + return m.Size() +} +func (m *Article) XXX_DiscardUnknown() { + xxx_messageInfo_Article.DiscardUnknown(m) +} + +var xxx_messageInfo_Article proto.InternalMessageInfo + +func (m *Article) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Article) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +func (m *Article) GetAuthor() string { + if m != nil { + return m.Author + } + return "" +} + +func (m *Article) GetViewCount() int64 { + if m != nil { + return m.ViewCount + } + return 0 +} + +func (m *Article) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Article) GetKeywords() string { + if m != nil { + return m.Keywords + } + return "" +} + +func (m *Article) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Article) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Article) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Article) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteArticleRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteArticleRequest) Reset() { *m = DeleteArticleRequest{} } +func (m *DeleteArticleRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteArticleRequest) ProtoMessage() {} +func (*DeleteArticleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d5a9bcd2997b0bd3, []int{1} +} +func (m *DeleteArticleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteArticleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteArticleRequest.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 *DeleteArticleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteArticleRequest.Merge(m, src) +} +func (m *DeleteArticleRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteArticleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteArticleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteArticleRequest proto.InternalMessageInfo + +func (m *DeleteArticleRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +// 根据ID或者文章标识获取文章 +type GetArticleRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (m *GetArticleRequest) Reset() { *m = GetArticleRequest{} } +func (m *GetArticleRequest) String() string { return proto.CompactTextString(m) } +func (*GetArticleRequest) ProtoMessage() {} +func (*GetArticleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d5a9bcd2997b0bd3, []int{2} +} +func (m *GetArticleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetArticleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetArticleRequest.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 *GetArticleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetArticleRequest.Merge(m, src) +} +func (m *GetArticleRequest) XXX_Size() int { + return m.Size() +} +func (m *GetArticleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetArticleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetArticleRequest proto.InternalMessageInfo + +func (m *GetArticleRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *GetArticleRequest) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +type ListArticleRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Field []string `protobuf:"bytes,4,rep,name=field,proto3" json:"field,omitempty"` + Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"` +} + +func (m *ListArticleRequest) Reset() { *m = ListArticleRequest{} } +func (m *ListArticleRequest) String() string { return proto.CompactTextString(m) } +func (*ListArticleRequest) ProtoMessage() {} +func (*ListArticleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d5a9bcd2997b0bd3, []int{3} +} +func (m *ListArticleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListArticleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListArticleRequest.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 *ListArticleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListArticleRequest.Merge(m, src) +} +func (m *ListArticleRequest) XXX_Size() int { + return m.Size() +} +func (m *ListArticleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListArticleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListArticleRequest proto.InternalMessageInfo + +func (m *ListArticleRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListArticleRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListArticleRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListArticleRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +func (m *ListArticleRequest) GetOrder() string { + if m != nil { + return m.Order + } + return "" +} + +type ListArticleReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Article []*Article `protobuf:"bytes,2,rep,name=article,proto3" json:"article,omitempty"` +} + +func (m *ListArticleReply) Reset() { *m = ListArticleReply{} } +func (m *ListArticleReply) String() string { return proto.CompactTextString(m) } +func (*ListArticleReply) ProtoMessage() {} +func (*ListArticleReply) Descriptor() ([]byte, []int) { + return fileDescriptor_d5a9bcd2997b0bd3, []int{4} +} +func (m *ListArticleReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListArticleReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListArticleReply.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 *ListArticleReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListArticleReply.Merge(m, src) +} +func (m *ListArticleReply) XXX_Size() int { + return m.Size() +} +func (m *ListArticleReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListArticleReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListArticleReply proto.InternalMessageInfo + +func (m *ListArticleReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListArticleReply) GetArticle() []*Article { + if m != nil { + return m.Article + } + return nil +} + +func init() { + proto.RegisterType((*Article)(nil), "api.v1.Article") + proto.RegisterType((*DeleteArticleRequest)(nil), "api.v1.DeleteArticleRequest") + proto.RegisterType((*GetArticleRequest)(nil), "api.v1.GetArticleRequest") + proto.RegisterType((*ListArticleRequest)(nil), "api.v1.ListArticleRequest") + proto.RegisterType((*ListArticleReply)(nil), "api.v1.ListArticleReply") +} + +func init() { proto.RegisterFile("api/v1/article.proto", fileDescriptor_d5a9bcd2997b0bd3) } + +var fileDescriptor_d5a9bcd2997b0bd3 = []byte{ + // 621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0xc7, 0x6b, 0x3b, 0x4d, 0x9a, 0x89, 0xfa, 0xf5, 0xeb, 0x2a, 0x2a, 0x8b, 0x29, 0x6e, 0xe4, + 0x03, 0x0a, 0x3d, 0xd8, 0x6a, 0x11, 0x17, 0x38, 0xa0, 0xb4, 0x20, 0x84, 0xc4, 0xa1, 0x84, 0x72, + 0xe1, 0x40, 0xe5, 0xc6, 0xd3, 0xb0, 0xc2, 0xf1, 0x1a, 0x7b, 0x93, 0x10, 0x8e, 0x3c, 0x41, 0x25, + 0x5e, 0x8a, 0x13, 0xaa, 0xc4, 0x85, 0x1b, 0x55, 0xcb, 0x83, 0xa0, 0x5d, 0xef, 0x96, 0x36, 0x49, + 0xa5, 0x8a, 0xdb, 0xcc, 0x7f, 0x3c, 0xbf, 0x89, 0xe7, 0x3f, 0x31, 0x34, 0xa3, 0x8c, 0x85, 0xa3, + 0xad, 0x30, 0xca, 0x05, 0xeb, 0x25, 0x18, 0x64, 0x39, 0x17, 0x9c, 0x54, 0xa3, 0x8c, 0x05, 0xa3, + 0x2d, 0x77, 0xa3, 0xcf, 0x79, 0x3f, 0xc1, 0x50, 0xa9, 0x87, 0xc3, 0xa3, 0x50, 0xb0, 0x01, 0x16, + 0x22, 0x1a, 0x64, 0xe5, 0x83, 0x6e, 0xb3, 0xcf, 0xfb, 0x5c, 0x85, 0xa1, 0x8c, 0xb4, 0xba, 0xae, + 0xdb, 0x24, 0x3b, 0x4a, 0x53, 0x2e, 0x22, 0xc1, 0x78, 0x5a, 0xe8, 0xea, 0x9d, 0x69, 0x28, 0x0e, + 0x32, 0x31, 0x29, 0x8b, 0xfe, 0xa9, 0x0d, 0xb5, 0x4e, 0xf9, 0x5b, 0xc8, 0x7f, 0x60, 0xb3, 0x98, + 0x5a, 0x2d, 0xab, 0xed, 0x74, 0x6d, 0x16, 0x13, 0x0f, 0x80, 0xc5, 0x98, 0x0a, 0x76, 0xc4, 0x30, + 0xa7, 0x76, 0xcb, 0x6a, 0xd7, 0xbb, 0x97, 0x14, 0xb2, 0x06, 0xd5, 0x68, 0x28, 0xde, 0xf3, 0x9c, + 0x3a, 0xaa, 0xa6, 0x33, 0x72, 0x17, 0x60, 0xc4, 0x70, 0x7c, 0xd0, 0xe3, 0xc3, 0x54, 0xd0, 0x8a, + 0xe2, 0xd5, 0xa5, 0xb2, 0x2b, 0x05, 0xd2, 0x84, 0x45, 0xc1, 0x44, 0x82, 0x74, 0x51, 0x75, 0x95, + 0x09, 0x71, 0x61, 0xe9, 0x03, 0x4e, 0xc6, 0x3c, 0x8f, 0x0b, 0x5a, 0x55, 0x85, 0x8b, 0x9c, 0xb4, + 0xa0, 0x11, 0x63, 0xd1, 0xcb, 0x59, 0x26, 0xdf, 0x8b, 0xd6, 0x54, 0xf9, 0xb2, 0x44, 0x28, 0xd4, + 0x7a, 0x3c, 0x15, 0x98, 0x0a, 0xba, 0xa4, 0xaa, 0x26, 0x25, 0x4f, 0x00, 0x7a, 0x39, 0x46, 0x02, + 0xe3, 0x83, 0x48, 0xd0, 0x7a, 0xcb, 0x6a, 0x37, 0xb6, 0xdd, 0xa0, 0x5c, 0x49, 0x60, 0x56, 0x12, + 0xec, 0x9b, 0x3d, 0xef, 0x54, 0x8e, 0x7f, 0x6d, 0x58, 0xdd, 0xba, 0xee, 0xe9, 0x28, 0xc0, 0x30, + 0x8b, 0x0d, 0x00, 0x6e, 0x0a, 0xd0, 0x3d, 0x1d, 0xe1, 0xdf, 0x83, 0xe6, 0x53, 0x4c, 0x50, 0xa0, + 0xde, 0x73, 0x17, 0x3f, 0x0e, 0xb1, 0x10, 0x17, 0xeb, 0x76, 0xca, 0x75, 0xfb, 0xbb, 0xb0, 0xfa, + 0x1c, 0xc5, 0x35, 0x0f, 0xdd, 0xd0, 0x13, 0xff, 0x13, 0x90, 0x97, 0xac, 0x98, 0xa6, 0x10, 0xa8, + 0x64, 0x51, 0x1f, 0x35, 0x47, 0xc5, 0x52, 0x2b, 0xd8, 0x67, 0x54, 0x0c, 0xa7, 0xab, 0x62, 0x39, + 0x6d, 0x1c, 0x6b, 0x37, 0xed, 0x71, 0x2c, 0xad, 0x3a, 0x62, 0x98, 0xc4, 0xb4, 0xd2, 0x72, 0xa4, + 0x55, 0x2a, 0x91, 0x2a, 0xcf, 0x63, 0xcc, 0x8d, 0x81, 0x2a, 0xf1, 0x5f, 0xc3, 0xff, 0x57, 0x26, + 0x67, 0xc9, 0x44, 0x59, 0xcd, 0x45, 0x94, 0xe8, 0xc1, 0x65, 0x42, 0xee, 0x43, 0x4d, 0x9f, 0x3f, + 0xb5, 0x5b, 0x4e, 0xbb, 0xb1, 0xbd, 0x12, 0x94, 0xf7, 0x1f, 0x98, 0x66, 0x53, 0xdf, 0xfe, 0xee, + 0x00, 0x68, 0xb1, 0xb3, 0xf7, 0x82, 0xec, 0xc3, 0xf2, 0xae, 0x32, 0xc6, 0x9c, 0xec, 0x74, 0xa7, + 0xbb, 0x36, 0xe3, 0xcc, 0x33, 0x79, 0xed, 0xbe, 0xfb, 0xe5, 0xc7, 0xef, 0xaf, 0x76, 0xd3, 0x5f, + 0x09, 0xaf, 0xfe, 0x01, 0x1f, 0x59, 0x9b, 0x92, 0xfa, 0x46, 0xb9, 0xf5, 0xaf, 0x54, 0x77, 0x1e, + 0xf5, 0x1d, 0x2c, 0x5f, 0xb1, 0x9d, 0xac, 0x1b, 0xea, 0xbc, 0x6b, 0xb8, 0x76, 0xc4, 0x2d, 0x35, + 0x62, 0x75, 0x73, 0x7a, 0x04, 0x79, 0x05, 0xf0, 0xf7, 0x5c, 0xc8, 0x6d, 0x03, 0x9f, 0x39, 0x21, + 0x77, 0xfa, 0x6d, 0x0c, 0x92, 0xcc, 0x20, 0x23, 0x68, 0x5c, 0xb2, 0x90, 0xb8, 0xa6, 0x71, 0xf6, + 0xa2, 0x5c, 0x3a, 0xb7, 0x96, 0x25, 0x13, 0x7f, 0x5d, 0xd1, 0xd7, 0x48, 0x73, 0x8a, 0x1e, 0x26, + 0xac, 0x10, 0x3b, 0x0f, 0xbf, 0x9d, 0x79, 0xd6, 0xc9, 0x99, 0x67, 0x9d, 0x9e, 0x79, 0xd6, 0xf1, + 0xb9, 0xb7, 0x70, 0x72, 0xee, 0x2d, 0xfc, 0x3c, 0xf7, 0x16, 0x40, 0x7f, 0x03, 0xf7, 0xac, 0xb7, + 0xab, 0x03, 0x9e, 0x63, 0xcc, 0x7b, 0x1a, 0xf0, 0x78, 0xb4, 0x75, 0x58, 0x55, 0x5b, 0x79, 0xf0, + 0x27, 0x00, 0x00, 0xff, 0xff, 0x73, 0x36, 0x99, 0x7c, 0x3f, 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 + +// ArticleAPIClient is the client API for ArticleAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ArticleAPIClient interface { + CreateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*Article, error) + ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error) +} + +type articleAPIClient struct { + cc *grpc.ClientConn +} + +func NewArticleAPIClient(cc *grpc.ClientConn) ArticleAPIClient { + return &articleAPIClient{cc} +} + +func (c *articleAPIClient) CreateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ArticleAPI/CreateArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *articleAPIClient) UpdateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ArticleAPI/UpdateArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *articleAPIClient) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ArticleAPI/DeleteArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *articleAPIClient) GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*Article, error) { + out := new(Article) + err := c.cc.Invoke(ctx, "/api.v1.ArticleAPI/GetArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *articleAPIClient) ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error) { + out := new(ListArticleReply) + err := c.cc.Invoke(ctx, "/api.v1.ArticleAPI/ListArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ArticleAPIServer is the server API for ArticleAPI service. +type ArticleAPIServer interface { + CreateArticle(context.Context, *Article) (*emptypb.Empty, error) + UpdateArticle(context.Context, *Article) (*emptypb.Empty, error) + DeleteArticle(context.Context, *DeleteArticleRequest) (*emptypb.Empty, error) + GetArticle(context.Context, *GetArticleRequest) (*Article, error) + ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error) +} + +// UnimplementedArticleAPIServer can be embedded to have forward compatible implementations. +type UnimplementedArticleAPIServer struct { +} + +func (*UnimplementedArticleAPIServer) CreateArticle(ctx context.Context, req *Article) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateArticle not implemented") +} +func (*UnimplementedArticleAPIServer) UpdateArticle(ctx context.Context, req *Article) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateArticle not implemented") +} +func (*UnimplementedArticleAPIServer) DeleteArticle(ctx context.Context, req *DeleteArticleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteArticle not implemented") +} +func (*UnimplementedArticleAPIServer) GetArticle(ctx context.Context, req *GetArticleRequest) (*Article, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetArticle not implemented") +} +func (*UnimplementedArticleAPIServer) ListArticle(ctx context.Context, req *ListArticleRequest) (*ListArticleReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListArticle not implemented") +} + +func RegisterArticleAPIServer(s *grpc.Server, srv ArticleAPIServer) { + s.RegisterService(&_ArticleAPI_serviceDesc, srv) +} + +func _ArticleAPI_CreateArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Article) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArticleAPIServer).CreateArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ArticleAPI/CreateArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArticleAPIServer).CreateArticle(ctx, req.(*Article)) + } + return interceptor(ctx, in, info, handler) +} + +func _ArticleAPI_UpdateArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Article) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArticleAPIServer).UpdateArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ArticleAPI/UpdateArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArticleAPIServer).UpdateArticle(ctx, req.(*Article)) + } + return interceptor(ctx, in, info, handler) +} + +func _ArticleAPI_DeleteArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteArticleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArticleAPIServer).DeleteArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ArticleAPI/DeleteArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArticleAPIServer).DeleteArticle(ctx, req.(*DeleteArticleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ArticleAPI_GetArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetArticleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArticleAPIServer).GetArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ArticleAPI/GetArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArticleAPIServer).GetArticle(ctx, req.(*GetArticleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ArticleAPI_ListArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListArticleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArticleAPIServer).ListArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ArticleAPI/ListArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArticleAPIServer).ListArticle(ctx, req.(*ListArticleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ArticleAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.ArticleAPI", + HandlerType: (*ArticleAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateArticle", + Handler: _ArticleAPI_CreateArticle_Handler, + }, + { + MethodName: "UpdateArticle", + Handler: _ArticleAPI_UpdateArticle_Handler, + }, + { + MethodName: "DeleteArticle", + Handler: _ArticleAPI_DeleteArticle_Handler, + }, + { + MethodName: "GetArticle", + Handler: _ArticleAPI_GetArticle_Handler, + }, + { + MethodName: "ListArticle", + Handler: _ArticleAPI_ListArticle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/article.proto", +} + +func (m *Article) 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 *Article) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Article) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 = encodeVarintArticle(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x52 + } + 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 = encodeVarintArticle(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x4a + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x42 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x3a + } + if len(m.Keywords) > 0 { + i -= len(m.Keywords) + copy(dAtA[i:], m.Keywords) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Keywords))) + i-- + dAtA[i] = 0x32 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x2a + } + if m.ViewCount != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.ViewCount)) + i-- + dAtA[i] = 0x20 + } + if len(m.Author) > 0 { + i -= len(m.Author) + copy(dAtA[i:], m.Author) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Author))) + i-- + dAtA[i] = 0x1a + } + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteArticleRequest) 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 *DeleteArticleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteArticleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintArticle(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetArticleRequest) 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 *GetArticleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetArticleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListArticleRequest) 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 *ListArticleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListArticleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Order) > 0 { + i -= len(m.Order) + copy(dAtA[i:], m.Order) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Order))) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintArticle(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListArticleReply) 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 *ListArticleReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListArticleReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Article) > 0 { + for iNdEx := len(m.Article) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Article[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintArticle(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintArticle(dAtA []byte, offset int, v uint64) int { + offset -= sovArticle(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Article) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovArticle(uint64(m.Id)) + } + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Author) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + if m.ViewCount != 0 { + n += 1 + sovArticle(uint64(m.ViewCount)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Keywords) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovArticle(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovArticle(uint64(l)) + } + return n +} + +func (m *DeleteArticleRequest) 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 += sovArticle(uint64(e)) + } + n += 1 + sovArticle(uint64(l)) + l + } + return n +} + +func (m *GetArticleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovArticle(uint64(m.Id)) + } + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + return n +} + +func (m *ListArticleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovArticle(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovArticle(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovArticle(uint64(l)) + } + } + l = len(m.Order) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + return n +} + +func (m *ListArticleReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovArticle(uint64(m.Total)) + } + if len(m.Article) > 0 { + for _, e := range m.Article { + l = e.Size() + n += 1 + l + sovArticle(uint64(l)) + } + } + return n +} + +func sovArticle(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozArticle(x uint64) (n int) { + return sovArticle(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Article) 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 ErrIntOverflowArticle + } + 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: Article: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Article: 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Author = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ViewCount", wireType) + } + m.ViewCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ViewCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + 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 ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keywords", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keywords = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + 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 ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthArticle + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + 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 10: + 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthArticle + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + 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 + default: + iNdEx = preIndex + skippy, err := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteArticleRequest) 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 ErrIntOverflowArticle + } + 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: DeleteArticleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteArticleRequest: 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 ErrIntOverflowArticle + } + 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthArticle + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + 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 ErrIntOverflowArticle + } + 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 := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetArticleRequest) 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 ErrIntOverflowArticle + } + 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: GetArticleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetArticleRequest: 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListArticleRequest) 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 ErrIntOverflowArticle + } + 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: ListArticleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListArticleRequest: 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 ErrIntOverflowArticle + } + 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 ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Order = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListArticleReply) 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 ErrIntOverflowArticle + } + 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: ListArticleReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListArticleReply: 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 ErrIntOverflowArticle + } + 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 Article", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthArticle + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Article = append(m.Article, &Article{}) + if err := m.Article[len(m.Article)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipArticle(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, ErrIntOverflowArticle + } + 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, ErrIntOverflowArticle + } + 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, ErrIntOverflowArticle + } + 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, ErrInvalidLengthArticle + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupArticle + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthArticle + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthArticle = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowArticle = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupArticle = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/article.pb.gw.go b/api/v1/article.pb.gw.go new file mode 100644 index 0000000..aeffadc --- /dev/null +++ b/api/v1/article.pb.gw.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/article.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_ArticleAPI_CreateArticle_0(ctx context.Context, marshaler runtime.Marshaler, client ArticleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Article + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateArticle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ArticleAPI_CreateArticle_0(ctx context.Context, marshaler runtime.Marshaler, server ArticleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Article + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateArticle(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ArticleAPI_UpdateArticle_0(ctx context.Context, marshaler runtime.Marshaler, client ArticleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Article + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateArticle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ArticleAPI_UpdateArticle_0(ctx context.Context, marshaler runtime.Marshaler, server ArticleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Article + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateArticle(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ArticleAPI_DeleteArticle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ArticleAPI_DeleteArticle_0(ctx context.Context, marshaler runtime.Marshaler, client ArticleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteArticleRequest + 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_ArticleAPI_DeleteArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteArticle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ArticleAPI_DeleteArticle_0(ctx context.Context, marshaler runtime.Marshaler, server ArticleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteArticleRequest + 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_ArticleAPI_DeleteArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteArticle(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ArticleAPI_GetArticle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ArticleAPI_GetArticle_0(ctx context.Context, marshaler runtime.Marshaler, client ArticleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetArticleRequest + 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_ArticleAPI_GetArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetArticle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ArticleAPI_GetArticle_0(ctx context.Context, marshaler runtime.Marshaler, server ArticleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetArticleRequest + 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_ArticleAPI_GetArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetArticle(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ArticleAPI_ListArticle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ArticleAPI_ListArticle_0(ctx context.Context, marshaler runtime.Marshaler, client ArticleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListArticleRequest + 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_ArticleAPI_ListArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListArticle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ArticleAPI_ListArticle_0(ctx context.Context, marshaler runtime.Marshaler, server ArticleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListArticleRequest + 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_ArticleAPI_ListArticle_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListArticle(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterArticleAPIHandlerServer registers the http handlers for service ArticleAPI to "mux". +// UnaryRPC :call ArticleAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterArticleAPIHandlerFromEndpoint instead. +func RegisterArticleAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ArticleAPIServer) error { + + mux.Handle("POST", pattern_ArticleAPI_CreateArticle_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ArticleAPI_CreateArticle_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_CreateArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ArticleAPI_UpdateArticle_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ArticleAPI_UpdateArticle_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_UpdateArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ArticleAPI_DeleteArticle_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ArticleAPI_DeleteArticle_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_DeleteArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ArticleAPI_GetArticle_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ArticleAPI_GetArticle_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_GetArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ArticleAPI_ListArticle_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ArticleAPI_ListArticle_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_ListArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterArticleAPIHandlerFromEndpoint is same as RegisterArticleAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterArticleAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterArticleAPIHandler(ctx, mux, conn) +} + +// RegisterArticleAPIHandler registers the http handlers for service ArticleAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterArticleAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterArticleAPIHandlerClient(ctx, mux, NewArticleAPIClient(conn)) +} + +// RegisterArticleAPIHandlerClient registers the http handlers for service ArticleAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ArticleAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ArticleAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ArticleAPIClient" to call the correct interceptors. +func RegisterArticleAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ArticleAPIClient) error { + + mux.Handle("POST", pattern_ArticleAPI_CreateArticle_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ArticleAPI_CreateArticle_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_CreateArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ArticleAPI_UpdateArticle_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ArticleAPI_UpdateArticle_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_UpdateArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ArticleAPI_DeleteArticle_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ArticleAPI_DeleteArticle_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_DeleteArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ArticleAPI_GetArticle_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ArticleAPI_GetArticle_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_GetArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ArticleAPI_ListArticle_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ArticleAPI_ListArticle_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ArticleAPI_ListArticle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ArticleAPI_CreateArticle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "article"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ArticleAPI_UpdateArticle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "article"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ArticleAPI_DeleteArticle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "article"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ArticleAPI_GetArticle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "article"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ArticleAPI_ListArticle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "article", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_ArticleAPI_CreateArticle_0 = runtime.ForwardResponseMessage + + forward_ArticleAPI_UpdateArticle_0 = runtime.ForwardResponseMessage + + forward_ArticleAPI_DeleteArticle_0 = runtime.ForwardResponseMessage + + forward_ArticleAPI_GetArticle_0 = runtime.ForwardResponseMessage + + forward_ArticleAPI_ListArticle_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/attachment.pb.go b/api/v1/attachment.pb.go new file mode 100644 index 0000000..b28cd25 --- /dev/null +++ b/api/v1/attachment.pb.go @@ -0,0 +1,2516 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/attachment.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 Attachment struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + TypeId int64 `protobuf:"varint,4,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` + Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` + Enable bool `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"` + Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` + Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` + Size_ int64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"` + Width int64 `protobuf:"varint,10,opt,name=width,proto3" json:"width,omitempty"` + Height int64 `protobuf:"varint,11,opt,name=height,proto3" json:"height,omitempty"` + Ext string `protobuf:"bytes,12,opt,name=ext,proto3" json:"ext,omitempty"` + Ip string `protobuf:"bytes,13,opt,name=ip,proto3" json:"ip,omitempty"` + Username string `protobuf:"bytes,16,opt,name=username,proto3" json:"username,omitempty"` + TypeName string `protobuf:"bytes,17,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,14,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,15,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Attachment) Reset() { *m = Attachment{} } +func (m *Attachment) String() string { return proto.CompactTextString(m) } +func (*Attachment) ProtoMessage() {} +func (*Attachment) Descriptor() ([]byte, []int) { + return fileDescriptor_f8e66484a389ac80, []int{0} +} +func (m *Attachment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Attachment.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 *Attachment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Attachment.Merge(m, src) +} +func (m *Attachment) XXX_Size() int { + return m.Size() +} +func (m *Attachment) XXX_DiscardUnknown() { + xxx_messageInfo_Attachment.DiscardUnknown(m) +} + +var xxx_messageInfo_Attachment proto.InternalMessageInfo + +func (m *Attachment) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Attachment) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *Attachment) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Attachment) GetTypeId() int64 { + if m != nil { + return m.TypeId + } + return 0 +} + +func (m *Attachment) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Attachment) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + +func (m *Attachment) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Attachment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Attachment) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *Attachment) GetWidth() int64 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Attachment) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Attachment) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + +func (m *Attachment) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *Attachment) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *Attachment) GetTypeName() string { + if m != nil { + return m.TypeName + } + return "" +} + +func (m *Attachment) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Attachment) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Attachment) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteAttachmentRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteAttachmentRequest) Reset() { *m = DeleteAttachmentRequest{} } +func (m *DeleteAttachmentRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteAttachmentRequest) ProtoMessage() {} +func (*DeleteAttachmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f8e66484a389ac80, []int{1} +} +func (m *DeleteAttachmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteAttachmentRequest.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 *DeleteAttachmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteAttachmentRequest.Merge(m, src) +} +func (m *DeleteAttachmentRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteAttachmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteAttachmentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteAttachmentRequest proto.InternalMessageInfo + +func (m *DeleteAttachmentRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetAttachmentRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetAttachmentRequest) Reset() { *m = GetAttachmentRequest{} } +func (m *GetAttachmentRequest) String() string { return proto.CompactTextString(m) } +func (*GetAttachmentRequest) ProtoMessage() {} +func (*GetAttachmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f8e66484a389ac80, []int{2} +} +func (m *GetAttachmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAttachmentRequest.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 *GetAttachmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachmentRequest.Merge(m, src) +} +func (m *GetAttachmentRequest) XXX_Size() int { + return m.Size() +} +func (m *GetAttachmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAttachmentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAttachmentRequest proto.InternalMessageInfo + +func (m *GetAttachmentRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type ListAttachmentRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Enable []bool `protobuf:"varint,4,rep,packed,name=enable,proto3" json:"enable,omitempty"` + UserId []int64 `protobuf:"varint,5,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Type []int64 `protobuf:"varint,6,rep,packed,name=type,proto3" json:"type,omitempty"` + Ext string `protobuf:"bytes,7,opt,name=ext,proto3" json:"ext,omitempty"` +} + +func (m *ListAttachmentRequest) Reset() { *m = ListAttachmentRequest{} } +func (m *ListAttachmentRequest) String() string { return proto.CompactTextString(m) } +func (*ListAttachmentRequest) ProtoMessage() {} +func (*ListAttachmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f8e66484a389ac80, []int{3} +} +func (m *ListAttachmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListAttachmentRequest.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 *ListAttachmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAttachmentRequest.Merge(m, src) +} +func (m *ListAttachmentRequest) XXX_Size() int { + return m.Size() +} +func (m *ListAttachmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListAttachmentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAttachmentRequest proto.InternalMessageInfo + +func (m *ListAttachmentRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListAttachmentRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListAttachmentRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListAttachmentRequest) GetEnable() []bool { + if m != nil { + return m.Enable + } + return nil +} + +func (m *ListAttachmentRequest) GetUserId() []int64 { + if m != nil { + return m.UserId + } + return nil +} + +func (m *ListAttachmentRequest) GetType() []int64 { + if m != nil { + return m.Type + } + return nil +} + +func (m *ListAttachmentRequest) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + +type ListAttachmentReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Attachment []*Attachment `protobuf:"bytes,2,rep,name=attachment,proto3" json:"attachment,omitempty"` +} + +func (m *ListAttachmentReply) Reset() { *m = ListAttachmentReply{} } +func (m *ListAttachmentReply) String() string { return proto.CompactTextString(m) } +func (*ListAttachmentReply) ProtoMessage() {} +func (*ListAttachmentReply) Descriptor() ([]byte, []int) { + return fileDescriptor_f8e66484a389ac80, []int{4} +} +func (m *ListAttachmentReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListAttachmentReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListAttachmentReply.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 *ListAttachmentReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAttachmentReply.Merge(m, src) +} +func (m *ListAttachmentReply) XXX_Size() int { + return m.Size() +} +func (m *ListAttachmentReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListAttachmentReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAttachmentReply proto.InternalMessageInfo + +func (m *ListAttachmentReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListAttachmentReply) GetAttachment() []*Attachment { + if m != nil { + return m.Attachment + } + return nil +} + +func init() { + proto.RegisterType((*Attachment)(nil), "api.v1.Attachment") + proto.RegisterType((*DeleteAttachmentRequest)(nil), "api.v1.DeleteAttachmentRequest") + proto.RegisterType((*GetAttachmentRequest)(nil), "api.v1.GetAttachmentRequest") + proto.RegisterType((*ListAttachmentRequest)(nil), "api.v1.ListAttachmentRequest") + proto.RegisterType((*ListAttachmentReply)(nil), "api.v1.ListAttachmentReply") +} + +func init() { proto.RegisterFile("api/v1/attachment.proto", fileDescriptor_f8e66484a389ac80) } + +var fileDescriptor_f8e66484a389ac80 = []byte{ + // 695 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0xae, 0xed, 0x24, 0x6d, 0x26, 0x7f, 0xf3, 0xa7, 0x4b, 0x68, 0x16, 0xb7, 0x4d, 0xac, 0x1c, + 0x50, 0xe8, 0x21, 0x56, 0x83, 0xb8, 0xc0, 0x01, 0xa5, 0x02, 0xa1, 0x4a, 0x08, 0x55, 0x16, 0x5c, + 0x90, 0xaa, 0x6a, 0x1b, 0x2f, 0xf6, 0x4a, 0x76, 0x6c, 0xe2, 0x4d, 0x4b, 0x38, 0xf2, 0x04, 0x95, + 0x78, 0x06, 0x78, 0x16, 0x8e, 0x95, 0xb8, 0x70, 0x03, 0xb5, 0xbc, 0x03, 0x57, 0xb4, 0xbb, 0x76, + 0xe2, 0xb6, 0x8e, 0xc4, 0x6d, 0x66, 0xbe, 0xd9, 0x6f, 0x66, 0xfd, 0x7d, 0x6b, 0x68, 0x91, 0x98, + 0xd9, 0xa7, 0x7b, 0x36, 0xe1, 0x9c, 0x8c, 0xfc, 0x90, 0x8e, 0x79, 0x3f, 0x9e, 0x44, 0x3c, 0x42, + 0x15, 0x12, 0xb3, 0xfe, 0xe9, 0x9e, 0xd9, 0xf1, 0xa2, 0xc8, 0x0b, 0xa8, 0x2d, 0xab, 0x27, 0xd3, + 0x77, 0x36, 0x67, 0x21, 0x4d, 0x38, 0x09, 0x63, 0xd5, 0x68, 0x36, 0xbd, 0xc8, 0x8b, 0x64, 0x68, + 0x8b, 0x28, 0xad, 0x6e, 0xa7, 0xc7, 0x04, 0x3d, 0x19, 0x8f, 0x23, 0x4e, 0x38, 0x8b, 0xc6, 0x49, + 0x8a, 0x6e, 0xdd, 0x24, 0xa5, 0x61, 0xcc, 0x67, 0x0a, 0xec, 0xfe, 0x31, 0x00, 0x86, 0xf3, 0x75, + 0x50, 0x1d, 0x74, 0xe6, 0x62, 0xcd, 0xd2, 0x7a, 0x86, 0xa3, 0x33, 0x17, 0x21, 0x28, 0xf9, 0x24, + 0xf1, 0xb1, 0x6e, 0x69, 0xbd, 0xaa, 0x23, 0x63, 0xd4, 0x82, 0xd5, 0x69, 0x42, 0x27, 0xc7, 0xcc, + 0xc5, 0x86, 0x6c, 0xac, 0x88, 0xf4, 0xc0, 0x15, 0x00, 0x9f, 0xc5, 0x54, 0x00, 0x25, 0x05, 0x88, + 0xf4, 0x40, 0xb2, 0x88, 0x08, 0x97, 0x2d, 0xad, 0x57, 0x76, 0x64, 0x8c, 0x36, 0xa1, 0x42, 0xc7, + 0xe4, 0x24, 0xa0, 0xb8, 0x62, 0x69, 0xbd, 0x35, 0x27, 0xcd, 0x44, 0x6f, 0x4c, 0xb8, 0x8f, 0x57, + 0xd5, 0x44, 0x11, 0x8b, 0xda, 0x98, 0x84, 0x14, 0xaf, 0xa9, 0x9a, 0x88, 0x45, 0x2d, 0x61, 0x1f, + 0x29, 0xae, 0xca, 0x49, 0x32, 0x46, 0x4d, 0x28, 0x9f, 0x31, 0x97, 0xfb, 0x18, 0x64, 0x51, 0x25, + 0x62, 0x92, 0x4f, 0x99, 0xe7, 0x73, 0x5c, 0x53, 0x5b, 0xa9, 0x0c, 0x35, 0xc0, 0xa0, 0x1f, 0x38, + 0xfe, 0x4f, 0x92, 0x8a, 0x50, 0xde, 0x3e, 0xc6, 0xeb, 0xb2, 0xa0, 0xb3, 0x18, 0x99, 0xb0, 0x26, + 0xae, 0x26, 0x67, 0x37, 0x64, 0x75, 0x9e, 0xa3, 0x2d, 0xa8, 0xca, 0xcb, 0x4a, 0x70, 0x43, 0x81, + 0xa2, 0xf0, 0x4a, 0x80, 0x16, 0xd4, 0x5c, 0x9a, 0x8c, 0x26, 0x2c, 0x16, 0x42, 0x60, 0x24, 0xe1, + 0x7c, 0x09, 0x3d, 0x05, 0x18, 0x4d, 0x28, 0xe1, 0xd4, 0x3d, 0x26, 0x1c, 0xd7, 0x2d, 0xad, 0x57, + 0x1b, 0x98, 0x7d, 0xa5, 0x54, 0x3f, 0x53, 0xaa, 0xff, 0x3a, 0x93, 0x7f, 0xbf, 0x74, 0xfe, 0xb3, + 0xa3, 0x39, 0xd5, 0xf4, 0xcc, 0x90, 0x0b, 0x82, 0x69, 0xec, 0x66, 0x04, 0xff, 0xff, 0x2b, 0x41, + 0x7a, 0x66, 0xc8, 0xbb, 0x0f, 0xa0, 0xf5, 0x8c, 0x06, 0x94, 0xd3, 0x85, 0xfc, 0x0e, 0x7d, 0x3f, + 0xa5, 0xc9, 0xc2, 0x05, 0x86, 0x72, 0x41, 0xf7, 0x3e, 0x34, 0x5f, 0x50, 0xbe, 0xbc, 0x2f, 0x75, + 0x4b, 0xf7, 0xab, 0x06, 0x77, 0x5f, 0xb2, 0xa4, 0xa0, 0x53, 0xaa, 0xea, 0xd1, 0xb4, 0x57, 0xc6, + 0x73, 0x05, 0xf5, 0x9c, 0x82, 0x75, 0xd0, 0xcf, 0x94, 0xad, 0xaa, 0x8e, 0x7e, 0xe6, 0xe6, 0x5c, + 0x52, 0xb2, 0x8c, 0x9c, 0x4b, 0x72, 0x1e, 0x2c, 0xcb, 0x35, 0x33, 0x0f, 0x66, 0x56, 0xab, 0xc8, + 0xaa, 0xb2, 0x5a, 0x2a, 0xf4, 0xea, 0x5c, 0xe8, 0xee, 0x31, 0xdc, 0xb9, 0xb9, 0x67, 0x1c, 0xcc, + 0x84, 0x7f, 0x78, 0xc4, 0x49, 0x90, 0xae, 0xa9, 0x12, 0x34, 0x00, 0x58, 0x3c, 0x58, 0xac, 0x5b, + 0x46, 0xaf, 0x36, 0x40, 0x7d, 0xf5, 0x62, 0xfb, 0x39, 0x8a, 0x5c, 0xd7, 0xe0, 0x8b, 0x01, 0xeb, + 0x0b, 0x68, 0x78, 0x78, 0x80, 0x8e, 0xa0, 0xf1, 0x46, 0x7e, 0xfb, 0xdc, 0x6b, 0x2b, 0x60, 0x31, + 0x37, 0x6f, 0x69, 0xf8, 0x5c, 0x3c, 0xd7, 0xee, 0xce, 0xa7, 0xef, 0xbf, 0x3f, 0xeb, 0x2d, 0x13, + 0xd9, 0xb7, 0x7e, 0x22, 0x8f, 0xb5, 0x5d, 0xe4, 0x41, 0xe3, 0xa6, 0x9a, 0xa8, 0x93, 0xd1, 0x2f, + 0xd1, 0x79, 0xe9, 0x2c, 0x53, 0xce, 0x6a, 0xee, 0x16, 0xcc, 0x42, 0x47, 0xb0, 0x7e, 0xcd, 0x0b, + 0x68, 0x3b, 0x9b, 0x52, 0x64, 0x11, 0xb3, 0xe0, 0x8a, 0x19, 0x3d, 0x2a, 0xa2, 0x0f, 0xa1, 0x7e, + 0x5d, 0x19, 0xb4, 0x93, 0x31, 0x14, 0x3a, 0xcb, 0xdc, 0x5a, 0x06, 0xc7, 0xc1, 0xac, 0xdb, 0x91, + 0x93, 0xee, 0xa1, 0xd6, 0xed, 0x49, 0x76, 0xc0, 0x12, 0xbe, 0xff, 0xe8, 0xdb, 0x65, 0x5b, 0xbb, + 0xb8, 0x6c, 0x6b, 0xbf, 0x2e, 0xdb, 0xda, 0xf9, 0x55, 0x7b, 0xe5, 0xe2, 0xaa, 0xbd, 0xf2, 0xe3, + 0xaa, 0xbd, 0x02, 0xe9, 0x2f, 0xf9, 0x50, 0x7b, 0xbb, 0x11, 0x46, 0x13, 0xea, 0x46, 0xa3, 0x94, + 0xe3, 0xc9, 0xe9, 0xde, 0x49, 0x45, 0x7e, 0xb0, 0x87, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x19, + 0xf0, 0xa5, 0xd4, 0xd1, 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 + +// AttachmentAPIClient is the client API for AttachmentAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AttachmentAPIClient interface { + UpdateAttachment(ctx context.Context, in *Attachment, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) + ListAttachment(ctx context.Context, in *ListAttachmentRequest, opts ...grpc.CallOption) (*ListAttachmentReply, error) +} + +type attachmentAPIClient struct { + cc *grpc.ClientConn +} + +func NewAttachmentAPIClient(cc *grpc.ClientConn) AttachmentAPIClient { + return &attachmentAPIClient{cc} +} + +func (c *attachmentAPIClient) UpdateAttachment(ctx context.Context, in *Attachment, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.AttachmentAPI/UpdateAttachment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentAPIClient) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.AttachmentAPI/DeleteAttachment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentAPIClient) GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) { + out := new(Attachment) + err := c.cc.Invoke(ctx, "/api.v1.AttachmentAPI/GetAttachment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentAPIClient) ListAttachment(ctx context.Context, in *ListAttachmentRequest, opts ...grpc.CallOption) (*ListAttachmentReply, error) { + out := new(ListAttachmentReply) + err := c.cc.Invoke(ctx, "/api.v1.AttachmentAPI/ListAttachment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AttachmentAPIServer is the server API for AttachmentAPI service. +type AttachmentAPIServer interface { + UpdateAttachment(context.Context, *Attachment) (*emptypb.Empty, error) + DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) + GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) + ListAttachment(context.Context, *ListAttachmentRequest) (*ListAttachmentReply, error) +} + +// UnimplementedAttachmentAPIServer can be embedded to have forward compatible implementations. +type UnimplementedAttachmentAPIServer struct { +} + +func (*UnimplementedAttachmentAPIServer) UpdateAttachment(ctx context.Context, req *Attachment) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAttachment not implemented") +} +func (*UnimplementedAttachmentAPIServer) DeleteAttachment(ctx context.Context, req *DeleteAttachmentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachment not implemented") +} +func (*UnimplementedAttachmentAPIServer) GetAttachment(ctx context.Context, req *GetAttachmentRequest) (*Attachment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAttachment not implemented") +} +func (*UnimplementedAttachmentAPIServer) ListAttachment(ctx context.Context, req *ListAttachmentRequest) (*ListAttachmentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAttachment not implemented") +} + +func RegisterAttachmentAPIServer(s *grpc.Server, srv AttachmentAPIServer) { + s.RegisterService(&_AttachmentAPI_serviceDesc, srv) +} + +func _AttachmentAPI_UpdateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Attachment) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentAPIServer).UpdateAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.AttachmentAPI/UpdateAttachment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentAPIServer).UpdateAttachment(ctx, req.(*Attachment)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentAPI_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentAPIServer).DeleteAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.AttachmentAPI/DeleteAttachment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentAPIServer).DeleteAttachment(ctx, req.(*DeleteAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentAPI_GetAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentAPIServer).GetAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.AttachmentAPI/GetAttachment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentAPIServer).GetAttachment(ctx, req.(*GetAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentAPI_ListAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentAPIServer).ListAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.AttachmentAPI/ListAttachment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentAPIServer).ListAttachment(ctx, req.(*ListAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AttachmentAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.AttachmentAPI", + HandlerType: (*AttachmentAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateAttachment", + Handler: _AttachmentAPI_UpdateAttachment_Handler, + }, + { + MethodName: "DeleteAttachment", + Handler: _AttachmentAPI_DeleteAttachment_Handler, + }, + { + MethodName: "GetAttachment", + Handler: _AttachmentAPI_GetAttachment_Handler, + }, + { + MethodName: "ListAttachment", + Handler: _AttachmentAPI_ListAttachment_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/attachment.proto", +} + +func (m *Attachment) 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 *Attachment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.TypeName) > 0 { + i -= len(m.TypeName) + copy(dAtA[i:], m.TypeName) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.TypeName))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + 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 = encodeVarintAttachment(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x7a + } + 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 = encodeVarintAttachment(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x72 + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x6a + } + if len(m.Ext) > 0 { + i -= len(m.Ext) + copy(dAtA[i:], m.Ext) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Ext))) + i-- + dAtA[i] = 0x62 + } + if m.Height != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x58 + } + if m.Width != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Width)) + i-- + dAtA[i] = 0x50 + } + if m.Size_ != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x48 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x42 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x3a + } + if m.Enable { + i-- + if m.Enable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Type != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x28 + } + if m.TypeId != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.TypeId)) + i-- + dAtA[i] = 0x20 + } + if m.UserId != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteAttachmentRequest) 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 *DeleteAttachmentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteAttachmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintAttachment(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetAttachmentRequest) 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 *GetAttachmentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAttachmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListAttachmentRequest) 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 *ListAttachmentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListAttachmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ext) > 0 { + i -= len(m.Ext) + copy(dAtA[i:], m.Ext) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Ext))) + i-- + dAtA[i] = 0x3a + } + if len(m.Type) > 0 { + dAtA6 := make([]byte, len(m.Type)*10) + var j5 int + for _, num1 := range m.Type { + 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 = encodeVarintAttachment(dAtA, i, uint64(j5)) + i-- + dAtA[i] = 0x32 + } + if len(m.UserId) > 0 { + dAtA8 := make([]byte, len(m.UserId)*10) + var j7 int + for _, num1 := range m.UserId { + num := uint64(num1) + for num >= 1<<7 { + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j7++ + } + dAtA8[j7] = uint8(num) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintAttachment(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintAttachment(dAtA, i, uint64(len(m.Enable))) + i-- + dAtA[i] = 0x22 + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintAttachment(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListAttachmentReply) 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 *ListAttachmentReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListAttachmentReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attachment) > 0 { + for iNdEx := len(m.Attachment) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attachment[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttachment(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintAttachment(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAttachment(dAtA []byte, offset int, v uint64) int { + offset -= sovAttachment(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Attachment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovAttachment(uint64(m.Id)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + if m.UserId != 0 { + n += 1 + sovAttachment(uint64(m.UserId)) + } + if m.TypeId != 0 { + n += 1 + sovAttachment(uint64(m.TypeId)) + } + if m.Type != 0 { + n += 1 + sovAttachment(uint64(m.Type)) + } + if m.Enable { + n += 2 + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + if m.Size_ != 0 { + n += 1 + sovAttachment(uint64(m.Size_)) + } + if m.Width != 0 { + n += 1 + sovAttachment(uint64(m.Width)) + } + if m.Height != 0 { + n += 1 + sovAttachment(uint64(m.Height)) + } + l = len(m.Ext) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovAttachment(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovAttachment(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 2 + l + sovAttachment(uint64(l)) + } + l = len(m.TypeName) + if l > 0 { + n += 2 + l + sovAttachment(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 2 + l + sovAttachment(uint64(l)) + } + return n +} + +func (m *DeleteAttachmentRequest) 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 += sovAttachment(uint64(e)) + } + n += 1 + sovAttachment(uint64(l)) + l + } + return n +} + +func (m *GetAttachmentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovAttachment(uint64(m.Id)) + } + return n +} + +func (m *ListAttachmentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovAttachment(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovAttachment(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + if len(m.Enable) > 0 { + n += 1 + sovAttachment(uint64(len(m.Enable))) + len(m.Enable)*1 + } + if len(m.UserId) > 0 { + l = 0 + for _, e := range m.UserId { + l += sovAttachment(uint64(e)) + } + n += 1 + sovAttachment(uint64(l)) + l + } + if len(m.Type) > 0 { + l = 0 + for _, e := range m.Type { + l += sovAttachment(uint64(e)) + } + n += 1 + sovAttachment(uint64(l)) + l + } + l = len(m.Ext) + if l > 0 { + n += 1 + l + sovAttachment(uint64(l)) + } + return n +} + +func (m *ListAttachmentReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovAttachment(uint64(m.Total)) + } + if len(m.Attachment) > 0 { + for _, e := range m.Attachment { + l = e.Size() + n += 1 + l + sovAttachment(uint64(l)) + } + } + return n +} + +func sovAttachment(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAttachment(x uint64) (n int) { + return sovAttachment(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Attachment) 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 ErrIntOverflowAttachment + } + 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: Attachment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Attachment: 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TypeId", wireType) + } + m.TypeId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TypeId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= 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 ErrIntOverflowAttachment + } + 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 Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) + } + m.Width = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Width |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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 15: + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TypeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TypeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + 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 ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttachment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttachment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteAttachmentRequest) 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 ErrIntOverflowAttachment + } + 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: DeleteAttachmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteAttachmentRequest: 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 ErrIntOverflowAttachment + } + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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 ErrIntOverflowAttachment + } + 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 := skipAttachment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttachment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAttachmentRequest) 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 ErrIntOverflowAttachment + } + 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: GetAttachmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAttachmentRequest: 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 ErrIntOverflowAttachment + } + 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 := skipAttachment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttachment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListAttachmentRequest) 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 ErrIntOverflowAttachment + } + 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: ListAttachmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListAttachmentRequest: 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 ErrIntOverflowAttachment + } + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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 ErrIntOverflowAttachment + } + 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 5: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserId = append(m.UserId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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.UserId) == 0 { + m.UserId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserId = append(m.UserId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + case 6: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = append(m.Type, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + 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.Type) == 0 { + m.Type = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = append(m.Type, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + 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 ErrInvalidLengthAttachment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttachment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttachment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListAttachmentReply) 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 ErrIntOverflowAttachment + } + 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: ListAttachmentReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListAttachmentReply: 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 ErrIntOverflowAttachment + } + 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 Attachment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttachment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAttachment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAttachment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attachment = append(m.Attachment, &Attachment{}) + if err := m.Attachment[len(m.Attachment)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttachment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttachment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAttachment(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, ErrIntOverflowAttachment + } + 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, ErrIntOverflowAttachment + } + 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, ErrIntOverflowAttachment + } + 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, ErrInvalidLengthAttachment + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAttachment + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAttachment + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAttachment = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAttachment = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAttachment = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/attachment.pb.gw.go b/api/v1/attachment.pb.gw.go new file mode 100644 index 0000000..1760e1b --- /dev/null +++ b/api/v1/attachment.pb.gw.go @@ -0,0 +1,418 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/attachment.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_AttachmentAPI_UpdateAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AttachmentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Attachment + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AttachmentAPI_UpdateAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AttachmentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Attachment + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateAttachment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_AttachmentAPI_DeleteAttachment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AttachmentAPI_DeleteAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AttachmentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteAttachmentRequest + 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_AttachmentAPI_DeleteAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AttachmentAPI_DeleteAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AttachmentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteAttachmentRequest + 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_AttachmentAPI_DeleteAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteAttachment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_AttachmentAPI_GetAttachment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AttachmentAPI_GetAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AttachmentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAttachmentRequest + 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_AttachmentAPI_GetAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AttachmentAPI_GetAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AttachmentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAttachmentRequest + 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_AttachmentAPI_GetAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAttachment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_AttachmentAPI_ListAttachment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AttachmentAPI_ListAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AttachmentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAttachmentRequest + 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_AttachmentAPI_ListAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AttachmentAPI_ListAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AttachmentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAttachmentRequest + 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_AttachmentAPI_ListAttachment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListAttachment(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAttachmentAPIHandlerServer registers the http handlers for service AttachmentAPI to "mux". +// UnaryRPC :call AttachmentAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAttachmentAPIHandlerFromEndpoint instead. +func RegisterAttachmentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AttachmentAPIServer) error { + + mux.Handle("PUT", pattern_AttachmentAPI_UpdateAttachment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AttachmentAPI_UpdateAttachment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_UpdateAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_AttachmentAPI_DeleteAttachment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AttachmentAPI_DeleteAttachment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_DeleteAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AttachmentAPI_GetAttachment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AttachmentAPI_GetAttachment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_GetAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AttachmentAPI_ListAttachment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AttachmentAPI_ListAttachment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_ListAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAttachmentAPIHandlerFromEndpoint is same as RegisterAttachmentAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAttachmentAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAttachmentAPIHandler(ctx, mux, conn) +} + +// RegisterAttachmentAPIHandler registers the http handlers for service AttachmentAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAttachmentAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAttachmentAPIHandlerClient(ctx, mux, NewAttachmentAPIClient(conn)) +} + +// RegisterAttachmentAPIHandlerClient registers the http handlers for service AttachmentAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AttachmentAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AttachmentAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AttachmentAPIClient" to call the correct interceptors. +func RegisterAttachmentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AttachmentAPIClient) error { + + mux.Handle("PUT", pattern_AttachmentAPI_UpdateAttachment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AttachmentAPI_UpdateAttachment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_UpdateAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_AttachmentAPI_DeleteAttachment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AttachmentAPI_DeleteAttachment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_DeleteAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AttachmentAPI_GetAttachment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AttachmentAPI_GetAttachment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_GetAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AttachmentAPI_ListAttachment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AttachmentAPI_ListAttachment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AttachmentAPI_ListAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AttachmentAPI_UpdateAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "attachment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_AttachmentAPI_DeleteAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "attachment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_AttachmentAPI_GetAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "attachment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_AttachmentAPI_ListAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "attachment", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_AttachmentAPI_UpdateAttachment_0 = runtime.ForwardResponseMessage + + forward_AttachmentAPI_DeleteAttachment_0 = runtime.ForwardResponseMessage + + forward_AttachmentAPI_GetAttachment_0 = runtime.ForwardResponseMessage + + forward_AttachmentAPI_ListAttachment_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/banner.pb.go b/api/v1/banner.pb.go new file mode 100644 index 0000000..2e314b5 --- /dev/null +++ b/api/v1/banner.pb.go @@ -0,0 +1,2091 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/banner.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 Banner struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Enable bool `protobuf:"varint,5,opt,name=enable,proto3" json:"enable,omitempty"` + Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` + Url string `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"` + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Banner) Reset() { *m = Banner{} } +func (m *Banner) String() string { return proto.CompactTextString(m) } +func (*Banner) ProtoMessage() {} +func (*Banner) Descriptor() ([]byte, []int) { + return fileDescriptor_e028cf1a00a0e665, []int{0} +} +func (m *Banner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Banner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Banner.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 *Banner) XXX_Merge(src proto.Message) { + xxx_messageInfo_Banner.Merge(m, src) +} +func (m *Banner) XXX_Size() int { + return m.Size() +} +func (m *Banner) XXX_DiscardUnknown() { + xxx_messageInfo_Banner.DiscardUnknown(m) +} + +var xxx_messageInfo_Banner proto.InternalMessageInfo + +func (m *Banner) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Banner) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Banner) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Banner) GetSort() int32 { + if m != nil { + return m.Sort + } + return 0 +} + +func (m *Banner) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + +func (m *Banner) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Banner) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Banner) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Banner) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Banner) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteBannerRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteBannerRequest) Reset() { *m = DeleteBannerRequest{} } +func (m *DeleteBannerRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteBannerRequest) ProtoMessage() {} +func (*DeleteBannerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e028cf1a00a0e665, []int{1} +} +func (m *DeleteBannerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteBannerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteBannerRequest.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 *DeleteBannerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteBannerRequest.Merge(m, src) +} +func (m *DeleteBannerRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteBannerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteBannerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteBannerRequest proto.InternalMessageInfo + +func (m *DeleteBannerRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetBannerRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetBannerRequest) Reset() { *m = GetBannerRequest{} } +func (m *GetBannerRequest) String() string { return proto.CompactTextString(m) } +func (*GetBannerRequest) ProtoMessage() {} +func (*GetBannerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e028cf1a00a0e665, []int{2} +} +func (m *GetBannerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetBannerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetBannerRequest.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 *GetBannerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBannerRequest.Merge(m, src) +} +func (m *GetBannerRequest) XXX_Size() int { + return m.Size() +} +func (m *GetBannerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetBannerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBannerRequest proto.InternalMessageInfo + +func (m *GetBannerRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type ListBannerRequest 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"` + Type []int32 `protobuf:"varint,3,rep,packed,name=type,proto3" json:"type,omitempty"` + Enable []bool `protobuf:"varint,4,rep,packed,name=enable,proto3" json:"enable,omitempty"` + Wd string `protobuf:"bytes,5,opt,name=wd,proto3" json:"wd,omitempty"` + Field []string `protobuf:"bytes,6,rep,name=field,proto3" json:"field,omitempty"` +} + +func (m *ListBannerRequest) Reset() { *m = ListBannerRequest{} } +func (m *ListBannerRequest) String() string { return proto.CompactTextString(m) } +func (*ListBannerRequest) ProtoMessage() {} +func (*ListBannerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e028cf1a00a0e665, []int{3} +} +func (m *ListBannerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListBannerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListBannerRequest.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 *ListBannerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListBannerRequest.Merge(m, src) +} +func (m *ListBannerRequest) XXX_Size() int { + return m.Size() +} +func (m *ListBannerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListBannerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListBannerRequest proto.InternalMessageInfo + +func (m *ListBannerRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListBannerRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListBannerRequest) GetType() []int32 { + if m != nil { + return m.Type + } + return nil +} + +func (m *ListBannerRequest) GetEnable() []bool { + if m != nil { + return m.Enable + } + return nil +} + +func (m *ListBannerRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListBannerRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +type ListBannerReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Banner []*Banner `protobuf:"bytes,2,rep,name=banner,proto3" json:"banner,omitempty"` +} + +func (m *ListBannerReply) Reset() { *m = ListBannerReply{} } +func (m *ListBannerReply) String() string { return proto.CompactTextString(m) } +func (*ListBannerReply) ProtoMessage() {} +func (*ListBannerReply) Descriptor() ([]byte, []int) { + return fileDescriptor_e028cf1a00a0e665, []int{4} +} +func (m *ListBannerReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListBannerReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListBannerReply.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 *ListBannerReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListBannerReply.Merge(m, src) +} +func (m *ListBannerReply) XXX_Size() int { + return m.Size() +} +func (m *ListBannerReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListBannerReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListBannerReply proto.InternalMessageInfo + +func (m *ListBannerReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListBannerReply) GetBanner() []*Banner { + if m != nil { + return m.Banner + } + return nil +} + +func init() { + proto.RegisterType((*Banner)(nil), "api.v1.Banner") + proto.RegisterType((*DeleteBannerRequest)(nil), "api.v1.DeleteBannerRequest") + proto.RegisterType((*GetBannerRequest)(nil), "api.v1.GetBannerRequest") + proto.RegisterType((*ListBannerRequest)(nil), "api.v1.ListBannerRequest") + proto.RegisterType((*ListBannerReply)(nil), "api.v1.ListBannerReply") +} + +func init() { proto.RegisterFile("api/v1/banner.proto", fileDescriptor_e028cf1a00a0e665) } + +var fileDescriptor_e028cf1a00a0e665 = []byte{ + // 613 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x3b, 0xc9, 0x36, 0x36, 0x6f, 0xcb, 0xda, 0xce, 0xd6, 0x3a, 0x4d, 0x25, 0x0d, 0x01, + 0x25, 0xf4, 0x90, 0xd0, 0x8a, 0x17, 0x3d, 0x48, 0xab, 0x22, 0x05, 0xc5, 0x1a, 0xf4, 0xa2, 0x88, + 0x64, 0x9b, 0xe9, 0x1a, 0xc8, 0x66, 0x62, 0x32, 0xdb, 0xb2, 0x1e, 0xbd, 0x0b, 0x05, 0xbf, 0x8a, + 0x07, 0x3f, 0x82, 0xc7, 0x82, 0x17, 0x6f, 0x4a, 0xeb, 0x07, 0x91, 0xcc, 0x4c, 0xb6, 0xbb, 0xd9, + 0x2d, 0x78, 0x7b, 0xff, 0xfe, 0xc8, 0x3c, 0xcf, 0xbb, 0x0b, 0x9d, 0x28, 0x4f, 0x82, 0xe3, 0xed, + 0xa0, 0x1b, 0x65, 0x19, 0x2d, 0xfc, 0xbc, 0x60, 0x9c, 0x61, 0x23, 0xca, 0x13, 0xff, 0x78, 0xdb, + 0xda, 0xec, 0x31, 0xd6, 0x4b, 0x69, 0x20, 0xaa, 0xdd, 0xc1, 0x51, 0xc0, 0x93, 0x3e, 0x2d, 0x79, + 0xd4, 0xcf, 0xe5, 0xa0, 0xb5, 0xda, 0x63, 0x3d, 0x26, 0xc2, 0xa0, 0x8a, 0x54, 0xf5, 0x96, 0x5a, + 0xab, 0xd0, 0x51, 0x96, 0x31, 0x1e, 0xf1, 0x84, 0x65, 0xa5, 0xea, 0x6e, 0x34, 0xa1, 0xb4, 0x9f, + 0xf3, 0xa1, 0x6c, 0xba, 0xdf, 0x35, 0x30, 0xf6, 0xc4, 0xa7, 0xe0, 0x36, 0x68, 0x49, 0x4c, 0x90, + 0x83, 0x3c, 0x3d, 0xd4, 0x92, 0x18, 0xaf, 0xc2, 0x3c, 0x4f, 0x78, 0x4a, 0x89, 0xe6, 0x20, 0xcf, + 0x0c, 0x65, 0x82, 0x31, 0xb4, 0xf2, 0x88, 0x7f, 0x20, 0xba, 0x28, 0x8a, 0xb8, 0xaa, 0x95, 0xac, + 0xe0, 0xa4, 0xe5, 0x20, 0x6f, 0x3e, 0x14, 0x31, 0x5e, 0x03, 0x83, 0x66, 0x51, 0x37, 0xa5, 0x64, + 0xde, 0x41, 0xde, 0x42, 0xa8, 0xb2, 0x6a, 0x96, 0x0f, 0x73, 0x4a, 0x0c, 0x39, 0x5b, 0xc5, 0x78, + 0x19, 0xf4, 0x41, 0x91, 0x92, 0x6b, 0x02, 0x59, 0x85, 0xd8, 0x81, 0xc5, 0x98, 0x96, 0x87, 0x45, + 0x92, 0x57, 0x2f, 0x21, 0x0b, 0xa2, 0x33, 0x5e, 0xc2, 0x0f, 0x01, 0x0e, 0x0b, 0x1a, 0x71, 0x1a, + 0xbf, 0x8f, 0x38, 0x31, 0x1d, 0xe4, 0x2d, 0xee, 0x58, 0xbe, 0x7c, 0xaa, 0x5f, 0x3f, 0xd5, 0x7f, + 0x55, 0xeb, 0xb7, 0xd7, 0x3a, 0xfd, 0xbd, 0x89, 0x42, 0x53, 0xed, 0xec, 0xf2, 0x0a, 0x30, 0xc8, + 0xe3, 0x1a, 0x00, 0xff, 0x0b, 0x50, 0x3b, 0xbb, 0xdc, 0xbd, 0x0d, 0x9d, 0xc7, 0x34, 0xa5, 0x9c, + 0x4a, 0xfd, 0x42, 0xfa, 0x71, 0x40, 0x4b, 0x3e, 0x92, 0x51, 0x97, 0x32, 0xba, 0x2e, 0x2c, 0x3f, + 0xa5, 0x7c, 0xf6, 0x8c, 0x92, 0xda, 0xfd, 0x82, 0x60, 0xe5, 0x59, 0x52, 0x36, 0xa6, 0x84, 0xd4, + 0x3d, 0xaa, 0xe6, 0x44, 0x2c, 0xa4, 0x4e, 0x3e, 0x49, 0x4f, 0xf4, 0x50, 0xc4, 0x23, 0x49, 0x75, + 0x47, 0x1f, 0x49, 0x7a, 0x29, 0x7f, 0xcb, 0xd1, 0xc7, 0xe4, 0x6f, 0x83, 0x76, 0x12, 0x0b, 0x4b, + 0xcc, 0x50, 0x3b, 0x11, 0x26, 0x1f, 0x25, 0x34, 0x8d, 0x89, 0xe1, 0xe8, 0x95, 0xc9, 0x22, 0x71, + 0x5f, 0xc0, 0xf5, 0xf1, 0xcf, 0xc9, 0xd3, 0xa1, 0xb8, 0x06, 0xc6, 0xa3, 0x54, 0x7d, 0x8d, 0x4c, + 0xf0, 0x1d, 0x30, 0xe4, 0x21, 0x13, 0xcd, 0xd1, 0xbd, 0xc5, 0x9d, 0xb6, 0x2f, 0x2f, 0xd9, 0x57, + 0xab, 0xaa, 0xbb, 0xf3, 0x4d, 0x07, 0x53, 0x96, 0x76, 0x0f, 0xf6, 0xf1, 0x3e, 0x2c, 0x3d, 0x12, + 0x3e, 0xd4, 0x97, 0x37, 0xb9, 0x65, 0x35, 0x72, 0x77, 0xfd, 0xf3, 0xcf, 0xbf, 0x5f, 0xb5, 0x8e, + 0xdb, 0x0e, 0x26, 0x7e, 0x3c, 0xf7, 0xd1, 0x16, 0x7e, 0x09, 0x4b, 0xaf, 0x85, 0x23, 0x57, 0xa0, + 0xd6, 0xa6, 0x1c, 0x7d, 0x52, 0x5d, 0x7f, 0x8d, 0xb4, 0x66, 0x20, 0xdf, 0xc2, 0xd2, 0xb8, 0xaf, + 0x78, 0xa3, 0x46, 0xce, 0x70, 0xfb, 0x4a, 0xfe, 0x9a, 0xe0, 0x2f, 0x6f, 0x35, 0xf8, 0xf8, 0x39, + 0x98, 0xa3, 0x6b, 0xc0, 0xa4, 0x26, 0x37, 0x0f, 0x64, 0x4a, 0x01, 0x85, 0xc3, 0x4d, 0xdc, 0x3b, + 0x80, 0x4b, 0xa3, 0xf0, 0x7a, 0xbd, 0x35, 0x75, 0x4b, 0xd6, 0xcd, 0x59, 0xad, 0x3c, 0x1d, 0xba, + 0x1b, 0x82, 0x7c, 0x03, 0x77, 0x26, 0xc9, 0x41, 0x5a, 0xcd, 0xdd, 0xfb, 0x71, 0x6e, 0xa3, 0xb3, + 0x73, 0x1b, 0xfd, 0x39, 0xb7, 0xd1, 0xe9, 0x85, 0x3d, 0x77, 0x76, 0x61, 0xcf, 0xfd, 0xba, 0xb0, + 0xe7, 0x40, 0xfd, 0x63, 0x1d, 0xa0, 0x37, 0x2b, 0x7d, 0x56, 0xd0, 0x98, 0x1d, 0xaa, 0xfd, 0x07, + 0xc7, 0xdb, 0x5d, 0x43, 0x88, 0x71, 0xf7, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x77, 0xab, 0xf3, + 0x70, 0xec, 0x04, 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 + +// BannerAPIClient is the client API for BannerAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type BannerAPIClient interface { + CreateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*Banner, error) + UpdateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteBanner(ctx context.Context, in *DeleteBannerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetBanner(ctx context.Context, in *GetBannerRequest, opts ...grpc.CallOption) (*Banner, error) + ListBanner(ctx context.Context, in *ListBannerRequest, opts ...grpc.CallOption) (*ListBannerReply, error) +} + +type bannerAPIClient struct { + cc *grpc.ClientConn +} + +func NewBannerAPIClient(cc *grpc.ClientConn) BannerAPIClient { + return &bannerAPIClient{cc} +} + +func (c *bannerAPIClient) CreateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*Banner, error) { + out := new(Banner) + err := c.cc.Invoke(ctx, "/api.v1.BannerAPI/CreateBanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bannerAPIClient) UpdateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.BannerAPI/UpdateBanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bannerAPIClient) DeleteBanner(ctx context.Context, in *DeleteBannerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.BannerAPI/DeleteBanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bannerAPIClient) GetBanner(ctx context.Context, in *GetBannerRequest, opts ...grpc.CallOption) (*Banner, error) { + out := new(Banner) + err := c.cc.Invoke(ctx, "/api.v1.BannerAPI/GetBanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bannerAPIClient) ListBanner(ctx context.Context, in *ListBannerRequest, opts ...grpc.CallOption) (*ListBannerReply, error) { + out := new(ListBannerReply) + err := c.cc.Invoke(ctx, "/api.v1.BannerAPI/ListBanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BannerAPIServer is the server API for BannerAPI service. +type BannerAPIServer interface { + CreateBanner(context.Context, *Banner) (*Banner, error) + UpdateBanner(context.Context, *Banner) (*emptypb.Empty, error) + DeleteBanner(context.Context, *DeleteBannerRequest) (*emptypb.Empty, error) + GetBanner(context.Context, *GetBannerRequest) (*Banner, error) + ListBanner(context.Context, *ListBannerRequest) (*ListBannerReply, error) +} + +// UnimplementedBannerAPIServer can be embedded to have forward compatible implementations. +type UnimplementedBannerAPIServer struct { +} + +func (*UnimplementedBannerAPIServer) CreateBanner(ctx context.Context, req *Banner) (*Banner, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBanner not implemented") +} +func (*UnimplementedBannerAPIServer) UpdateBanner(ctx context.Context, req *Banner) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBanner not implemented") +} +func (*UnimplementedBannerAPIServer) DeleteBanner(ctx context.Context, req *DeleteBannerRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBanner not implemented") +} +func (*UnimplementedBannerAPIServer) GetBanner(ctx context.Context, req *GetBannerRequest) (*Banner, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBanner not implemented") +} +func (*UnimplementedBannerAPIServer) ListBanner(ctx context.Context, req *ListBannerRequest) (*ListBannerReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBanner not implemented") +} + +func RegisterBannerAPIServer(s *grpc.Server, srv BannerAPIServer) { + s.RegisterService(&_BannerAPI_serviceDesc, srv) +} + +func _BannerAPI_CreateBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Banner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BannerAPIServer).CreateBanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BannerAPI/CreateBanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BannerAPIServer).CreateBanner(ctx, req.(*Banner)) + } + return interceptor(ctx, in, info, handler) +} + +func _BannerAPI_UpdateBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Banner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BannerAPIServer).UpdateBanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BannerAPI/UpdateBanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BannerAPIServer).UpdateBanner(ctx, req.(*Banner)) + } + return interceptor(ctx, in, info, handler) +} + +func _BannerAPI_DeleteBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBannerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BannerAPIServer).DeleteBanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BannerAPI/DeleteBanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BannerAPIServer).DeleteBanner(ctx, req.(*DeleteBannerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BannerAPI_GetBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBannerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BannerAPIServer).GetBanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BannerAPI/GetBanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BannerAPIServer).GetBanner(ctx, req.(*GetBannerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BannerAPI_ListBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBannerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BannerAPIServer).ListBanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BannerAPI/ListBanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BannerAPIServer).ListBanner(ctx, req.(*ListBannerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BannerAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.BannerAPI", + HandlerType: (*BannerAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateBanner", + Handler: _BannerAPI_CreateBanner_Handler, + }, + { + MethodName: "UpdateBanner", + Handler: _BannerAPI_UpdateBanner_Handler, + }, + { + MethodName: "DeleteBanner", + Handler: _BannerAPI_DeleteBanner_Handler, + }, + { + MethodName: "GetBanner", + Handler: _BannerAPI_GetBanner_Handler, + }, + { + MethodName: "ListBanner", + Handler: _BannerAPI_ListBanner_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/banner.proto", +} + +func (m *Banner) 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 *Banner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Banner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 = encodeVarintBanner(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x52 + } + 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 = encodeVarintBanner(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x4a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBanner(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x42 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintBanner(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x3a + } + if m.Type != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x30 + } + if m.Enable { + i-- + if m.Enable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Sort != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Sort)) + i-- + dAtA[i] = 0x20 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintBanner(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintBanner(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteBannerRequest) 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 *DeleteBannerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteBannerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintBanner(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetBannerRequest) 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 *GetBannerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetBannerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListBannerRequest) 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 *ListBannerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListBannerRequest) 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 = encodeVarintBanner(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintBanner(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintBanner(dAtA, i, uint64(len(m.Enable))) + i-- + dAtA[i] = 0x22 + } + if len(m.Type) > 0 { + dAtA6 := make([]byte, len(m.Type)*10) + var j5 int + for _, num1 := range m.Type { + 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 = encodeVarintBanner(dAtA, i, uint64(j5)) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListBannerReply) 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 *ListBannerReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListBannerReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Banner) > 0 { + for iNdEx := len(m.Banner) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Banner[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBanner(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintBanner(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintBanner(dAtA []byte, offset int, v uint64) int { + offset -= sovBanner(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Banner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovBanner(uint64(m.Id)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovBanner(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovBanner(uint64(l)) + } + if m.Sort != 0 { + n += 1 + sovBanner(uint64(m.Sort)) + } + if m.Enable { + n += 2 + } + if m.Type != 0 { + n += 1 + sovBanner(uint64(m.Type)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovBanner(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBanner(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovBanner(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovBanner(uint64(l)) + } + return n +} + +func (m *DeleteBannerRequest) 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 += sovBanner(uint64(e)) + } + n += 1 + sovBanner(uint64(l)) + l + } + return n +} + +func (m *GetBannerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovBanner(uint64(m.Id)) + } + return n +} + +func (m *ListBannerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovBanner(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovBanner(uint64(m.Size_)) + } + if len(m.Type) > 0 { + l = 0 + for _, e := range m.Type { + l += sovBanner(uint64(e)) + } + n += 1 + sovBanner(uint64(l)) + l + } + if len(m.Enable) > 0 { + n += 1 + sovBanner(uint64(len(m.Enable))) + len(m.Enable)*1 + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovBanner(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovBanner(uint64(l)) + } + } + return n +} + +func (m *ListBannerReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovBanner(uint64(m.Total)) + } + if len(m.Banner) > 0 { + for _, e := range m.Banner { + l = e.Size() + n += 1 + l + sovBanner(uint64(l)) + } + } + return n +} + +func sovBanner(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBanner(x uint64) (n int) { + return sovBanner(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Banner) 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 ErrIntOverflowBanner + } + 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: Banner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Banner: 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + 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 ErrIntOverflowBanner + } + 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 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + 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 ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + 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 10: + 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + 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 + default: + iNdEx = preIndex + skippy, err := skipBanner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBanner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteBannerRequest) 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 ErrIntOverflowBanner + } + 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: DeleteBannerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteBannerRequest: 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 ErrIntOverflowBanner + } + 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + 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 ErrIntOverflowBanner + } + 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 := skipBanner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBanner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBannerRequest) 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 ErrIntOverflowBanner + } + 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: GetBannerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBannerRequest: 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 ErrIntOverflowBanner + } + 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 := skipBanner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBanner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListBannerRequest) 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 ErrIntOverflowBanner + } + 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: ListBannerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListBannerRequest: 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 ErrIntOverflowBanner + } + 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 ErrIntOverflowBanner + } + 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 int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = append(m.Type, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + 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.Type) == 0 { + m.Type = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = append(m.Type, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + case 4: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + 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 ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + 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 ErrIntOverflowBanner + } + 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 5: + 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 ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 ErrIntOverflowBanner + } + 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 ErrInvalidLengthBanner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBanner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBanner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListBannerReply) 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 ErrIntOverflowBanner + } + 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: ListBannerReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListBannerReply: 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 ErrIntOverflowBanner + } + 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 Banner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBanner + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBanner + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBanner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Banner = append(m.Banner, &Banner{}) + if err := m.Banner[len(m.Banner)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBanner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBanner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBanner(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, ErrIntOverflowBanner + } + 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, ErrIntOverflowBanner + } + 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, ErrIntOverflowBanner + } + 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, ErrInvalidLengthBanner + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBanner + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBanner + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBanner = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBanner = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBanner = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/banner.pb.gw.go b/api/v1/banner.pb.gw.go new file mode 100644 index 0000000..3b088fa --- /dev/null +++ b/api/v1/banner.pb.gw.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/banner.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_BannerAPI_CreateBanner_0(ctx context.Context, marshaler runtime.Marshaler, client BannerAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Banner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateBanner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BannerAPI_CreateBanner_0(ctx context.Context, marshaler runtime.Marshaler, server BannerAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Banner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateBanner(ctx, &protoReq) + return msg, metadata, err + +} + +func request_BannerAPI_UpdateBanner_0(ctx context.Context, marshaler runtime.Marshaler, client BannerAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Banner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateBanner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BannerAPI_UpdateBanner_0(ctx context.Context, marshaler runtime.Marshaler, server BannerAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Banner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateBanner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_BannerAPI_DeleteBanner_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BannerAPI_DeleteBanner_0(ctx context.Context, marshaler runtime.Marshaler, client BannerAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteBannerRequest + 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_BannerAPI_DeleteBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteBanner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BannerAPI_DeleteBanner_0(ctx context.Context, marshaler runtime.Marshaler, server BannerAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteBannerRequest + 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_BannerAPI_DeleteBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteBanner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_BannerAPI_GetBanner_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BannerAPI_GetBanner_0(ctx context.Context, marshaler runtime.Marshaler, client BannerAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBannerRequest + 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_BannerAPI_GetBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetBanner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BannerAPI_GetBanner_0(ctx context.Context, marshaler runtime.Marshaler, server BannerAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBannerRequest + 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_BannerAPI_GetBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetBanner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_BannerAPI_ListBanner_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BannerAPI_ListBanner_0(ctx context.Context, marshaler runtime.Marshaler, client BannerAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListBannerRequest + 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_BannerAPI_ListBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListBanner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BannerAPI_ListBanner_0(ctx context.Context, marshaler runtime.Marshaler, server BannerAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListBannerRequest + 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_BannerAPI_ListBanner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListBanner(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterBannerAPIHandlerServer registers the http handlers for service BannerAPI to "mux". +// UnaryRPC :call BannerAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBannerAPIHandlerFromEndpoint instead. +func RegisterBannerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BannerAPIServer) error { + + mux.Handle("POST", pattern_BannerAPI_CreateBanner_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BannerAPI_CreateBanner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_CreateBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_BannerAPI_UpdateBanner_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BannerAPI_UpdateBanner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_UpdateBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_BannerAPI_DeleteBanner_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BannerAPI_DeleteBanner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_DeleteBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_BannerAPI_GetBanner_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BannerAPI_GetBanner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_GetBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_BannerAPI_ListBanner_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BannerAPI_ListBanner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_ListBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterBannerAPIHandlerFromEndpoint is same as RegisterBannerAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterBannerAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterBannerAPIHandler(ctx, mux, conn) +} + +// RegisterBannerAPIHandler registers the http handlers for service BannerAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterBannerAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterBannerAPIHandlerClient(ctx, mux, NewBannerAPIClient(conn)) +} + +// RegisterBannerAPIHandlerClient registers the http handlers for service BannerAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BannerAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BannerAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "BannerAPIClient" to call the correct interceptors. +func RegisterBannerAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BannerAPIClient) error { + + mux.Handle("POST", pattern_BannerAPI_CreateBanner_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BannerAPI_CreateBanner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_CreateBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_BannerAPI_UpdateBanner_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BannerAPI_UpdateBanner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_UpdateBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_BannerAPI_DeleteBanner_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BannerAPI_DeleteBanner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_DeleteBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_BannerAPI_GetBanner_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BannerAPI_GetBanner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_GetBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_BannerAPI_ListBanner_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BannerAPI_ListBanner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BannerAPI_ListBanner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_BannerAPI_CreateBanner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "banner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_BannerAPI_UpdateBanner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "banner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_BannerAPI_DeleteBanner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "banner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_BannerAPI_GetBanner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "banner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_BannerAPI_ListBanner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "banner", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_BannerAPI_CreateBanner_0 = runtime.ForwardResponseMessage + + forward_BannerAPI_UpdateBanner_0 = runtime.ForwardResponseMessage + + forward_BannerAPI_DeleteBanner_0 = runtime.ForwardResponseMessage + + forward_BannerAPI_GetBanner_0 = runtime.ForwardResponseMessage + + forward_BannerAPI_ListBanner_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/category.pb.go b/api/v1/category.pb.go new file mode 100644 index 0000000..46f9049 --- /dev/null +++ b/api/v1/category.pb.go @@ -0,0 +1,2026 @@ +// 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"` +} + +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 +} + +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{ + // 644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6a, 0xdb, 0x4c, + 0x10, 0xc7, 0xb3, 0x52, 0xec, 0xcf, 0x5e, 0x7f, 0x98, 0x64, 0x13, 0x27, 0xaa, 0xdc, 0x38, 0x42, + 0x14, 0x6a, 0x42, 0x2b, 0x91, 0x94, 0x5e, 0xd2, 0x43, 0x49, 0xd2, 0x52, 0x02, 0x3d, 0x04, 0xd1, + 0x10, 0xe8, 0x25, 0x6c, 0xb4, 0x13, 0xb1, 0x20, 0x6b, 0x15, 0x69, 0xed, 0x90, 0x1e, 0xfb, 0x04, + 0x81, 0x5e, 0xfa, 0x46, 0xed, 0x31, 0xd0, 0x4b, 0x4f, 0x6d, 0x48, 0xfa, 0x04, 0x7d, 0x82, 0xa2, + 0x95, 0x14, 0x6c, 0xcb, 0x81, 0xd2, 0xdb, 0xcc, 0x68, 0xe6, 0x3f, 0x33, 0xbf, 0x1d, 0x1b, 0x77, + 0x68, 0xcc, 0xdd, 0xd1, 0xa6, 0xeb, 0x53, 0x09, 0x81, 0x48, 0x2e, 0x9c, 0x38, 0x11, 0x52, 0x90, + 0x3a, 0x8d, 0xb9, 0x33, 0xda, 0x34, 0xd7, 0x03, 0x21, 0x82, 0x10, 0x5c, 0x15, 0x3d, 0x19, 0x9e, + 0xba, 0x92, 0x0f, 0x20, 0x95, 0x74, 0x10, 0xe7, 0x89, 0xe6, 0x72, 0x20, 0x02, 0xa1, 0x4c, 0x37, + 0xb3, 0x8a, 0xe8, 0xc3, 0xa2, 0x2c, 0x13, 0xa7, 0x51, 0x24, 0x24, 0x95, 0x5c, 0x44, 0x69, 0xf1, + 0xb5, 0x3b, 0x2d, 0x0a, 0x83, 0x58, 0x16, 0x9d, 0xed, 0x2f, 0x1a, 0x6e, 0xec, 0x15, 0xc3, 0x90, + 0x36, 0xd6, 0x38, 0x33, 0x90, 0x85, 0xfa, 0x35, 0x4f, 0xe3, 0x8c, 0x74, 0x71, 0x33, 0xa6, 0x09, + 0x44, 0xf2, 0x98, 0x33, 0x43, 0x53, 0xe1, 0x46, 0x1e, 0xd8, 0x67, 0xe4, 0x29, 0xae, 0x49, 0x2e, + 0x43, 0x30, 0x74, 0x0b, 0xf5, 0x9b, 0xbb, 0xab, 0xbf, 0x7f, 0xac, 0x2f, 0x8d, 0x68, 0xc8, 0x19, + 0x95, 0xb0, 0x6d, 0x27, 0x70, 0x36, 0xe4, 0x09, 0x30, 0xdb, 0xcb, 0xb3, 0x32, 0x2d, 0x26, 0xfc, + 0x63, 0x5f, 0x0c, 0x23, 0x69, 0xcc, 0xe7, 0x5a, 0x4c, 0xf8, 0x7b, 0x99, 0x4f, 0x08, 0x9e, 0x4f, + 0x45, 0x22, 0x8d, 0x9a, 0x8a, 0x2b, 0x9b, 0xac, 0xe0, 0x3a, 0x44, 0xf4, 0x24, 0x04, 0xa3, 0x6e, + 0xa1, 0x7e, 0xc3, 0x2b, 0x3c, 0xb2, 0x8c, 0x6b, 0xbe, 0x18, 0x41, 0x62, 0x34, 0xb3, 0xbe, 0x5e, + 0xee, 0x90, 0x97, 0x18, 0xfb, 0x09, 0x50, 0x09, 0xec, 0x98, 0x4a, 0xe3, 0x3f, 0x0b, 0xf5, 0x5b, + 0x5b, 0xa6, 0x93, 0x6f, 0xee, 0x94, 0x9b, 0x3b, 0xef, 0x4a, 0x9c, 0xbb, 0xf3, 0x97, 0x3f, 0xd7, + 0x91, 0xd7, 0x2c, 0x6a, 0x76, 0x64, 0x26, 0x30, 0x8c, 0x59, 0x29, 0xd0, 0xf8, 0x5b, 0x81, 0xa2, + 0x66, 0x47, 0xda, 0x9f, 0x11, 0x5e, 0x7a, 0xcb, 0x53, 0x59, 0xd2, 0xf4, 0xe0, 0x6c, 0x08, 0xa9, + 0xda, 0x2d, 0xa6, 0x01, 0x28, 0xac, 0xba, 0xa7, 0x6c, 0xb5, 0x2f, 0xff, 0x00, 0x8a, 0xa9, 0xee, + 0x29, 0x7b, 0x12, 0xb6, 0x6e, 0xe9, 0x7d, 0x7d, 0x0c, 0x76, 0x1b, 0x6b, 0xe7, 0x4c, 0x61, 0x6b, + 0x7a, 0xda, 0x39, 0x1b, 0x83, 0x53, 0xb3, 0xf4, 0x49, 0x38, 0xa7, 0x1c, 0x42, 0x66, 0xd4, 0x2d, + 0x3d, 0x83, 0xa3, 0x1c, 0xfb, 0x08, 0x2f, 0x4e, 0x4e, 0x16, 0x87, 0x17, 0x59, 0xaa, 0x14, 0x92, + 0x86, 0xc5, 0x60, 0xb9, 0x43, 0x9e, 0xe0, 0x46, 0x79, 0x9b, 0x86, 0x66, 0xe9, 0xfd, 0xd6, 0xd6, + 0x82, 0x93, 0x1f, 0xa7, 0x73, 0x57, 0x7e, 0x97, 0x61, 0x3f, 0xc6, 0x9d, 0x57, 0x10, 0x82, 0x84, + 0xe9, 0xa5, 0xcb, 0x4b, 0xca, 0xb6, 0xd0, 0x38, 0xb3, 0x1f, 0x61, 0xf2, 0x06, 0xe4, 0x7d, 0x59, + 0x28, 0xcf, 0xda, 0xba, 0xd6, 0x71, 0xab, 0xcc, 0xd9, 0x39, 0xd8, 0x27, 0x47, 0xb8, 0xbd, 0xa7, + 0x1e, 0xe8, 0xee, 0x42, 0x2b, 0xc3, 0x98, 0x2b, 0x95, 0x37, 0x7a, 0x9d, 0x9d, 0xb7, 0xdd, 0xfd, + 0xf8, 0xed, 0xd7, 0x27, 0xad, 0x63, 0x2f, 0xb8, 0x53, 0x3f, 0xb9, 0x6d, 0xb4, 0x91, 0x09, 0x1f, + 0xaa, 0x87, 0xfb, 0x77, 0x61, 0x73, 0xa6, 0x30, 0xc5, 0xed, 0x49, 0x20, 0x64, 0xad, 0x14, 0x9e, + 0x09, 0xea, 0xde, 0x2e, 0x86, 0xea, 0x42, 0x36, 0x2a, 0x5d, 0xc8, 0x21, 0x6e, 0x8d, 0xa1, 0x24, + 0x66, 0xa9, 0x5f, 0xe5, 0x6b, 0x56, 0x96, 0x2a, 0x65, 0x49, 0x55, 0x16, 0xf0, 0xff, 0xe3, 0x37, + 0x42, 0xba, 0x65, 0xed, 0x8c, 0x9b, 0x36, 0x1f, 0xcc, 0xfe, 0x18, 0x87, 0x17, 0xf6, 0x9a, 0xea, + 0xb0, 0x4a, 0x3a, 0xd3, 0x1d, 0xdc, 0x90, 0xa7, 0x72, 0xf7, 0xf9, 0xd7, 0x9b, 0x1e, 0xba, 0xba, + 0xe9, 0xa1, 0xeb, 0x9b, 0x1e, 0xba, 0xbc, 0xed, 0xcd, 0x5d, 0xdd, 0xf6, 0xe6, 0xbe, 0xdf, 0xf6, + 0xe6, 0x70, 0xf1, 0x1f, 0x78, 0x80, 0xde, 0x2f, 0x0e, 0x44, 0x02, 0x4c, 0xf8, 0x85, 0xc2, 0x8b, + 0xd1, 0xe6, 0x49, 0x5d, 0xe1, 0x79, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xac, 0x26, 0x45, + 0x40, 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 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)) + } + 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 + 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") +) diff --git a/api/v1/category.pb.gw.go b/api/v1/category.pb.gw.go new file mode 100644 index 0000000..6604517 --- /dev/null +++ b/api/v1/category.pb.gw.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/category.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_CategoryAPI_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Category + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CategoryAPI_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Category + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateCategory(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CategoryAPI_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Category + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + 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_CategoryAPI_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Category + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateCategory(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CategoryAPI_DeleteCategory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CategoryAPI_DeleteCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCategoryRequest + 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_CategoryAPI_DeleteCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CategoryAPI_DeleteCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCategoryRequest + 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_CategoryAPI_DeleteCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteCategory(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CategoryAPI_GetCategory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CategoryAPI_GetCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCategoryRequest + 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_CategoryAPI_GetCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CategoryAPI_GetCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCategoryRequest + 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_CategoryAPI_GetCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetCategory(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CategoryAPI_ListCategory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CategoryAPI_ListCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListCategoryRequest + 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_CategoryAPI_ListCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CategoryAPI_ListCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListCategoryRequest + 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_CategoryAPI_ListCategory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListCategory(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterCategoryAPIHandlerServer registers the http handlers for service CategoryAPI to "mux". +// UnaryRPC :call CategoryAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCategoryAPIHandlerFromEndpoint instead. +func RegisterCategoryAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CategoryAPIServer) error { + + mux.Handle("POST", pattern_CategoryAPI_CreateCategory_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CategoryAPI_CreateCategory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_CreateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CategoryAPI_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CategoryAPI_UpdateCategory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_UpdateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CategoryAPI_DeleteCategory_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CategoryAPI_DeleteCategory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_DeleteCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CategoryAPI_GetCategory_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CategoryAPI_GetCategory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_GetCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CategoryAPI_ListCategory_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CategoryAPI_ListCategory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_ListCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterCategoryAPIHandlerFromEndpoint is same as RegisterCategoryAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterCategoryAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterCategoryAPIHandler(ctx, mux, conn) +} + +// RegisterCategoryAPIHandler registers the http handlers for service CategoryAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterCategoryAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterCategoryAPIHandlerClient(ctx, mux, NewCategoryAPIClient(conn)) +} + +// RegisterCategoryAPIHandlerClient registers the http handlers for service CategoryAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CategoryAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CategoryAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "CategoryAPIClient" to call the correct interceptors. +func RegisterCategoryAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CategoryAPIClient) error { + + mux.Handle("POST", pattern_CategoryAPI_CreateCategory_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CategoryAPI_CreateCategory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_CreateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CategoryAPI_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CategoryAPI_UpdateCategory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_UpdateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CategoryAPI_DeleteCategory_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CategoryAPI_DeleteCategory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_DeleteCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CategoryAPI_GetCategory_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CategoryAPI_GetCategory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_GetCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CategoryAPI_ListCategory_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CategoryAPI_ListCategory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CategoryAPI_ListCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_CategoryAPI_CreateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "category"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CategoryAPI_UpdateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "category"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CategoryAPI_DeleteCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "category"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CategoryAPI_GetCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "category"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CategoryAPI_ListCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "category", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_CategoryAPI_CreateCategory_0 = runtime.ForwardResponseMessage + + forward_CategoryAPI_UpdateCategory_0 = runtime.ForwardResponseMessage + + forward_CategoryAPI_DeleteCategory_0 = runtime.ForwardResponseMessage + + forward_CategoryAPI_GetCategory_0 = runtime.ForwardResponseMessage + + forward_CategoryAPI_ListCategory_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/comment.pb.go b/api/v1/comment.pb.go new file mode 100644 index 0000000..99d6be3 --- /dev/null +++ b/api/v1/comment.pb.go @@ -0,0 +1,2955 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/comment.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 Comment struct { + CreatedAt *time.Time `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` + Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + ParentId int64 `protobuf:"varint,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + DocumentId int64 `protobuf:"varint,6,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + CommentCount int32 `protobuf:"varint,8,opt,name=comment_count,json=commentCount,proto3" json:"comment_count,omitempty"` + UserId int64 `protobuf:"varint,9,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + User *User `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"` + DocumentTitle string `protobuf:"bytes,11,opt,name=document_title,json=documentTitle,proto3" json:"document_title,omitempty"` +} + +func (m *Comment) Reset() { *m = Comment{} } +func (m *Comment) String() string { return proto.CompactTextString(m) } +func (*Comment) ProtoMessage() {} +func (*Comment) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{0} +} +func (m *Comment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Comment.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 *Comment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Comment.Merge(m, src) +} +func (m *Comment) XXX_Size() int { + return m.Size() +} +func (m *Comment) XXX_DiscardUnknown() { + xxx_messageInfo_Comment.DiscardUnknown(m) +} + +var xxx_messageInfo_Comment proto.InternalMessageInfo + +func (m *Comment) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Comment) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +func (m *Comment) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Comment) GetParentId() int64 { + if m != nil { + return m.ParentId + } + return 0 +} + +func (m *Comment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Comment) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func (m *Comment) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *Comment) GetCommentCount() int32 { + if m != nil { + return m.CommentCount + } + return 0 +} + +func (m *Comment) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Comment) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *Comment) GetDocumentTitle() string { + if m != nil { + return m.DocumentTitle + } + return "" +} + +type CheckCommentRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` +} + +func (m *CheckCommentRequest) Reset() { *m = CheckCommentRequest{} } +func (m *CheckCommentRequest) String() string { return proto.CompactTextString(m) } +func (*CheckCommentRequest) ProtoMessage() {} +func (*CheckCommentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{1} +} +func (m *CheckCommentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckCommentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckCommentRequest.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 *CheckCommentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckCommentRequest.Merge(m, src) +} +func (m *CheckCommentRequest) XXX_Size() int { + return m.Size() +} +func (m *CheckCommentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CheckCommentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckCommentRequest proto.InternalMessageInfo + +func (m *CheckCommentRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +func (m *CheckCommentRequest) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +type DeleteCommentRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteCommentRequest) Reset() { *m = DeleteCommentRequest{} } +func (m *DeleteCommentRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteCommentRequest) ProtoMessage() {} +func (*DeleteCommentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{2} +} +func (m *DeleteCommentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteCommentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteCommentRequest.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 *DeleteCommentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteCommentRequest.Merge(m, src) +} +func (m *DeleteCommentRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteCommentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteCommentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteCommentRequest proto.InternalMessageInfo + +func (m *DeleteCommentRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetCommentRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetCommentRequest) Reset() { *m = GetCommentRequest{} } +func (m *GetCommentRequest) String() string { return proto.CompactTextString(m) } +func (*GetCommentRequest) ProtoMessage() {} +func (*GetCommentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{3} +} +func (m *GetCommentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCommentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCommentRequest.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 *GetCommentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCommentRequest.Merge(m, src) +} +func (m *GetCommentRequest) XXX_Size() int { + return m.Size() +} +func (m *GetCommentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCommentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCommentRequest proto.InternalMessageInfo + +func (m *GetCommentRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type ListCommentRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Field []string `protobuf:"bytes,4,rep,name=field,proto3" json:"field,omitempty"` + Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"` + Status []int32 `protobuf:"varint,6,rep,packed,name=status,proto3" json:"status,omitempty"` + DocumentId int64 `protobuf:"varint,7,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + UserId int64 `protobuf:"varint,8,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ParentId []int64 `protobuf:"varint,9,rep,packed,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + WithDocumentTitle bool `protobuf:"varint,10,opt,name=with_document_title,json=withDocumentTitle,proto3" json:"with_document_title,omitempty"` +} + +func (m *ListCommentRequest) Reset() { *m = ListCommentRequest{} } +func (m *ListCommentRequest) String() string { return proto.CompactTextString(m) } +func (*ListCommentRequest) ProtoMessage() {} +func (*ListCommentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{4} +} +func (m *ListCommentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListCommentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListCommentRequest.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 *ListCommentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListCommentRequest.Merge(m, src) +} +func (m *ListCommentRequest) XXX_Size() int { + return m.Size() +} +func (m *ListCommentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListCommentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListCommentRequest proto.InternalMessageInfo + +func (m *ListCommentRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListCommentRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListCommentRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListCommentRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +func (m *ListCommentRequest) GetOrder() string { + if m != nil { + return m.Order + } + return "" +} + +func (m *ListCommentRequest) GetStatus() []int32 { + if m != nil { + return m.Status + } + return nil +} + +func (m *ListCommentRequest) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func (m *ListCommentRequest) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *ListCommentRequest) GetParentId() []int64 { + if m != nil { + return m.ParentId + } + return nil +} + +func (m *ListCommentRequest) GetWithDocumentTitle() bool { + if m != nil { + return m.WithDocumentTitle + } + return false +} + +type ListCommentReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Comment []*Comment `protobuf:"bytes,2,rep,name=comment,proto3" json:"comment,omitempty"` +} + +func (m *ListCommentReply) Reset() { *m = ListCommentReply{} } +func (m *ListCommentReply) String() string { return proto.CompactTextString(m) } +func (*ListCommentReply) ProtoMessage() {} +func (*ListCommentReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{5} +} +func (m *ListCommentReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListCommentReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListCommentReply.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 *ListCommentReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListCommentReply.Merge(m, src) +} +func (m *ListCommentReply) XXX_Size() int { + return m.Size() +} +func (m *ListCommentReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListCommentReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListCommentReply proto.InternalMessageInfo + +func (m *ListCommentReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListCommentReply) GetComment() []*Comment { + if m != nil { + return m.Comment + } + return nil +} + +type CreateCommentRequest struct { + DocumentId int64 `protobuf:"varint,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + ParentId int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + CaptchaId string `protobuf:"bytes,4,opt,name=captcha_id,json=captchaId,proto3" json:"captcha_id,omitempty"` + Captcha string `protobuf:"bytes,5,opt,name=captcha,proto3" json:"captcha,omitempty"` +} + +func (m *CreateCommentRequest) Reset() { *m = CreateCommentRequest{} } +func (m *CreateCommentRequest) String() string { return proto.CompactTextString(m) } +func (*CreateCommentRequest) ProtoMessage() {} +func (*CreateCommentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b2a5e55510663238, []int{6} +} +func (m *CreateCommentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateCommentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateCommentRequest.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 *CreateCommentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateCommentRequest.Merge(m, src) +} +func (m *CreateCommentRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateCommentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateCommentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateCommentRequest proto.InternalMessageInfo + +func (m *CreateCommentRequest) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func (m *CreateCommentRequest) GetParentId() int64 { + if m != nil { + return m.ParentId + } + return 0 +} + +func (m *CreateCommentRequest) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *CreateCommentRequest) GetCaptchaId() string { + if m != nil { + return m.CaptchaId + } + return "" +} + +func (m *CreateCommentRequest) GetCaptcha() string { + if m != nil { + return m.Captcha + } + return "" +} + +func init() { + proto.RegisterType((*Comment)(nil), "api.v1.Comment") + proto.RegisterType((*CheckCommentRequest)(nil), "api.v1.CheckCommentRequest") + proto.RegisterType((*DeleteCommentRequest)(nil), "api.v1.DeleteCommentRequest") + proto.RegisterType((*GetCommentRequest)(nil), "api.v1.GetCommentRequest") + proto.RegisterType((*ListCommentRequest)(nil), "api.v1.ListCommentRequest") + proto.RegisterType((*ListCommentReply)(nil), "api.v1.ListCommentReply") + proto.RegisterType((*CreateCommentRequest)(nil), "api.v1.CreateCommentRequest") +} + +func init() { proto.RegisterFile("api/v1/comment.proto", fileDescriptor_b2a5e55510663238) } + +var fileDescriptor_b2a5e55510663238 = []byte{ + // 806 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x4f, 0xe3, 0x46, + 0x14, 0xc7, 0x76, 0x48, 0xe2, 0x17, 0x02, 0xcd, 0x90, 0x82, 0x6b, 0x68, 0xb0, 0x8c, 0x5a, 0xa5, + 0x1c, 0x1c, 0x41, 0xd5, 0x0b, 0x55, 0x55, 0x41, 0xa8, 0xaa, 0x48, 0x3d, 0x50, 0x17, 0x2e, 0x3d, + 0x34, 0x32, 0xf6, 0x10, 0xac, 0x3a, 0x1e, 0xaf, 0x3d, 0x01, 0xb1, 0xc7, 0xfd, 0x04, 0x68, 0xf7, + 0xb0, 0x1f, 0x61, 0xbf, 0xc7, 0x9e, 0xf6, 0x88, 0xb4, 0x97, 0xbd, 0xed, 0x0a, 0xf6, 0x83, 0xac, + 0x66, 0x3c, 0x4e, 0x62, 0x27, 0xd9, 0xdd, 0x9b, 0xdf, 0xef, 0xcd, 0xfb, 0xbd, 0x3f, 0xbf, 0x79, + 0x63, 0x68, 0x3a, 0x91, 0xdf, 0xb9, 0xde, 0xef, 0xb8, 0x64, 0x38, 0xc4, 0x21, 0xb5, 0xa2, 0x98, + 0x50, 0x82, 0xca, 0x4e, 0xe4, 0x5b, 0xd7, 0xfb, 0xfa, 0xce, 0x80, 0x90, 0x41, 0x80, 0x3b, 0x1c, + 0xbd, 0x18, 0x5d, 0x76, 0xa8, 0x3f, 0xc4, 0x09, 0x75, 0x86, 0x51, 0x7a, 0x50, 0x6f, 0x0e, 0xc8, + 0x80, 0xf0, 0xcf, 0x0e, 0xfb, 0x12, 0xe8, 0xb6, 0x08, 0x63, 0xdc, 0x4e, 0x18, 0x12, 0xea, 0x50, + 0x9f, 0x84, 0x89, 0xf0, 0x6e, 0x15, 0x49, 0xf1, 0x30, 0xa2, 0xb7, 0xc2, 0xd9, 0x10, 0xf5, 0x8c, + 0x12, 0x1c, 0xa7, 0x90, 0xf9, 0x5c, 0x81, 0x4a, 0x37, 0x2d, 0x0f, 0xfd, 0x0e, 0xe0, 0xc6, 0xd8, + 0xa1, 0xd8, 0xeb, 0x3b, 0x54, 0x93, 0x0c, 0xa9, 0x5d, 0x3b, 0xd0, 0xad, 0x94, 0xd0, 0xca, 0x08, + 0xad, 0xb3, 0xac, 0xca, 0xe3, 0xd2, 0xdd, 0xfb, 0x1d, 0xc9, 0x56, 0x45, 0xcc, 0x11, 0x27, 0x18, + 0x45, 0x5e, 0x46, 0x20, 0x7f, 0x2d, 0x81, 0x88, 0x39, 0xa2, 0x68, 0x15, 0x64, 0xdf, 0xd3, 0x14, + 0x43, 0x6a, 0x2b, 0xb6, 0xec, 0x7b, 0x68, 0x0b, 0xd4, 0xc8, 0x89, 0x71, 0x48, 0xfb, 0xbe, 0xa7, + 0x95, 0x38, 0x5c, 0x4d, 0x81, 0x9e, 0x87, 0x34, 0xa8, 0xb8, 0x24, 0xa4, 0x38, 0xa4, 0xda, 0xb2, + 0x21, 0xb5, 0x55, 0x3b, 0x33, 0xd1, 0x0e, 0xd4, 0x3c, 0xe2, 0x8e, 0x86, 0x22, 0xb0, 0xcc, 0x03, + 0x21, 0x83, 0x7a, 0x1e, 0xda, 0x80, 0x72, 0x42, 0x1d, 0x3a, 0x4a, 0xb4, 0x8a, 0x21, 0xb5, 0x97, + 0x6d, 0x61, 0xa1, 0x5d, 0xa8, 0x0b, 0xad, 0xfa, 0x2e, 0x19, 0x85, 0x54, 0xab, 0x72, 0xf7, 0x8a, + 0x00, 0xbb, 0x0c, 0x43, 0x9b, 0x50, 0x61, 0x03, 0x64, 0xcc, 0x2a, 0x67, 0x2e, 0x33, 0xb3, 0xe7, + 0x21, 0x03, 0x4a, 0xec, 0x4b, 0x03, 0xde, 0xf8, 0x8a, 0x95, 0xea, 0x6c, 0x9d, 0x27, 0x38, 0xb6, + 0xb9, 0x07, 0xfd, 0x00, 0xab, 0xe3, 0xc2, 0xa8, 0x4f, 0x03, 0xac, 0xd5, 0x78, 0xe5, 0xf5, 0x0c, + 0x3d, 0x63, 0xa0, 0xf9, 0x1b, 0xac, 0x77, 0xaf, 0xb0, 0xfb, 0xbf, 0x10, 0xc6, 0xc6, 0x4f, 0x46, + 0x38, 0xc9, 0xa6, 0x23, 0x19, 0x8a, 0x98, 0xce, 0xa4, 0x0b, 0x79, 0xba, 0x0b, 0xf3, 0x47, 0x68, + 0x9e, 0xe0, 0x00, 0x53, 0xfc, 0xf9, 0x78, 0x73, 0x17, 0x1a, 0x7f, 0x62, 0xba, 0xe0, 0x90, 0x90, + 0xc0, 0x7c, 0x29, 0x03, 0xfa, 0xcb, 0x4f, 0x8a, 0xc7, 0x10, 0x94, 0x22, 0x67, 0x80, 0xc5, 0x41, + 0xfe, 0xcd, 0xb0, 0xc4, 0x7f, 0x8a, 0x79, 0x35, 0x8a, 0xcd, 0xbf, 0x19, 0xdd, 0x4d, 0xaa, 0xa8, + 0x6a, 0xcb, 0x37, 0x1e, 0x6a, 0xc2, 0xf2, 0xa5, 0x8f, 0x03, 0xa6, 0xa6, 0xd2, 0x56, 0xed, 0xd4, + 0x60, 0x28, 0x89, 0x3d, 0x1c, 0x0b, 0x21, 0x53, 0x63, 0xaa, 0xbf, 0xb2, 0xa1, 0x4c, 0xa9, 0x54, + 0x90, 0xb7, 0x32, 0x23, 0xef, 0x94, 0x42, 0xd5, 0x9c, 0x42, 0xb9, 0xfb, 0xa4, 0xf2, 0x41, 0x4c, + 0xee, 0x93, 0x05, 0xeb, 0x37, 0x3e, 0xbd, 0xea, 0x17, 0x14, 0x62, 0x6a, 0x56, 0xed, 0x06, 0x73, + 0x9d, 0xe4, 0x54, 0xfa, 0x07, 0xbe, 0xc9, 0x0d, 0x26, 0x0a, 0x6e, 0x59, 0x23, 0x94, 0x50, 0x27, + 0x10, 0x73, 0x49, 0x0d, 0xf4, 0x13, 0xbb, 0xa9, 0xfc, 0x94, 0x26, 0x1b, 0x4a, 0xbb, 0x76, 0xb0, + 0x96, 0xdd, 0x8d, 0x2c, 0x38, 0xf3, 0x9b, 0xaf, 0x24, 0x68, 0x76, 0xf9, 0x42, 0x15, 0x06, 0x5e, + 0x68, 0x5a, 0x9a, 0x69, 0x3a, 0xd7, 0x9b, 0xbc, 0x78, 0x57, 0x94, 0xfc, 0xae, 0x7c, 0x0f, 0xe0, + 0x3a, 0x11, 0x75, 0xaf, 0x9c, 0x6c, 0xc7, 0x54, 0x5b, 0x15, 0x88, 0x08, 0x4c, 0x8d, 0xf1, 0x92, + 0xa5, 0xe6, 0xc1, 0xeb, 0x12, 0x80, 0xa8, 0xf1, 0xe8, 0xb4, 0x87, 0x1c, 0xa8, 0xe7, 0xea, 0x46, + 0xdb, 0xe3, 0x1e, 0xe7, 0xb4, 0xa3, 0x6f, 0xcc, 0x3c, 0x0b, 0x7f, 0xb0, 0x87, 0xca, 0xd4, 0x9f, + 0xbd, 0xfd, 0xf8, 0x42, 0x6e, 0x9a, 0x6b, 0x9d, 0xfc, 0xdb, 0x79, 0x28, 0xed, 0xa1, 0x33, 0xa8, + 0x9f, 0xf3, 0xa7, 0x22, 0x4b, 0x51, 0x1c, 0xe3, 0x97, 0x58, 0xf5, 0x79, 0xac, 0xff, 0x41, 0x3d, + 0xb7, 0x2d, 0x93, 0xc2, 0xe7, 0x2d, 0xd1, 0xc2, 0x14, 0x9b, 0x3c, 0x45, 0x63, 0xaf, 0x98, 0x02, + 0xfd, 0x0d, 0x30, 0xd9, 0x32, 0xf4, 0x5d, 0x46, 0x3e, 0xb3, 0x79, 0x7a, 0xb1, 0x9b, 0x8c, 0x12, + 0xcd, 0x50, 0x3a, 0x50, 0x9b, 0xba, 0x79, 0x48, 0xcf, 0x02, 0x67, 0xf7, 0x54, 0xd7, 0xe6, 0xfa, + 0xa2, 0xe0, 0xd6, 0xdc, 0xe6, 0xec, 0x1b, 0xa8, 0x59, 0x60, 0xef, 0x04, 0x7e, 0x42, 0x11, 0x86, + 0x95, 0xe9, 0x27, 0x08, 0x6d, 0x8d, 0x8b, 0x9b, 0x7d, 0x98, 0x16, 0xce, 0xc4, 0xe0, 0x29, 0x74, + 0xf3, 0xdb, 0x62, 0x0a, 0x97, 0x91, 0x1c, 0x4a, 0x7b, 0xc7, 0xbf, 0xbc, 0x79, 0x68, 0x49, 0xf7, + 0x0f, 0x2d, 0xe9, 0xc3, 0x43, 0x4b, 0xba, 0x7b, 0x6c, 0x2d, 0xdd, 0x3f, 0xb6, 0x96, 0xde, 0x3d, + 0xb6, 0x96, 0x40, 0xfc, 0x25, 0x4f, 0xa5, 0x7f, 0x1b, 0x43, 0x12, 0x63, 0x8f, 0xb8, 0x82, 0xe4, + 0xd7, 0xeb, 0xfd, 0x8b, 0x32, 0x4f, 0xf4, 0xf3, 0xa7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x1d, + 0xe5, 0x30, 0x61, 0x07, 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 + +// CommentAPIClient is the client API for CommentAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CommentAPIClient interface { + CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新评论,仅限管理员操作 + UpdateComment(ctx context.Context, in *Comment, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 管理员或用户自己删除自己的评论 + DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 获取单个评论 + GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*Comment, error) + // 获取评论列表 + ListComment(ctx context.Context, in *ListCommentRequest, opts ...grpc.CallOption) (*ListCommentReply, error) + // 审核评论 + CheckComment(ctx context.Context, in *CheckCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type commentAPIClient struct { + cc *grpc.ClientConn +} + +func NewCommentAPIClient(cc *grpc.ClientConn) CommentAPIClient { + return &commentAPIClient{cc} +} + +func (c *commentAPIClient) CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/CreateComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentAPIClient) UpdateComment(ctx context.Context, in *Comment, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/UpdateComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentAPIClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/DeleteComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentAPIClient) GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*Comment, error) { + out := new(Comment) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/GetComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentAPIClient) ListComment(ctx context.Context, in *ListCommentRequest, opts ...grpc.CallOption) (*ListCommentReply, error) { + out := new(ListCommentReply) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/ListComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentAPIClient) CheckComment(ctx context.Context, in *CheckCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.CommentAPI/CheckComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CommentAPIServer is the server API for CommentAPI service. +type CommentAPIServer interface { + CreateComment(context.Context, *CreateCommentRequest) (*emptypb.Empty, error) + // 更新评论,仅限管理员操作 + UpdateComment(context.Context, *Comment) (*emptypb.Empty, error) + // 管理员或用户自己删除自己的评论 + DeleteComment(context.Context, *DeleteCommentRequest) (*emptypb.Empty, error) + // 获取单个评论 + GetComment(context.Context, *GetCommentRequest) (*Comment, error) + // 获取评论列表 + ListComment(context.Context, *ListCommentRequest) (*ListCommentReply, error) + // 审核评论 + CheckComment(context.Context, *CheckCommentRequest) (*emptypb.Empty, error) +} + +// UnimplementedCommentAPIServer can be embedded to have forward compatible implementations. +type UnimplementedCommentAPIServer struct { +} + +func (*UnimplementedCommentAPIServer) CreateComment(ctx context.Context, req *CreateCommentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateComment not implemented") +} +func (*UnimplementedCommentAPIServer) UpdateComment(ctx context.Context, req *Comment) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateComment not implemented") +} +func (*UnimplementedCommentAPIServer) DeleteComment(ctx context.Context, req *DeleteCommentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented") +} +func (*UnimplementedCommentAPIServer) GetComment(ctx context.Context, req *GetCommentRequest) (*Comment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetComment not implemented") +} +func (*UnimplementedCommentAPIServer) ListComment(ctx context.Context, req *ListCommentRequest) (*ListCommentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListComment not implemented") +} +func (*UnimplementedCommentAPIServer) CheckComment(ctx context.Context, req *CheckCommentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckComment not implemented") +} + +func RegisterCommentAPIServer(s *grpc.Server, srv CommentAPIServer) { + s.RegisterService(&_CommentAPI_serviceDesc, srv) +} + +func _CommentAPI_CreateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).CreateComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/CreateComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).CreateComment(ctx, req.(*CreateCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CommentAPI_UpdateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Comment) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).UpdateComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/UpdateComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).UpdateComment(ctx, req.(*Comment)) + } + return interceptor(ctx, in, info, handler) +} + +func _CommentAPI_DeleteComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).DeleteComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/DeleteComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).DeleteComment(ctx, req.(*DeleteCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CommentAPI_GetComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).GetComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/GetComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).GetComment(ctx, req.(*GetCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CommentAPI_ListComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).ListComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/ListComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).ListComment(ctx, req.(*ListCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CommentAPI_CheckComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentAPIServer).CheckComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.CommentAPI/CheckComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentAPIServer).CheckComment(ctx, req.(*CheckCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CommentAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.CommentAPI", + HandlerType: (*CommentAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateComment", + Handler: _CommentAPI_CreateComment_Handler, + }, + { + MethodName: "UpdateComment", + Handler: _CommentAPI_UpdateComment_Handler, + }, + { + MethodName: "DeleteComment", + Handler: _CommentAPI_DeleteComment_Handler, + }, + { + MethodName: "GetComment", + Handler: _CommentAPI_GetComment_Handler, + }, + { + MethodName: "ListComment", + Handler: _CommentAPI_ListComment_Handler, + }, + { + MethodName: "CheckComment", + Handler: _CommentAPI_CheckComment_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/comment.proto", +} + +func (m *Comment) 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 *Comment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Comment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DocumentTitle) > 0 { + i -= len(m.DocumentTitle) + copy(dAtA[i:], m.DocumentTitle) + i = encodeVarintComment(dAtA, i, uint64(len(m.DocumentTitle))) + i-- + dAtA[i] = 0x5a + } + if m.User != nil { + { + size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComment(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.UserId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x48 + } + if m.CommentCount != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.CommentCount)) + i-- + dAtA[i] = 0x40 + } + if m.Status != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if m.DocumentId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x30 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintComment(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x2a + } + if m.ParentId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.ParentId)) + i-- + dAtA[i] = 0x20 + } + if m.Id != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if m.UpdatedAt != nil { + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintComment(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + } + if m.CreatedAt != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintComment(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CheckCommentRequest) 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 *CheckCommentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckCommentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + dAtA5 := make([]byte, len(m.Id)*10) + var j4 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintComment(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteCommentRequest) 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 *DeleteCommentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteCommentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA7 := make([]byte, len(m.Id)*10) + var j6 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j6++ + } + dAtA7[j6] = uint8(num) + j6++ + } + i -= j6 + copy(dAtA[i:], dAtA7[:j6]) + i = encodeVarintComment(dAtA, i, uint64(j6)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetCommentRequest) 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 *GetCommentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCommentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListCommentRequest) 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 *ListCommentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListCommentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.WithDocumentTitle { + i-- + if m.WithDocumentTitle { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.ParentId) > 0 { + dAtA9 := make([]byte, len(m.ParentId)*10) + var j8 int + for _, num1 := range m.ParentId { + num := uint64(num1) + for num >= 1<<7 { + dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j8++ + } + dAtA9[j8] = uint8(num) + j8++ + } + i -= j8 + copy(dAtA[i:], dAtA9[:j8]) + i = encodeVarintComment(dAtA, i, uint64(j8)) + i-- + dAtA[i] = 0x4a + } + if m.UserId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x40 + } + if m.DocumentId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x38 + } + if len(m.Status) > 0 { + dAtA11 := make([]byte, len(m.Status)*10) + var j10 int + for _, num1 := range m.Status { + num := uint64(num1) + for num >= 1<<7 { + dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j10++ + } + dAtA11[j10] = uint8(num) + j10++ + } + i -= j10 + copy(dAtA[i:], dAtA11[:j10]) + i = encodeVarintComment(dAtA, i, uint64(j10)) + i-- + dAtA[i] = 0x32 + } + if len(m.Order) > 0 { + i -= len(m.Order) + copy(dAtA[i:], m.Order) + i = encodeVarintComment(dAtA, i, uint64(len(m.Order))) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintComment(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintComment(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListCommentReply) 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 *ListCommentReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListCommentReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Comment) > 0 { + for iNdEx := len(m.Comment) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Comment[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComment(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CreateCommentRequest) 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 *CreateCommentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateCommentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Captcha) > 0 { + i -= len(m.Captcha) + copy(dAtA[i:], m.Captcha) + i = encodeVarintComment(dAtA, i, uint64(len(m.Captcha))) + i-- + dAtA[i] = 0x2a + } + if len(m.CaptchaId) > 0 { + i -= len(m.CaptchaId) + copy(dAtA[i:], m.CaptchaId) + i = encodeVarintComment(dAtA, i, uint64(len(m.CaptchaId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintComment(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if m.ParentId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.ParentId)) + i-- + dAtA[i] = 0x10 + } + if m.DocumentId != 0 { + i = encodeVarintComment(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintComment(dAtA []byte, offset int, v uint64) int { + offset -= sovComment(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Comment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovComment(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovComment(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovComment(uint64(m.Id)) + } + if m.ParentId != 0 { + n += 1 + sovComment(uint64(m.ParentId)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + if m.DocumentId != 0 { + n += 1 + sovComment(uint64(m.DocumentId)) + } + if m.Status != 0 { + n += 1 + sovComment(uint64(m.Status)) + } + if m.CommentCount != 0 { + n += 1 + sovComment(uint64(m.CommentCount)) + } + if m.UserId != 0 { + n += 1 + sovComment(uint64(m.UserId)) + } + if m.User != nil { + l = m.User.Size() + n += 1 + l + sovComment(uint64(l)) + } + l = len(m.DocumentTitle) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + return n +} + +func (m *CheckCommentRequest) 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 += sovComment(uint64(e)) + } + n += 1 + sovComment(uint64(l)) + l + } + if m.Status != 0 { + n += 1 + sovComment(uint64(m.Status)) + } + return n +} + +func (m *DeleteCommentRequest) 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 += sovComment(uint64(e)) + } + n += 1 + sovComment(uint64(l)) + l + } + return n +} + +func (m *GetCommentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovComment(uint64(m.Id)) + } + return n +} + +func (m *ListCommentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovComment(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovComment(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovComment(uint64(l)) + } + } + l = len(m.Order) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + if len(m.Status) > 0 { + l = 0 + for _, e := range m.Status { + l += sovComment(uint64(e)) + } + n += 1 + sovComment(uint64(l)) + l + } + if m.DocumentId != 0 { + n += 1 + sovComment(uint64(m.DocumentId)) + } + if m.UserId != 0 { + n += 1 + sovComment(uint64(m.UserId)) + } + if len(m.ParentId) > 0 { + l = 0 + for _, e := range m.ParentId { + l += sovComment(uint64(e)) + } + n += 1 + sovComment(uint64(l)) + l + } + if m.WithDocumentTitle { + n += 2 + } + return n +} + +func (m *ListCommentReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovComment(uint64(m.Total)) + } + if len(m.Comment) > 0 { + for _, e := range m.Comment { + l = e.Size() + n += 1 + l + sovComment(uint64(l)) + } + } + return n +} + +func (m *CreateCommentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DocumentId != 0 { + n += 1 + sovComment(uint64(m.DocumentId)) + } + if m.ParentId != 0 { + n += 1 + sovComment(uint64(m.ParentId)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + l = len(m.CaptchaId) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + l = len(m.Captcha) + if l > 0 { + n += 1 + l + sovComment(uint64(l)) + } + return n +} + +func sovComment(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozComment(x uint64) (n int) { + return sovComment(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Comment) 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 ErrIntOverflowComment + } + 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: Comment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Comment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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 2: + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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 3: + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ParentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommentCount", wireType) + } + m.CommentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommentCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentTitle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentTitle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CheckCommentRequest) 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 ErrIntOverflowComment + } + 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: CheckCommentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckCommentRequest: 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 ErrIntOverflowComment + } + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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 ErrIntOverflowComment + } + 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) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteCommentRequest) 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 ErrIntOverflowComment + } + 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: DeleteCommentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteCommentRequest: 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 ErrIntOverflowComment + } + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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 ErrIntOverflowComment + } + 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 := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCommentRequest) 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 ErrIntOverflowComment + } + 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: GetCommentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCommentRequest: 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 ErrIntOverflowComment + } + 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 := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListCommentRequest) 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 ErrIntOverflowComment + } + 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: ListCommentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListCommentRequest: 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 ErrIntOverflowComment + } + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Order = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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.Status) == 0 { + m.Status = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + 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 ErrIntOverflowComment + } + 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 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithDocumentTitle", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithDocumentTitle = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListCommentReply) 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 ErrIntOverflowComment + } + 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: ListCommentReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListCommentReply: 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 ErrIntOverflowComment + } + 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 Comment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthComment + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Comment = append(m.Comment, &Comment{}) + if err := m.Comment[len(m.Comment)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateCommentRequest) 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 ErrIntOverflowComment + } + 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: CreateCommentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateCommentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(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 ErrIntOverflowComment + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ParentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CaptchaId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CaptchaId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Captcha", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComment + } + 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 ErrInvalidLengthComment + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComment + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Captcha = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipComment(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthComment + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipComment(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, ErrIntOverflowComment + } + 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, ErrIntOverflowComment + } + 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, ErrIntOverflowComment + } + 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, ErrInvalidLengthComment + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupComment + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthComment + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthComment = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowComment = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupComment = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/comment.pb.gw.go b/api/v1/comment.pb.gw.go new file mode 100644 index 0000000..9888ecc --- /dev/null +++ b/api/v1/comment.pb.gw.go @@ -0,0 +1,580 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/comment.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_CommentAPI_CreateComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateCommentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_CreateComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateCommentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateComment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CommentAPI_UpdateComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Comment + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_UpdateComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Comment + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateComment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CommentAPI_DeleteComment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CommentAPI_DeleteComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCommentRequest + 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_CommentAPI_DeleteComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_DeleteComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteCommentRequest + 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_CommentAPI_DeleteComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteComment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CommentAPI_GetComment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CommentAPI_GetComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCommentRequest + 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_CommentAPI_GetComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_GetComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCommentRequest + 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_CommentAPI_GetComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetComment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CommentAPI_ListComment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CommentAPI_ListComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListCommentRequest + 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_CommentAPI_ListComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_ListComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListCommentRequest + 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_CommentAPI_ListComment_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListComment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CommentAPI_CheckComment_0(ctx context.Context, marshaler runtime.Marshaler, client CommentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CheckCommentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CheckComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CommentAPI_CheckComment_0(ctx context.Context, marshaler runtime.Marshaler, server CommentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CheckCommentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CheckComment(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterCommentAPIHandlerServer registers the http handlers for service CommentAPI to "mux". +// UnaryRPC :call CommentAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCommentAPIHandlerFromEndpoint instead. +func RegisterCommentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CommentAPIServer) error { + + mux.Handle("POST", pattern_CommentAPI_CreateComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_CreateComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_CreateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CommentAPI_UpdateComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_UpdateComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_UpdateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CommentAPI_DeleteComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_DeleteComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_DeleteComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CommentAPI_GetComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_GetComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_GetComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CommentAPI_ListComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_ListComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_ListComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CommentAPI_CheckComment_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CommentAPI_CheckComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_CheckComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterCommentAPIHandlerFromEndpoint is same as RegisterCommentAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterCommentAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterCommentAPIHandler(ctx, mux, conn) +} + +// RegisterCommentAPIHandler registers the http handlers for service CommentAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterCommentAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterCommentAPIHandlerClient(ctx, mux, NewCommentAPIClient(conn)) +} + +// RegisterCommentAPIHandlerClient registers the http handlers for service CommentAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CommentAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CommentAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "CommentAPIClient" to call the correct interceptors. +func RegisterCommentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CommentAPIClient) error { + + mux.Handle("POST", pattern_CommentAPI_CreateComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_CreateComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_CreateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CommentAPI_UpdateComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_UpdateComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_UpdateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CommentAPI_DeleteComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_DeleteComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_DeleteComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CommentAPI_GetComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_GetComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_GetComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CommentAPI_ListComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_ListComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_ListComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CommentAPI_CheckComment_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CommentAPI_CheckComment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CommentAPI_CheckComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_CommentAPI_CreateComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "comment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CommentAPI_UpdateComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "comment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CommentAPI_DeleteComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "comment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CommentAPI_GetComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "comment"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CommentAPI_ListComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "comment", "list"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CommentAPI_CheckComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "comment", "check"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_CommentAPI_CreateComment_0 = runtime.ForwardResponseMessage + + forward_CommentAPI_UpdateComment_0 = runtime.ForwardResponseMessage + + forward_CommentAPI_DeleteComment_0 = runtime.ForwardResponseMessage + + forward_CommentAPI_GetComment_0 = runtime.ForwardResponseMessage + + forward_CommentAPI_ListComment_0 = runtime.ForwardResponseMessage + + forward_CommentAPI_CheckComment_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/config.pb.go b/api/v1/config.pb.go new file mode 100644 index 0000000..11464cf --- /dev/null +++ b/api/v1/config.pb.go @@ -0,0 +1,4271 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/config.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 Config struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Placeholder string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"` + InputType string `protobuf:"bytes,6,opt,name=input_type,json=inputType,proto3" json:"input_type,omitempty"` + Category string `protobuf:"bytes,7,opt,name=category,proto3" json:"category,omitempty"` + Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"` + Options string `protobuf:"bytes,9,opt,name=options,proto3" json:"options,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{0} +} +func (m *Config) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Config.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 *Config) XXX_Merge(src proto.Message) { + xxx_messageInfo_Config.Merge(m, src) +} +func (m *Config) XXX_Size() int { + return m.Size() +} +func (m *Config) XXX_DiscardUnknown() { + xxx_messageInfo_Config.DiscardUnknown(m) +} + +var xxx_messageInfo_Config proto.InternalMessageInfo + +func (m *Config) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Config) GetLabel() string { + if m != nil { + return m.Label + } + return "" +} + +func (m *Config) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Config) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *Config) GetPlaceholder() string { + if m != nil { + return m.Placeholder + } + return "" +} + +func (m *Config) GetInputType() string { + if m != nil { + return m.InputType + } + return "" +} + +func (m *Config) GetCategory() string { + if m != nil { + return m.Category + } + return "" +} + +func (m *Config) GetSort() int32 { + if m != nil { + return m.Sort + } + return 0 +} + +func (m *Config) GetOptions() string { + if m != nil { + return m.Options + } + return "" +} + +func (m *Config) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Config) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type ListConfigRequest struct { + Category []string `protobuf:"bytes,1,rep,name=category,proto3" json:"category,omitempty"` +} + +func (m *ListConfigRequest) Reset() { *m = ListConfigRequest{} } +func (m *ListConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ListConfigRequest) ProtoMessage() {} +func (*ListConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{1} +} +func (m *ListConfigRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListConfigRequest.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 *ListConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListConfigRequest.Merge(m, src) +} +func (m *ListConfigRequest) XXX_Size() int { + return m.Size() +} +func (m *ListConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListConfigRequest proto.InternalMessageInfo + +func (m *ListConfigRequest) GetCategory() []string { + if m != nil { + return m.Category + } + return nil +} + +type Configs struct { + Config []*Config `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` +} + +func (m *Configs) Reset() { *m = Configs{} } +func (m *Configs) String() string { return proto.CompactTextString(m) } +func (*Configs) ProtoMessage() {} +func (*Configs) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{2} +} +func (m *Configs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Configs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Configs.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 *Configs) XXX_Merge(src proto.Message) { + xxx_messageInfo_Configs.Merge(m, src) +} +func (m *Configs) XXX_Size() int { + return m.Size() +} +func (m *Configs) XXX_DiscardUnknown() { + xxx_messageInfo_Configs.DiscardUnknown(m) +} + +var xxx_messageInfo_Configs proto.InternalMessageInfo + +func (m *Configs) GetConfig() []*Config { + if m != nil { + return m.Config + } + return nil +} + +// 验证码配置 +type ConfigCaptcha struct { + Length int32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` + Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` +} + +func (m *ConfigCaptcha) Reset() { *m = ConfigCaptcha{} } +func (m *ConfigCaptcha) String() string { return proto.CompactTextString(m) } +func (*ConfigCaptcha) ProtoMessage() {} +func (*ConfigCaptcha) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{3} +} +func (m *ConfigCaptcha) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigCaptcha) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigCaptcha.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 *ConfigCaptcha) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigCaptcha.Merge(m, src) +} +func (m *ConfigCaptcha) XXX_Size() int { + return m.Size() +} +func (m *ConfigCaptcha) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigCaptcha.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigCaptcha proto.InternalMessageInfo + +func (m *ConfigCaptcha) GetLength() int32 { + if m != nil { + return m.Length + } + return 0 +} + +func (m *ConfigCaptcha) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *ConfigCaptcha) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *ConfigCaptcha) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +// 系统配置项 +type ConfigSystem struct { + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Keywords string `protobuf:"bytes,3,opt,name=keywords,proto3" json:"keywords,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` + Favicon string `protobuf:"bytes,6,opt,name=favicon,proto3" json:"favicon,omitempty"` + Icp string `protobuf:"bytes,7,opt,name=icp,proto3" json:"icp,omitempty"` + Analytics string `protobuf:"bytes,8,opt,name=analytics,proto3" json:"analytics,omitempty"` + Sitename string `protobuf:"bytes,9,opt,name=sitename,proto3" json:"sitename,omitempty"` + CopyrightStartYear string `protobuf:"bytes,10,opt,name=copyright_start_year,json=copyrightStartYear,proto3" json:"copyright_start_year,omitempty"` + RegisterBackground string `protobuf:"bytes,11,opt,name=register_background,json=registerBackground,proto3" json:"register_background,omitempty"` + LoginBackground string `protobuf:"bytes,12,opt,name=login_background,json=loginBackground,proto3" json:"login_background,omitempty"` + RecommendWords []string `protobuf:"bytes,13,rep,name=recommend_words,json=recommendWords,proto3" json:"recommend_words,omitempty"` +} + +func (m *ConfigSystem) Reset() { *m = ConfigSystem{} } +func (m *ConfigSystem) String() string { return proto.CompactTextString(m) } +func (*ConfigSystem) ProtoMessage() {} +func (*ConfigSystem) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{4} +} +func (m *ConfigSystem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigSystem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigSystem.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 *ConfigSystem) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigSystem.Merge(m, src) +} +func (m *ConfigSystem) XXX_Size() int { + return m.Size() +} +func (m *ConfigSystem) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigSystem.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigSystem proto.InternalMessageInfo + +func (m *ConfigSystem) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *ConfigSystem) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *ConfigSystem) GetKeywords() string { + if m != nil { + return m.Keywords + } + return "" +} + +func (m *ConfigSystem) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ConfigSystem) GetLogo() string { + if m != nil { + return m.Logo + } + return "" +} + +func (m *ConfigSystem) GetFavicon() string { + if m != nil { + return m.Favicon + } + return "" +} + +func (m *ConfigSystem) GetIcp() string { + if m != nil { + return m.Icp + } + return "" +} + +func (m *ConfigSystem) GetAnalytics() string { + if m != nil { + return m.Analytics + } + return "" +} + +func (m *ConfigSystem) GetSitename() string { + if m != nil { + return m.Sitename + } + return "" +} + +func (m *ConfigSystem) GetCopyrightStartYear() string { + if m != nil { + return m.CopyrightStartYear + } + return "" +} + +func (m *ConfigSystem) GetRegisterBackground() string { + if m != nil { + return m.RegisterBackground + } + return "" +} + +func (m *ConfigSystem) GetLoginBackground() string { + if m != nil { + return m.LoginBackground + } + return "" +} + +func (m *ConfigSystem) GetRecommendWords() []string { + if m != nil { + return m.RecommendWords + } + return nil +} + +// 底链配置项 +type ConfigFooter struct { + About string `protobuf:"bytes,1,opt,name=about,proto3" json:"about,omitempty"` + Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"` + Agreement string `protobuf:"bytes,3,opt,name=agreement,proto3" json:"agreement,omitempty"` + Copyright string `protobuf:"bytes,4,opt,name=copyright,proto3" json:"copyright,omitempty"` + Feedback string `protobuf:"bytes,5,opt,name=feedback,proto3" json:"feedback,omitempty"` +} + +func (m *ConfigFooter) Reset() { *m = ConfigFooter{} } +func (m *ConfigFooter) String() string { return proto.CompactTextString(m) } +func (*ConfigFooter) ProtoMessage() {} +func (*ConfigFooter) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{5} +} +func (m *ConfigFooter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigFooter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigFooter.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 *ConfigFooter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigFooter.Merge(m, src) +} +func (m *ConfigFooter) XXX_Size() int { + return m.Size() +} +func (m *ConfigFooter) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigFooter.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigFooter proto.InternalMessageInfo + +func (m *ConfigFooter) GetAbout() string { + if m != nil { + return m.About + } + return "" +} + +func (m *ConfigFooter) GetContact() string { + if m != nil { + return m.Contact + } + return "" +} + +func (m *ConfigFooter) GetAgreement() string { + if m != nil { + return m.Agreement + } + return "" +} + +func (m *ConfigFooter) GetCopyright() string { + if m != nil { + return m.Copyright + } + return "" +} + +func (m *ConfigFooter) GetFeedback() string { + if m != nil { + return m.Feedback + } + return "" +} + +// 安全配置 +type ConfigSecurity struct { + IsClose bool `protobuf:"varint,1,opt,name=is_close,json=isClose,proto3" json:"is_close,omitempty"` + CloseStatement string `protobuf:"bytes,2,opt,name=close_statement,json=closeStatement,proto3" json:"close_statement,omitempty"` + EnableRegister bool `protobuf:"varint,3,opt,name=enable_register,json=enableRegister,proto3" json:"enable_register,omitempty"` + EnableCaptchaLogin bool `protobuf:"varint,4,opt,name=enable_captcha_login,json=enableCaptchaLogin,proto3" json:"enable_captcha_login,omitempty"` + EnableCaptchaRegister bool `protobuf:"varint,5,opt,name=enable_captcha_register,json=enableCaptchaRegister,proto3" json:"enable_captcha_register,omitempty"` + EnableCaptchaComment bool `protobuf:"varint,6,opt,name=enable_captcha_comment,json=enableCaptchaComment,proto3" json:"enable_captcha_comment,omitempty"` + EnableCaptchaFindPassword bool `protobuf:"varint,7,opt,name=enable_captcha_find_password,json=enableCaptchaFindPassword,proto3" json:"enable_captcha_find_password,omitempty"` + EnableCaptchaUpload bool `protobuf:"varint,8,opt,name=enable_captcha_upload,json=enableCaptchaUpload,proto3" json:"enable_captcha_upload,omitempty"` + MaxDocumentSize int32 `protobuf:"varint,9,opt,name=max_document_size,json=maxDocumentSize,proto3" json:"max_document_size,omitempty"` +} + +func (m *ConfigSecurity) Reset() { *m = ConfigSecurity{} } +func (m *ConfigSecurity) String() string { return proto.CompactTextString(m) } +func (*ConfigSecurity) ProtoMessage() {} +func (*ConfigSecurity) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{6} +} +func (m *ConfigSecurity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigSecurity.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 *ConfigSecurity) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigSecurity.Merge(m, src) +} +func (m *ConfigSecurity) XXX_Size() int { + return m.Size() +} +func (m *ConfigSecurity) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigSecurity.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigSecurity proto.InternalMessageInfo + +func (m *ConfigSecurity) GetIsClose() bool { + if m != nil { + return m.IsClose + } + return false +} + +func (m *ConfigSecurity) GetCloseStatement() string { + if m != nil { + return m.CloseStatement + } + return "" +} + +func (m *ConfigSecurity) GetEnableRegister() bool { + if m != nil { + return m.EnableRegister + } + return false +} + +func (m *ConfigSecurity) GetEnableCaptchaLogin() bool { + if m != nil { + return m.EnableCaptchaLogin + } + return false +} + +func (m *ConfigSecurity) GetEnableCaptchaRegister() bool { + if m != nil { + return m.EnableCaptchaRegister + } + return false +} + +func (m *ConfigSecurity) GetEnableCaptchaComment() bool { + if m != nil { + return m.EnableCaptchaComment + } + return false +} + +func (m *ConfigSecurity) GetEnableCaptchaFindPassword() bool { + if m != nil { + return m.EnableCaptchaFindPassword + } + return false +} + +func (m *ConfigSecurity) GetEnableCaptchaUpload() bool { + if m != nil { + return m.EnableCaptchaUpload + } + return false +} + +func (m *ConfigSecurity) GetMaxDocumentSize() int32 { + if m != nil { + return m.MaxDocumentSize + } + return 0 +} + +type Settings struct { + System *ConfigSystem `protobuf:"bytes,1,opt,name=system,proto3" json:"system,omitempty"` + Footer *ConfigFooter `protobuf:"bytes,2,opt,name=footer,proto3" json:"footer,omitempty"` + Security *ConfigSecurity `protobuf:"bytes,3,opt,name=security,proto3" json:"security,omitempty"` +} + +func (m *Settings) Reset() { *m = Settings{} } +func (m *Settings) String() string { return proto.CompactTextString(m) } +func (*Settings) ProtoMessage() {} +func (*Settings) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{7} +} +func (m *Settings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Settings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Settings.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 *Settings) XXX_Merge(src proto.Message) { + xxx_messageInfo_Settings.Merge(m, src) +} +func (m *Settings) XXX_Size() int { + return m.Size() +} +func (m *Settings) XXX_DiscardUnknown() { + xxx_messageInfo_Settings.DiscardUnknown(m) +} + +var xxx_messageInfo_Settings proto.InternalMessageInfo + +func (m *Settings) GetSystem() *ConfigSystem { + if m != nil { + return m.System + } + return nil +} + +func (m *Settings) GetFooter() *ConfigFooter { + if m != nil { + return m.Footer + } + return nil +} + +func (m *Settings) GetSecurity() *ConfigSecurity { + if m != nil { + return m.Security + } + return nil +} + +type Stats struct { + UserCount int64 `protobuf:"varint,1,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"` + DocumentCount int64 `protobuf:"varint,2,opt,name=document_count,json=documentCount,proto3" json:"document_count,omitempty"` + CategoryCount int64 `protobuf:"varint,3,opt,name=category_count,json=categoryCount,proto3" json:"category_count,omitempty"` + ArticleCount int64 `protobuf:"varint,4,opt,name=article_count,json=articleCount,proto3" json:"article_count,omitempty"` + CommentCount int64 `protobuf:"varint,5,opt,name=comment_count,json=commentCount,proto3" json:"comment_count,omitempty"` + BannerCount int64 `protobuf:"varint,6,opt,name=banner_count,json=bannerCount,proto3" json:"banner_count,omitempty"` + FriendlinkCount int64 `protobuf:"varint,7,opt,name=friendlink_count,json=friendlinkCount,proto3" json:"friendlink_count,omitempty"` + Os string `protobuf:"bytes,8,opt,name=os,proto3" json:"os,omitempty"` + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` + Hash string `protobuf:"bytes,10,opt,name=hash,proto3" json:"hash,omitempty"` + BuildAt string `protobuf:"bytes,11,opt,name=build_at,json=buildAt,proto3" json:"build_at,omitempty"` + ReportCount int64 `protobuf:"varint,12,opt,name=report_count,json=reportCount,proto3" json:"report_count,omitempty"` +} + +func (m *Stats) Reset() { *m = Stats{} } +func (m *Stats) String() string { return proto.CompactTextString(m) } +func (*Stats) ProtoMessage() {} +func (*Stats) Descriptor() ([]byte, []int) { + return fileDescriptor_321614cd6c9c1b8a, []int{8} +} +func (m *Stats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Stats.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 *Stats) XXX_Merge(src proto.Message) { + xxx_messageInfo_Stats.Merge(m, src) +} +func (m *Stats) XXX_Size() int { + return m.Size() +} +func (m *Stats) XXX_DiscardUnknown() { + xxx_messageInfo_Stats.DiscardUnknown(m) +} + +var xxx_messageInfo_Stats proto.InternalMessageInfo + +func (m *Stats) GetUserCount() int64 { + if m != nil { + return m.UserCount + } + return 0 +} + +func (m *Stats) GetDocumentCount() int64 { + if m != nil { + return m.DocumentCount + } + return 0 +} + +func (m *Stats) GetCategoryCount() int64 { + if m != nil { + return m.CategoryCount + } + return 0 +} + +func (m *Stats) GetArticleCount() int64 { + if m != nil { + return m.ArticleCount + } + return 0 +} + +func (m *Stats) GetCommentCount() int64 { + if m != nil { + return m.CommentCount + } + return 0 +} + +func (m *Stats) GetBannerCount() int64 { + if m != nil { + return m.BannerCount + } + return 0 +} + +func (m *Stats) GetFriendlinkCount() int64 { + if m != nil { + return m.FriendlinkCount + } + return 0 +} + +func (m *Stats) GetOs() string { + if m != nil { + return m.Os + } + return "" +} + +func (m *Stats) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Stats) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *Stats) GetBuildAt() string { + if m != nil { + return m.BuildAt + } + return "" +} + +func (m *Stats) GetReportCount() int64 { + if m != nil { + return m.ReportCount + } + return 0 +} + +func init() { + proto.RegisterType((*Config)(nil), "api.v1.Config") + proto.RegisterType((*ListConfigRequest)(nil), "api.v1.ListConfigRequest") + proto.RegisterType((*Configs)(nil), "api.v1.Configs") + proto.RegisterType((*ConfigCaptcha)(nil), "api.v1.ConfigCaptcha") + proto.RegisterType((*ConfigSystem)(nil), "api.v1.ConfigSystem") + proto.RegisterType((*ConfigFooter)(nil), "api.v1.ConfigFooter") + proto.RegisterType((*ConfigSecurity)(nil), "api.v1.ConfigSecurity") + proto.RegisterType((*Settings)(nil), "api.v1.Settings") + proto.RegisterType((*Stats)(nil), "api.v1.Stats") +} + +func init() { proto.RegisterFile("api/v1/config.proto", fileDescriptor_321614cd6c9c1b8a) } + +var fileDescriptor_321614cd6c9c1b8a = []byte{ + // 1275 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xef, 0xda, 0xb1, 0x63, 0x8f, 0x13, 0x27, 0x9d, 0xfc, 0xc1, 0x71, 0x4b, 0x1a, 0x16, 0x01, + 0x69, 0x85, 0x6c, 0x62, 0xfe, 0x1c, 0xe0, 0x50, 0xa5, 0x81, 0x02, 0x52, 0x0f, 0x65, 0xd2, 0x0a, + 0xc1, 0x65, 0x35, 0xde, 0x1d, 0xaf, 0x47, 0x5d, 0xcf, 0x2c, 0x33, 0xb3, 0x69, 0xdd, 0x23, 0x27, + 0x8e, 0x95, 0x90, 0x38, 0xf0, 0x15, 0xf8, 0x0e, 0x9c, 0x39, 0x56, 0xea, 0x85, 0x1b, 0xa8, 0x85, + 0xef, 0x81, 0xe6, 0xcd, 0xec, 0x26, 0x76, 0x54, 0x89, 0xdb, 0xbc, 0xdf, 0xfb, 0xbd, 0x37, 0xf3, + 0xde, 0xfb, 0xed, 0xcc, 0xa2, 0x2d, 0x9a, 0xf3, 0xe1, 0xd9, 0xd1, 0x30, 0x96, 0x62, 0xc2, 0xd3, + 0x41, 0xae, 0xa4, 0x91, 0xb8, 0x49, 0x73, 0x3e, 0x38, 0x3b, 0xea, 0xdf, 0x48, 0xa5, 0x4c, 0x33, + 0x36, 0x04, 0x74, 0x5c, 0x4c, 0x86, 0x86, 0xcf, 0x98, 0x36, 0x74, 0x96, 0x3b, 0x62, 0x7f, 0x3b, + 0x95, 0xa9, 0x84, 0xe5, 0xd0, 0xae, 0x3c, 0x7a, 0xdd, 0x87, 0xd9, 0xd4, 0x54, 0x08, 0x69, 0xa8, + 0xe1, 0x52, 0x68, 0xef, 0xbd, 0xb6, 0x9c, 0x94, 0xcd, 0x72, 0x33, 0x77, 0xce, 0xf0, 0xdf, 0x1a, + 0x6a, 0x9e, 0xc0, 0x51, 0x70, 0x17, 0xd5, 0x78, 0xd2, 0x0b, 0x0e, 0x82, 0xc3, 0x3a, 0xa9, 0xf1, + 0x04, 0x6f, 0xa3, 0x46, 0x46, 0xc7, 0x2c, 0xeb, 0xd5, 0x0e, 0x82, 0xc3, 0x36, 0x71, 0x06, 0xc6, + 0x68, 0x45, 0xd0, 0x19, 0xeb, 0xd5, 0x01, 0x84, 0xb5, 0x65, 0x9e, 0xd1, 0xac, 0x60, 0xbd, 0x15, + 0xc7, 0x04, 0x03, 0x1f, 0xa0, 0x4e, 0x9e, 0xd1, 0x98, 0x4d, 0x65, 0x96, 0x30, 0xd5, 0x6b, 0x80, + 0xef, 0x22, 0x84, 0xdf, 0x44, 0x88, 0x8b, 0xbc, 0x30, 0x91, 0x99, 0xe7, 0xac, 0xd7, 0x04, 0x42, + 0x1b, 0x90, 0x07, 0xf3, 0x9c, 0xe1, 0x3e, 0x6a, 0xc5, 0xd4, 0xb0, 0x54, 0xaa, 0x79, 0x6f, 0x15, + 0x9c, 0x95, 0x6d, 0x8f, 0xa1, 0xa5, 0x32, 0xbd, 0xd6, 0x41, 0x70, 0xd8, 0x20, 0xb0, 0xc6, 0x3d, + 0xb4, 0x2a, 0x73, 0xa8, 0xbc, 0xd7, 0x06, 0x7a, 0x69, 0xe2, 0xdb, 0x08, 0xc5, 0x8a, 0x51, 0xc3, + 0x92, 0x88, 0x9a, 0x1e, 0x3a, 0x08, 0x0e, 0x3b, 0xa3, 0xfe, 0xc0, 0xf5, 0x65, 0x50, 0xf6, 0x65, + 0xf0, 0xa0, 0x6c, 0xf6, 0x9d, 0x95, 0x67, 0x7f, 0xdd, 0x08, 0x48, 0xdb, 0xc7, 0x1c, 0x1b, 0x9b, + 0xa0, 0xc8, 0x93, 0x32, 0x41, 0xe7, 0xff, 0x26, 0xf0, 0x31, 0xc7, 0x26, 0x1c, 0xa2, 0xab, 0xf7, + 0xb8, 0x36, 0xae, 0xd5, 0x84, 0xfd, 0x50, 0x30, 0x6d, 0x16, 0x0a, 0x0c, 0x0e, 0xea, 0x17, 0x0b, + 0x0c, 0x8f, 0xd0, 0xaa, 0x23, 0x6b, 0xfc, 0x2e, 0x6a, 0x3a, 0xb5, 0x00, 0xa9, 0x33, 0xea, 0x0e, + 0x9c, 0x5c, 0x06, 0x3e, 0x9b, 0xf7, 0x86, 0x1c, 0xad, 0x3b, 0xe4, 0x84, 0xe6, 0x26, 0x9e, 0x52, + 0xbc, 0x8b, 0x9a, 0x19, 0x13, 0xa9, 0x99, 0xc2, 0x54, 0x1b, 0xc4, 0x5b, 0x76, 0x5e, 0x8f, 0x79, + 0x62, 0xa6, 0x30, 0xd9, 0x06, 0x71, 0x86, 0x65, 0x4f, 0x19, 0x4f, 0xa7, 0x06, 0x66, 0xdb, 0x20, + 0xde, 0xb2, 0xad, 0x86, 0xf9, 0xb8, 0xe1, 0xc2, 0x3a, 0xfc, 0xad, 0x8e, 0xd6, 0xdc, 0x5e, 0xa7, + 0x73, 0x6d, 0xd8, 0xcc, 0x06, 0x27, 0x72, 0x46, 0xb9, 0x80, 0xad, 0xda, 0xc4, 0x5b, 0x76, 0x2b, + 0xc3, 0x4d, 0xc6, 0x4a, 0x11, 0x81, 0x61, 0x0b, 0x7f, 0xc4, 0xe6, 0x8f, 0xa5, 0x4a, 0xb4, 0x17, + 0x52, 0x65, 0x5b, 0xd9, 0x24, 0x4c, 0xc7, 0x8a, 0xc3, 0xec, 0xfc, 0xae, 0x17, 0x21, 0x7b, 0xa0, + 0x4c, 0xa6, 0xd2, 0x2b, 0x0a, 0xd6, 0x76, 0xf6, 0x13, 0x7a, 0xc6, 0x63, 0x29, 0xbc, 0x8e, 0x4a, + 0x13, 0x6f, 0xa2, 0x3a, 0x8f, 0x73, 0x2f, 0x20, 0xbb, 0xc4, 0xd7, 0x51, 0x9b, 0x0a, 0x9a, 0xcd, + 0x0d, 0x8f, 0x35, 0x08, 0xa8, 0x4d, 0xce, 0x01, 0x7b, 0x36, 0xcd, 0x0d, 0x03, 0x91, 0x3b, 0x19, + 0x55, 0x36, 0xfe, 0x00, 0x6d, 0xc7, 0x32, 0x9f, 0x2b, 0xdb, 0x97, 0x48, 0x1b, 0xaa, 0x4c, 0x34, + 0x67, 0x54, 0x81, 0xa2, 0xda, 0x04, 0x57, 0xbe, 0x53, 0xeb, 0xfa, 0x8e, 0x51, 0x85, 0x87, 0x68, + 0x4b, 0xb1, 0x94, 0x6b, 0xc3, 0x54, 0x34, 0xa6, 0xf1, 0xa3, 0x54, 0xc9, 0x42, 0x24, 0xa0, 0xa0, + 0x36, 0xc1, 0xa5, 0xeb, 0x4e, 0xe5, 0xc1, 0x37, 0xd1, 0x66, 0x26, 0x53, 0x2e, 0x2e, 0xb2, 0xd7, + 0x80, 0xbd, 0x01, 0xf8, 0x05, 0xea, 0x7b, 0x68, 0x43, 0xb1, 0x58, 0xce, 0x66, 0x4c, 0x24, 0x91, + 0x6b, 0xe6, 0x3a, 0xa8, 0xa8, 0x5b, 0xc1, 0xdf, 0x5a, 0x34, 0xfc, 0x25, 0x28, 0xa7, 0x75, 0x57, + 0x4a, 0xc3, 0x94, 0x9d, 0x0a, 0x1d, 0xcb, 0xc2, 0xf8, 0x61, 0x39, 0xc3, 0xf6, 0x30, 0x96, 0xc2, + 0xd0, 0xd8, 0xf8, 0x69, 0x95, 0x26, 0x74, 0x2c, 0x55, 0x8c, 0xcd, 0x98, 0x30, 0x7e, 0x60, 0xe7, + 0x80, 0xf5, 0x56, 0x95, 0xfb, 0x79, 0x9d, 0x03, 0xb6, 0x9f, 0x13, 0xc6, 0x12, 0x5b, 0x8e, 0x9f, + 0x58, 0x65, 0x87, 0xbf, 0xd7, 0x51, 0xd7, 0xcb, 0x88, 0xc5, 0x85, 0xe2, 0x66, 0x8e, 0xf7, 0x50, + 0x8b, 0xeb, 0x28, 0xce, 0xa4, 0x66, 0x70, 0xba, 0x16, 0x59, 0xe5, 0xfa, 0xc4, 0x9a, 0xb6, 0x5e, + 0xc0, 0x6d, 0xe7, 0x8d, 0x3b, 0x8b, 0x3b, 0x67, 0x17, 0xe0, 0xd3, 0x12, 0xb5, 0x44, 0x26, 0xe8, + 0x38, 0x63, 0x51, 0xd9, 0x60, 0x38, 0x74, 0x8b, 0x74, 0x1d, 0x4c, 0x3c, 0x6a, 0xe7, 0xe9, 0x89, + 0xb1, 0xfb, 0x64, 0x22, 0xe8, 0x31, 0x14, 0xd1, 0x22, 0xd8, 0xf9, 0xfc, 0xd7, 0x74, 0xcf, 0x7a, + 0xf0, 0x27, 0xe8, 0x8d, 0xa5, 0x88, 0x6a, 0x8b, 0x06, 0x04, 0xed, 0x2c, 0x04, 0x55, 0x3b, 0x7d, + 0x84, 0x76, 0x97, 0xe2, 0xdc, 0x84, 0x0c, 0xc8, 0xb5, 0x45, 0xb6, 0x17, 0xc2, 0x4e, 0x9c, 0x0f, + 0xdf, 0x46, 0xd7, 0x97, 0xa2, 0x26, 0x5c, 0x24, 0x51, 0x4e, 0xb5, 0xb6, 0xf3, 0x06, 0x51, 0xb7, + 0xc8, 0xde, 0x42, 0xec, 0x5d, 0x2e, 0x92, 0xfb, 0x9e, 0x80, 0x47, 0x68, 0x67, 0x29, 0x41, 0x91, + 0x67, 0x92, 0x26, 0x20, 0xfb, 0x16, 0xd9, 0x5a, 0x88, 0x7c, 0x08, 0x2e, 0x7c, 0x0b, 0x5d, 0x9d, + 0xd1, 0x27, 0x51, 0x22, 0xe3, 0xc2, 0x1e, 0x22, 0xd2, 0xfc, 0xa9, 0xfb, 0x12, 0x1a, 0x64, 0x63, + 0x46, 0x9f, 0x7c, 0xee, 0xf1, 0x53, 0xfe, 0x94, 0x85, 0xbf, 0x06, 0xa8, 0x75, 0xca, 0x8c, 0xe1, + 0x22, 0xd5, 0xf8, 0x7d, 0xd4, 0xd4, 0x70, 0x1b, 0xc0, 0xe0, 0x3a, 0xa3, 0xed, 0xc5, 0x7b, 0xca, + 0xdd, 0x14, 0xc4, 0x73, 0x2c, 0x7b, 0x02, 0x6a, 0x84, 0x21, 0x5e, 0x62, 0x3b, 0xa5, 0x12, 0xcf, + 0xc1, 0x23, 0xd4, 0xd2, 0x5e, 0x22, 0x30, 0xcb, 0xce, 0x68, 0x77, 0x29, 0xbb, 0xf7, 0x92, 0x8a, + 0x17, 0xfe, 0x54, 0x47, 0x0d, 0x2b, 0x0a, 0x6d, 0x1f, 0x9a, 0x42, 0x33, 0x15, 0xc5, 0xb2, 0x10, + 0xc6, 0x3f, 0x71, 0x6d, 0x8b, 0x9c, 0x58, 0x00, 0xbf, 0x83, 0xba, 0x55, 0xb5, 0x8e, 0x52, 0x03, + 0xca, 0x7a, 0x89, 0x56, 0xb4, 0xf2, 0x7a, 0xf6, 0xb4, 0xba, 0xa3, 0x95, 0xa8, 0xa3, 0xbd, 0x8d, + 0xd6, 0xa9, 0x32, 0x3c, 0xb6, 0x4d, 0x07, 0xd6, 0x0a, 0xb0, 0xd6, 0x3c, 0x58, 0x91, 0xbc, 0x00, + 0x3c, 0xa9, 0xe1, 0x48, 0x1e, 0x74, 0xa4, 0xb7, 0xd0, 0xda, 0x98, 0x0a, 0x51, 0x1d, 0xbc, 0x09, + 0x9c, 0x8e, 0xc3, 0x1c, 0xe5, 0x26, 0xda, 0x9c, 0x28, 0xce, 0x44, 0x92, 0x71, 0xf1, 0xc8, 0xd3, + 0x56, 0x81, 0xb6, 0x71, 0x8e, 0x3b, 0x6a, 0x17, 0xd5, 0x64, 0x79, 0xdf, 0xd5, 0xa4, 0xb6, 0x9f, + 0xfb, 0x19, 0x53, 0xda, 0x5e, 0xb2, 0xfe, 0xb9, 0xf4, 0xa6, 0xbd, 0x60, 0xa7, 0x54, 0x4f, 0xfd, + 0xb5, 0x06, 0x6b, 0xfb, 0x5d, 0x8e, 0x0b, 0x9e, 0x55, 0xef, 0x5f, 0x9b, 0xac, 0x82, 0x7d, 0x0c, + 0xc7, 0x54, 0x2c, 0x97, 0xaa, 0x2c, 0x65, 0xcd, 0x1d, 0xd3, 0x61, 0xb0, 0xf7, 0xe8, 0x45, 0x0d, + 0xb5, 0xdd, 0x9c, 0x8e, 0xef, 0x7f, 0x8d, 0xbf, 0x41, 0x9d, 0x2f, 0x99, 0xa9, 0x74, 0xb3, 0x7b, + 0xe9, 0x21, 0xfd, 0xc2, 0xfe, 0xa1, 0xf4, 0x37, 0xcb, 0x09, 0x97, 0xcc, 0xb0, 0xf7, 0xe3, 0x8b, + 0x7f, 0x7e, 0xae, 0x61, 0xbc, 0x39, 0xf4, 0x7f, 0x51, 0xba, 0xcc, 0x41, 0xd0, 0xda, 0x43, 0x78, + 0x6c, 0xfd, 0xcf, 0xcc, 0xc6, 0xa2, 0x3a, 0x74, 0xff, 0x35, 0x9b, 0x84, 0x7b, 0x90, 0x72, 0xab, + 0xdf, 0x1d, 0x2e, 0xfc, 0x98, 0x7d, 0x1a, 0xdc, 0xc2, 0x0f, 0x11, 0x3a, 0x7f, 0xb3, 0xf1, 0x5e, + 0x99, 0xf1, 0xd2, 0x3b, 0xde, 0x5f, 0xde, 0x2c, 0xbc, 0x06, 0x49, 0x77, 0xf0, 0xd6, 0x62, 0xd2, + 0x61, 0xc6, 0xb5, 0xc1, 0x5f, 0xa1, 0x96, 0xad, 0x1e, 0x84, 0xf9, 0xba, 0xd2, 0xd7, 0xab, 0xd2, + 0x2d, 0x2d, 0xdc, 0x81, 0x7c, 0x1b, 0x78, 0xbd, 0xaa, 0xdb, 0xc2, 0x77, 0x3e, 0xfe, 0xe3, 0xe5, + 0x7e, 0xf0, 0xfc, 0xe5, 0x7e, 0xf0, 0xf7, 0xcb, 0xfd, 0xe0, 0xd9, 0xab, 0xfd, 0x2b, 0xcf, 0x5f, + 0xed, 0x5f, 0xf9, 0xf3, 0xd5, 0xfe, 0x15, 0xe4, 0x7f, 0x28, 0xef, 0x07, 0xdf, 0x5f, 0x9d, 0x49, + 0xc5, 0x12, 0x19, 0xfb, 0xc8, 0xcf, 0xce, 0x8e, 0xc6, 0x4d, 0xd8, 0xec, 0xc3, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xf3, 0x64, 0xb4, 0x55, 0x8b, 0x0a, 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 + +// ConfigAPIClient is the client API for ConfigAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ConfigAPIClient interface { + // 获取系统配置(针对所有用户,只读) + GetSettings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Settings, error) + // UpdateConfig 更新配置 + UpdateConfig(ctx context.Context, in *Configs, opts ...grpc.CallOption) (*emptypb.Empty, error) + // ListConfig 查询配置项 + ListConfig(ctx context.Context, in *ListConfigRequest, opts ...grpc.CallOption) (*Configs, error) + // 获取系统配置 + GetStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Stats, error) +} + +type configAPIClient struct { + cc *grpc.ClientConn +} + +func NewConfigAPIClient(cc *grpc.ClientConn) ConfigAPIClient { + return &configAPIClient{cc} +} + +func (c *configAPIClient) GetSettings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Settings, error) { + out := new(Settings) + err := c.cc.Invoke(ctx, "/api.v1.ConfigAPI/GetSettings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configAPIClient) UpdateConfig(ctx context.Context, in *Configs, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ConfigAPI/UpdateConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configAPIClient) ListConfig(ctx context.Context, in *ListConfigRequest, opts ...grpc.CallOption) (*Configs, error) { + out := new(Configs) + err := c.cc.Invoke(ctx, "/api.v1.ConfigAPI/ListConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configAPIClient) GetStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Stats, error) { + out := new(Stats) + err := c.cc.Invoke(ctx, "/api.v1.ConfigAPI/GetStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConfigAPIServer is the server API for ConfigAPI service. +type ConfigAPIServer interface { + // 获取系统配置(针对所有用户,只读) + GetSettings(context.Context, *emptypb.Empty) (*Settings, error) + // UpdateConfig 更新配置 + UpdateConfig(context.Context, *Configs) (*emptypb.Empty, error) + // ListConfig 查询配置项 + ListConfig(context.Context, *ListConfigRequest) (*Configs, error) + // 获取系统配置 + GetStats(context.Context, *emptypb.Empty) (*Stats, error) +} + +// UnimplementedConfigAPIServer can be embedded to have forward compatible implementations. +type UnimplementedConfigAPIServer struct { +} + +func (*UnimplementedConfigAPIServer) GetSettings(ctx context.Context, req *emptypb.Empty) (*Settings, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSettings not implemented") +} +func (*UnimplementedConfigAPIServer) UpdateConfig(ctx context.Context, req *Configs) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") +} +func (*UnimplementedConfigAPIServer) ListConfig(ctx context.Context, req *ListConfigRequest) (*Configs, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListConfig not implemented") +} +func (*UnimplementedConfigAPIServer) GetStats(ctx context.Context, req *emptypb.Empty) (*Stats, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented") +} + +func RegisterConfigAPIServer(s *grpc.Server, srv ConfigAPIServer) { + s.RegisterService(&_ConfigAPI_serviceDesc, srv) +} + +func _ConfigAPI_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigAPIServer).GetSettings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ConfigAPI/GetSettings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigAPIServer).GetSettings(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigAPI_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Configs) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigAPIServer).UpdateConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ConfigAPI/UpdateConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigAPIServer).UpdateConfig(ctx, req.(*Configs)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigAPI_ListConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigAPIServer).ListConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ConfigAPI/ListConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigAPIServer).ListConfig(ctx, req.(*ListConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigAPI_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigAPIServer).GetStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ConfigAPI/GetStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigAPIServer).GetStats(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _ConfigAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.ConfigAPI", + HandlerType: (*ConfigAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSettings", + Handler: _ConfigAPI_GetSettings_Handler, + }, + { + MethodName: "UpdateConfig", + Handler: _ConfigAPI_UpdateConfig_Handler, + }, + { + MethodName: "ListConfig", + Handler: _ConfigAPI_ListConfig_Handler, + }, + { + MethodName: "GetStats", + Handler: _ConfigAPI_GetStats_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/config.proto", +} + +func (m *Config) 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 *Config) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 = encodeVarintConfig(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + } + 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 = encodeVarintConfig(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x52 + } + if len(m.Options) > 0 { + i -= len(m.Options) + copy(dAtA[i:], m.Options) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Options))) + i-- + dAtA[i] = 0x4a + } + if m.Sort != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.Sort)) + i-- + dAtA[i] = 0x40 + } + if len(m.Category) > 0 { + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x3a + } + if len(m.InputType) > 0 { + i -= len(m.InputType) + copy(dAtA[i:], m.InputType) + i = encodeVarintConfig(dAtA, i, uint64(len(m.InputType))) + i-- + dAtA[i] = 0x32 + } + if len(m.Placeholder) > 0 { + i -= len(m.Placeholder) + copy(dAtA[i:], m.Placeholder) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Placeholder))) + i-- + dAtA[i] = 0x2a + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListConfigRequest) 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 *ListConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigRequest) 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-- { + i -= len(m.Category[iNdEx]) + copy(dAtA[i:], m.Category[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Category[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Configs) 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 *Configs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Configs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Config) > 0 { + for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ConfigCaptcha) 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 *ConfigCaptcha) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigCaptcha) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + } + if m.Height != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + if m.Width != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.Width)) + i-- + dAtA[i] = 0x10 + } + if m.Length != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.Length)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ConfigSystem) 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 *ConfigSystem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigSystem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RecommendWords) > 0 { + for iNdEx := len(m.RecommendWords) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RecommendWords[iNdEx]) + copy(dAtA[i:], m.RecommendWords[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.RecommendWords[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.LoginBackground) > 0 { + i -= len(m.LoginBackground) + copy(dAtA[i:], m.LoginBackground) + i = encodeVarintConfig(dAtA, i, uint64(len(m.LoginBackground))) + i-- + dAtA[i] = 0x62 + } + if len(m.RegisterBackground) > 0 { + i -= len(m.RegisterBackground) + copy(dAtA[i:], m.RegisterBackground) + i = encodeVarintConfig(dAtA, i, uint64(len(m.RegisterBackground))) + i-- + dAtA[i] = 0x5a + } + if len(m.CopyrightStartYear) > 0 { + i -= len(m.CopyrightStartYear) + copy(dAtA[i:], m.CopyrightStartYear) + i = encodeVarintConfig(dAtA, i, uint64(len(m.CopyrightStartYear))) + i-- + dAtA[i] = 0x52 + } + if len(m.Sitename) > 0 { + i -= len(m.Sitename) + copy(dAtA[i:], m.Sitename) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Sitename))) + i-- + dAtA[i] = 0x4a + } + if len(m.Analytics) > 0 { + i -= len(m.Analytics) + copy(dAtA[i:], m.Analytics) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Analytics))) + i-- + dAtA[i] = 0x42 + } + if len(m.Icp) > 0 { + i -= len(m.Icp) + copy(dAtA[i:], m.Icp) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Icp))) + i-- + dAtA[i] = 0x3a + } + if len(m.Favicon) > 0 { + i -= len(m.Favicon) + copy(dAtA[i:], m.Favicon) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Favicon))) + i-- + dAtA[i] = 0x32 + } + if len(m.Logo) > 0 { + i -= len(m.Logo) + copy(dAtA[i:], m.Logo) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Logo))) + i-- + dAtA[i] = 0x2a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Keywords) > 0 { + i -= len(m.Keywords) + copy(dAtA[i:], m.Keywords) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Keywords))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigFooter) 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 *ConfigFooter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigFooter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Feedback) > 0 { + i -= len(m.Feedback) + copy(dAtA[i:], m.Feedback) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Feedback))) + i-- + dAtA[i] = 0x2a + } + if len(m.Copyright) > 0 { + i -= len(m.Copyright) + copy(dAtA[i:], m.Copyright) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Copyright))) + i-- + dAtA[i] = 0x22 + } + if len(m.Agreement) > 0 { + i -= len(m.Agreement) + copy(dAtA[i:], m.Agreement) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Agreement))) + i-- + dAtA[i] = 0x1a + } + if len(m.Contact) > 0 { + i -= len(m.Contact) + copy(dAtA[i:], m.Contact) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Contact))) + i-- + dAtA[i] = 0x12 + } + if len(m.About) > 0 { + i -= len(m.About) + copy(dAtA[i:], m.About) + i = encodeVarintConfig(dAtA, i, uint64(len(m.About))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigSecurity) 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 *ConfigSecurity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigSecurity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxDocumentSize != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.MaxDocumentSize)) + i-- + dAtA[i] = 0x48 + } + if m.EnableCaptchaUpload { + i-- + if m.EnableCaptchaUpload { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.EnableCaptchaFindPassword { + i-- + if m.EnableCaptchaFindPassword { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.EnableCaptchaComment { + i-- + if m.EnableCaptchaComment { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.EnableCaptchaRegister { + i-- + if m.EnableCaptchaRegister { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.EnableCaptchaLogin { + i-- + if m.EnableCaptchaLogin { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.EnableRegister { + i-- + if m.EnableRegister { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.CloseStatement) > 0 { + i -= len(m.CloseStatement) + copy(dAtA[i:], m.CloseStatement) + i = encodeVarintConfig(dAtA, i, uint64(len(m.CloseStatement))) + i-- + dAtA[i] = 0x12 + } + if m.IsClose { + i-- + if m.IsClose { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Settings) 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 *Settings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Settings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Security != nil { + { + size, err := m.Security.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Footer != nil { + { + size, err := m.Footer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.System != nil { + { + size, err := m.System.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Stats) 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 *Stats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ReportCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.ReportCount)) + i-- + dAtA[i] = 0x60 + } + if len(m.BuildAt) > 0 { + i -= len(m.BuildAt) + copy(dAtA[i:], m.BuildAt) + i = encodeVarintConfig(dAtA, i, uint64(len(m.BuildAt))) + i-- + dAtA[i] = 0x5a + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x52 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x4a + } + if len(m.Os) > 0 { + i -= len(m.Os) + copy(dAtA[i:], m.Os) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Os))) + i-- + dAtA[i] = 0x42 + } + if m.FriendlinkCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.FriendlinkCount)) + i-- + dAtA[i] = 0x38 + } + if m.BannerCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.BannerCount)) + i-- + dAtA[i] = 0x30 + } + if m.CommentCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.CommentCount)) + i-- + dAtA[i] = 0x28 + } + if m.ArticleCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.ArticleCount)) + i-- + dAtA[i] = 0x20 + } + if m.CategoryCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.CategoryCount)) + i-- + dAtA[i] = 0x18 + } + if m.DocumentCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.DocumentCount)) + i-- + dAtA[i] = 0x10 + } + if m.UserCount != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.UserCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Config) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovConfig(uint64(m.Id)) + } + l = len(m.Label) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Placeholder) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.InputType) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Category) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if m.Sort != 0 { + n += 1 + sovConfig(uint64(m.Sort)) + } + l = len(m.Options) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovConfig(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *ListConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Category) > 0 { + for _, s := range m.Category { + l = len(s) + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func (m *Configs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Config) > 0 { + for _, e := range m.Config { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func (m *ConfigCaptcha) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Length != 0 { + n += 1 + sovConfig(uint64(m.Length)) + } + if m.Width != 0 { + n += 1 + sovConfig(uint64(m.Width)) + } + if m.Height != 0 { + n += 1 + sovConfig(uint64(m.Height)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *ConfigSystem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Keywords) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Logo) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Favicon) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Icp) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Analytics) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Sitename) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.CopyrightStartYear) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.RegisterBackground) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.LoginBackground) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if len(m.RecommendWords) > 0 { + for _, s := range m.RecommendWords { + l = len(s) + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func (m *ConfigFooter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.About) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Contact) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Agreement) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Copyright) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Feedback) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *ConfigSecurity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IsClose { + n += 2 + } + l = len(m.CloseStatement) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if m.EnableRegister { + n += 2 + } + if m.EnableCaptchaLogin { + n += 2 + } + if m.EnableCaptchaRegister { + n += 2 + } + if m.EnableCaptchaComment { + n += 2 + } + if m.EnableCaptchaFindPassword { + n += 2 + } + if m.EnableCaptchaUpload { + n += 2 + } + if m.MaxDocumentSize != 0 { + n += 1 + sovConfig(uint64(m.MaxDocumentSize)) + } + return n +} + +func (m *Settings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.System != nil { + l = m.System.Size() + n += 1 + l + sovConfig(uint64(l)) + } + if m.Footer != nil { + l = m.Footer.Size() + n += 1 + l + sovConfig(uint64(l)) + } + if m.Security != nil { + l = m.Security.Size() + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *Stats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UserCount != 0 { + n += 1 + sovConfig(uint64(m.UserCount)) + } + if m.DocumentCount != 0 { + n += 1 + sovConfig(uint64(m.DocumentCount)) + } + if m.CategoryCount != 0 { + n += 1 + sovConfig(uint64(m.CategoryCount)) + } + if m.ArticleCount != 0 { + n += 1 + sovConfig(uint64(m.ArticleCount)) + } + if m.CommentCount != 0 { + n += 1 + sovConfig(uint64(m.CommentCount)) + } + if m.BannerCount != 0 { + n += 1 + sovConfig(uint64(m.BannerCount)) + } + if m.FriendlinkCount != 0 { + n += 1 + sovConfig(uint64(m.FriendlinkCount)) + } + l = len(m.Os) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.BuildAt) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if m.ReportCount != 0 { + n += 1 + sovConfig(uint64(m.ReportCount)) + } + return n +} + +func sovConfig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozConfig(x uint64) (n int) { + return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Config) 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 ErrIntOverflowConfig + } + 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: Config: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Config: 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 ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Placeholder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Placeholder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InputType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InputType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + 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 ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + 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 ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + 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 11: + 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 ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + 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 + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListConfigRequest) 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 ErrIntOverflowConfig + } + 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: ListConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = append(m.Category, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Configs) 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 ErrIntOverflowConfig + } + 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: Configs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Configs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = append(m.Config, &Config{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigCaptcha) 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 ErrIntOverflowConfig + } + 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: ConfigCaptcha: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigCaptcha: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) + } + m.Length = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Length |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) + } + m.Width = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Width |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigSystem) 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 ErrIntOverflowConfig + } + 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: ConfigSystem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigSystem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keywords", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keywords = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Favicon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Favicon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Analytics", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Analytics = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sitename", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sitename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CopyrightStartYear", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CopyrightStartYear = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterBackground", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisterBackground = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoginBackground", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LoginBackground = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecommendWords", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecommendWords = append(m.RecommendWords, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigFooter) 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 ErrIntOverflowConfig + } + 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: ConfigFooter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigFooter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field About", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.About = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Agreement", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Agreement = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Copyright", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Copyright = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Feedback", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Feedback = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigSecurity) 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 ErrIntOverflowConfig + } + 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: ConfigSecurity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigSecurity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsClose", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsClose = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CloseStatement", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CloseStatement = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableRegister", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableRegister = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCaptchaLogin", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCaptchaLogin = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCaptchaRegister", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCaptchaRegister = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCaptchaComment", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCaptchaComment = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCaptchaFindPassword", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCaptchaFindPassword = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCaptchaUpload", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCaptchaUpload = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDocumentSize", wireType) + } + m.MaxDocumentSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxDocumentSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Settings) 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 ErrIntOverflowConfig + } + 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: Settings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Settings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field System", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.System == nil { + m.System = &ConfigSystem{} + } + if err := m.System.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Footer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Footer == nil { + m.Footer = &ConfigFooter{} + } + if err := m.Footer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Security", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Security == nil { + m.Security = &ConfigSecurity{} + } + if err := m.Security.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Stats) 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 ErrIntOverflowConfig + } + 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: Stats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Stats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserCount", wireType) + } + m.UserCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentCount", wireType) + } + m.DocumentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryCount", wireType) + } + m.CategoryCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CategoryCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArticleCount", wireType) + } + m.ArticleCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ArticleCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommentCount", wireType) + } + m.CommentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommentCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BannerCount", wireType) + } + m.BannerCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BannerCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FriendlinkCount", wireType) + } + m.FriendlinkCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FriendlinkCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Os", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Os = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildAt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BuildAt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReportCount", wireType) + } + m.ReportCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReportCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConfig(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, ErrIntOverflowConfig + } + 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, ErrIntOverflowConfig + } + 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, ErrIntOverflowConfig + } + 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, ErrInvalidLengthConfig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupConfig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthConfig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/config.pb.gw.go b/api/v1/config.pb.gw.go new file mode 100644 index 0000000..da8e7da --- /dev/null +++ b/api/v1/config.pb.gw.go @@ -0,0 +1,383 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/config.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_ConfigAPI_GetSettings_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ConfigAPI_GetSettings_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.GetSettings(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ConfigAPI_UpdateConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Configs + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ConfigAPI_UpdateConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Configs + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateConfig(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ConfigAPI_ListConfig_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ConfigAPI_ListConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListConfigRequest + 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_ConfigAPI_ListConfig_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ConfigAPI_ListConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListConfigRequest + 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_ConfigAPI_ListConfig_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListConfig(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ConfigAPI_GetStats_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ConfigAPI_GetStats_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.GetStats(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterConfigAPIHandlerServer registers the http handlers for service ConfigAPI to "mux". +// UnaryRPC :call ConfigAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConfigAPIHandlerFromEndpoint instead. +func RegisterConfigAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigAPIServer) error { + + mux.Handle("GET", pattern_ConfigAPI_GetSettings_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ConfigAPI_GetSettings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_GetSettings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ConfigAPI_UpdateConfig_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ConfigAPI_UpdateConfig_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_UpdateConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ConfigAPI_ListConfig_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ConfigAPI_ListConfig_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_ListConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ConfigAPI_GetStats_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ConfigAPI_GetStats_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_GetStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterConfigAPIHandlerFromEndpoint is same as RegisterConfigAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterConfigAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterConfigAPIHandler(ctx, mux, conn) +} + +// RegisterConfigAPIHandler registers the http handlers for service ConfigAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterConfigAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterConfigAPIHandlerClient(ctx, mux, NewConfigAPIClient(conn)) +} + +// RegisterConfigAPIHandlerClient registers the http handlers for service ConfigAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ConfigAPIClient" to call the correct interceptors. +func RegisterConfigAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigAPIClient) error { + + mux.Handle("GET", pattern_ConfigAPI_GetSettings_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ConfigAPI_GetSettings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_GetSettings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ConfigAPI_UpdateConfig_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ConfigAPI_UpdateConfig_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_UpdateConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ConfigAPI_ListConfig_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ConfigAPI_ListConfig_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_ListConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ConfigAPI_GetStats_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ConfigAPI_GetStats_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ConfigAPI_GetStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ConfigAPI_GetSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "settings"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ConfigAPI_UpdateConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "config"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ConfigAPI_ListConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "config", "list"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ConfigAPI_GetStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "stats"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_ConfigAPI_GetSettings_0 = runtime.ForwardResponseMessage + + forward_ConfigAPI_UpdateConfig_0 = runtime.ForwardResponseMessage + + forward_ConfigAPI_ListConfig_0 = runtime.ForwardResponseMessage + + forward_ConfigAPI_GetStats_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/document.pb.go b/api/v1/document.pb.go new file mode 100644 index 0000000..ee2f35e --- /dev/null +++ b/api/v1/document.pb.go @@ -0,0 +1,6508 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/document.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 Document struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Keywords string `protobuf:"bytes,3,opt,name=keywords,proto3" json:"keywords,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + UserId int64 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Cover string `protobuf:"bytes,6,opt,name=cover,proto3" json:"cover,omitempty"` + Width int32 `protobuf:"varint,7,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,8,opt,name=height,proto3" json:"height,omitempty"` + Preview int32 `protobuf:"varint,9,opt,name=preview,proto3" json:"preview,omitempty"` + Pages int32 `protobuf:"varint,10,opt,name=pages,proto3" json:"pages,omitempty"` + Uuid string `protobuf:"bytes,11,opt,name=uuid,proto3" json:"uuid,omitempty"` + DownloadCount int32 `protobuf:"varint,12,opt,name=download_count,json=downloadCount,proto3" json:"download_count,omitempty"` + ViewCount int32 `protobuf:"varint,13,opt,name=view_count,json=viewCount,proto3" json:"view_count,omitempty"` + FavoriteCount int32 `protobuf:"varint,14,opt,name=favorite_count,json=favoriteCount,proto3" json:"favorite_count,omitempty"` + CommentCount int32 `protobuf:"varint,15,opt,name=comment_count,json=commentCount,proto3" json:"comment_count,omitempty"` + Score int32 `protobuf:"varint,16,opt,name=score,proto3" json:"score,omitempty"` + ScoreCount int32 `protobuf:"varint,17,opt,name=score_count,json=scoreCount,proto3" json:"score_count,omitempty"` + Price int32 `protobuf:"varint,18,opt,name=price,proto3" json:"price,omitempty"` + Size_ int64 `protobuf:"varint,19,opt,name=size,proto3" json:"size,omitempty"` + Status int32 `protobuf:"varint,20,opt,name=status,proto3" json:"status,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,21,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,22,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` + DeletedAt *time.Time `protobuf:"bytes,23,opt,name=deleted_at,json=deletedAt,proto3,stdtime" json:"deleted_at,omitempty"` + RecommendAt *time.Time `protobuf:"bytes,29,opt,name=recommend_at,json=recommendAt,proto3,stdtime" json:"recommend_at,omitempty"` + DeletedUserId int64 `protobuf:"varint,24,opt,name=deleted_user_id,json=deletedUserId,proto3" json:"deleted_user_id,omitempty"` + Username string `protobuf:"bytes,25,opt,name=username,proto3" json:"username,omitempty"` + CategoryId []int64 `protobuf:"varint,26,rep,packed,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + DeletedUsername string `protobuf:"bytes,27,opt,name=deleted_username,json=deletedUsername,proto3" json:"deleted_username,omitempty"` + Ext string `protobuf:"bytes,28,opt,name=ext,proto3" json:"ext,omitempty"` + Attachment *Attachment `protobuf:"bytes,30,opt,name=attachment,proto3" json:"attachment,omitempty"` + User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"` + EnableGzip bool `protobuf:"varint,32,opt,name=enable_gzip,json=enableGzip,proto3" json:"enable_gzip,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{0} +} +func (m *Document) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Document.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 *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) +} +func (m *Document) XXX_Size() int { + return m.Size() +} +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) +} + +var xxx_messageInfo_Document proto.InternalMessageInfo + +func (m *Document) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Document) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Document) GetKeywords() string { + if m != nil { + return m.Keywords + } + return "" +} + +func (m *Document) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Document) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Document) GetCover() string { + if m != nil { + return m.Cover + } + return "" +} + +func (m *Document) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Document) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Document) GetPreview() int32 { + if m != nil { + return m.Preview + } + return 0 +} + +func (m *Document) GetPages() int32 { + if m != nil { + return m.Pages + } + return 0 +} + +func (m *Document) GetUuid() string { + if m != nil { + return m.Uuid + } + return "" +} + +func (m *Document) GetDownloadCount() int32 { + if m != nil { + return m.DownloadCount + } + return 0 +} + +func (m *Document) GetViewCount() int32 { + if m != nil { + return m.ViewCount + } + return 0 +} + +func (m *Document) GetFavoriteCount() int32 { + if m != nil { + return m.FavoriteCount + } + return 0 +} + +func (m *Document) GetCommentCount() int32 { + if m != nil { + return m.CommentCount + } + return 0 +} + +func (m *Document) GetScore() int32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *Document) GetScoreCount() int32 { + if m != nil { + return m.ScoreCount + } + return 0 +} + +func (m *Document) GetPrice() int32 { + if m != nil { + return m.Price + } + return 0 +} + +func (m *Document) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *Document) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *Document) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Document) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +func (m *Document) GetDeletedAt() *time.Time { + if m != nil { + return m.DeletedAt + } + return nil +} + +func (m *Document) GetRecommendAt() *time.Time { + if m != nil { + return m.RecommendAt + } + return nil +} + +func (m *Document) GetDeletedUserId() int64 { + if m != nil { + return m.DeletedUserId + } + return 0 +} + +func (m *Document) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *Document) GetCategoryId() []int64 { + if m != nil { + return m.CategoryId + } + return nil +} + +func (m *Document) GetDeletedUsername() string { + if m != nil { + return m.DeletedUsername + } + return "" +} + +func (m *Document) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + +func (m *Document) GetAttachment() *Attachment { + if m != nil { + return m.Attachment + } + return nil +} + +func (m *Document) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *Document) GetEnableGzip() bool { + if m != nil { + return m.EnableGzip + } + return false +} + +type DeleteDocumentRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteDocumentRequest) Reset() { *m = DeleteDocumentRequest{} } +func (m *DeleteDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteDocumentRequest) ProtoMessage() {} +func (*DeleteDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{1} +} +func (m *DeleteDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteDocumentRequest.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 *DeleteDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteDocumentRequest.Merge(m, src) +} +func (m *DeleteDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteDocumentRequest proto.InternalMessageInfo + +func (m *DeleteDocumentRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type RecoverRecycleDocumentRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *RecoverRecycleDocumentRequest) Reset() { *m = RecoverRecycleDocumentRequest{} } +func (m *RecoverRecycleDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*RecoverRecycleDocumentRequest) ProtoMessage() {} +func (*RecoverRecycleDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{2} +} +func (m *RecoverRecycleDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecoverRecycleDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecoverRecycleDocumentRequest.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 *RecoverRecycleDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecoverRecycleDocumentRequest.Merge(m, src) +} +func (m *RecoverRecycleDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *RecoverRecycleDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RecoverRecycleDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RecoverRecycleDocumentRequest proto.InternalMessageInfo + +func (m *RecoverRecycleDocumentRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetDocumentRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + WithAuthor bool `protobuf:"varint,2,opt,name=with_author,json=withAuthor,proto3" json:"with_author,omitempty"` +} + +func (m *GetDocumentRequest) Reset() { *m = GetDocumentRequest{} } +func (m *GetDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*GetDocumentRequest) ProtoMessage() {} +func (*GetDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{3} +} +func (m *GetDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetDocumentRequest.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 *GetDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDocumentRequest.Merge(m, src) +} +func (m *GetDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *GetDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDocumentRequest proto.InternalMessageInfo + +func (m *GetDocumentRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *GetDocumentRequest) GetWithAuthor() bool { + if m != nil { + return m.WithAuthor + } + return false +} + +type ListDocumentRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Field []string `protobuf:"bytes,4,rep,name=field,proto3" json:"field,omitempty"` + Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"` + CategoryId []int64 `protobuf:"varint,6,rep,packed,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + UserId []int64 `protobuf:"varint,7,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Status []int32 `protobuf:"varint,8,rep,packed,name=status,proto3" json:"status,omitempty"` + IsRecommend []bool `protobuf:"varint,9,rep,packed,name=is_recommend,json=isRecommend,proto3" json:"is_recommend,omitempty"` + Limit int64 `protobuf:"varint,10,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *ListDocumentRequest) Reset() { *m = ListDocumentRequest{} } +func (m *ListDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*ListDocumentRequest) ProtoMessage() {} +func (*ListDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{4} +} +func (m *ListDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentRequest.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 *ListDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentRequest.Merge(m, src) +} +func (m *ListDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentRequest proto.InternalMessageInfo + +func (m *ListDocumentRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListDocumentRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListDocumentRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListDocumentRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +func (m *ListDocumentRequest) GetOrder() string { + if m != nil { + return m.Order + } + return "" +} + +func (m *ListDocumentRequest) GetCategoryId() []int64 { + if m != nil { + return m.CategoryId + } + return nil +} + +func (m *ListDocumentRequest) GetUserId() []int64 { + if m != nil { + return m.UserId + } + return nil +} + +func (m *ListDocumentRequest) GetStatus() []int32 { + if m != nil { + return m.Status + } + return nil +} + +func (m *ListDocumentRequest) GetIsRecommend() []bool { + if m != nil { + return m.IsRecommend + } + return nil +} + +func (m *ListDocumentRequest) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +type ListDocumentReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Document []*Document `protobuf:"bytes,2,rep,name=document,proto3" json:"document,omitempty"` +} + +func (m *ListDocumentReply) Reset() { *m = ListDocumentReply{} } +func (m *ListDocumentReply) String() string { return proto.CompactTextString(m) } +func (*ListDocumentReply) ProtoMessage() {} +func (*ListDocumentReply) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{5} +} +func (m *ListDocumentReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentReply.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 *ListDocumentReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentReply.Merge(m, src) +} +func (m *ListDocumentReply) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentReply proto.InternalMessageInfo + +func (m *ListDocumentReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListDocumentReply) GetDocument() []*Document { + if m != nil { + return m.Document + } + return nil +} + +type CreateDocumentItem struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + AttachmentId int64 `protobuf:"varint,2,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` + Price int32 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` +} + +func (m *CreateDocumentItem) Reset() { *m = CreateDocumentItem{} } +func (m *CreateDocumentItem) String() string { return proto.CompactTextString(m) } +func (*CreateDocumentItem) ProtoMessage() {} +func (*CreateDocumentItem) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{6} +} +func (m *CreateDocumentItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateDocumentItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateDocumentItem.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 *CreateDocumentItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDocumentItem.Merge(m, src) +} +func (m *CreateDocumentItem) XXX_Size() int { + return m.Size() +} +func (m *CreateDocumentItem) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDocumentItem.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDocumentItem proto.InternalMessageInfo + +func (m *CreateDocumentItem) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CreateDocumentItem) GetAttachmentId() int64 { + if m != nil { + return m.AttachmentId + } + return 0 +} + +func (m *CreateDocumentItem) GetPrice() int32 { + if m != nil { + return m.Price + } + return 0 +} + +type CreateDocumentRequest struct { + Overwrite bool `protobuf:"varint,1,opt,name=overwrite,proto3" json:"overwrite,omitempty"` + CategoryId []int64 `protobuf:"varint,2,rep,packed,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Document []*CreateDocumentItem `protobuf:"bytes,3,rep,name=document,proto3" json:"document,omitempty"` +} + +func (m *CreateDocumentRequest) Reset() { *m = CreateDocumentRequest{} } +func (m *CreateDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*CreateDocumentRequest) ProtoMessage() {} +func (*CreateDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{7} +} +func (m *CreateDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateDocumentRequest.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 *CreateDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDocumentRequest.Merge(m, src) +} +func (m *CreateDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDocumentRequest proto.InternalMessageInfo + +func (m *CreateDocumentRequest) GetOverwrite() bool { + if m != nil { + return m.Overwrite + } + return false +} + +func (m *CreateDocumentRequest) GetCategoryId() []int64 { + if m != nil { + return m.CategoryId + } + return nil +} + +func (m *CreateDocumentRequest) GetDocument() []*CreateDocumentItem { + if m != nil { + return m.Document + } + return nil +} + +type SetDocumentRecommendRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` +} + +func (m *SetDocumentRecommendRequest) Reset() { *m = SetDocumentRecommendRequest{} } +func (m *SetDocumentRecommendRequest) String() string { return proto.CompactTextString(m) } +func (*SetDocumentRecommendRequest) ProtoMessage() {} +func (*SetDocumentRecommendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{8} +} +func (m *SetDocumentRecommendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetDocumentRecommendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetDocumentRecommendRequest.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 *SetDocumentRecommendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetDocumentRecommendRequest.Merge(m, src) +} +func (m *SetDocumentRecommendRequest) XXX_Size() int { + return m.Size() +} +func (m *SetDocumentRecommendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetDocumentRecommendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetDocumentRecommendRequest proto.InternalMessageInfo + +func (m *SetDocumentRecommendRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +func (m *SetDocumentRecommendRequest) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +type ListDocumentForHomeRequest struct { + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *ListDocumentForHomeRequest) Reset() { *m = ListDocumentForHomeRequest{} } +func (m *ListDocumentForHomeRequest) String() string { return proto.CompactTextString(m) } +func (*ListDocumentForHomeRequest) ProtoMessage() {} +func (*ListDocumentForHomeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{9} +} +func (m *ListDocumentForHomeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentForHomeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentForHomeRequest.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 *ListDocumentForHomeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentForHomeRequest.Merge(m, src) +} +func (m *ListDocumentForHomeRequest) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentForHomeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentForHomeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentForHomeRequest proto.InternalMessageInfo + +func (m *ListDocumentForHomeRequest) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +type ListDocumentForHomeItem struct { + CategoryId int64 `protobuf:"varint,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + CategoryCover string `protobuf:"bytes,2,opt,name=category_cover,json=categoryCover,proto3" json:"category_cover,omitempty"` + CategoryName string `protobuf:"bytes,3,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + Document []*Document `protobuf:"bytes,4,rep,name=document,proto3" json:"document,omitempty"` +} + +func (m *ListDocumentForHomeItem) Reset() { *m = ListDocumentForHomeItem{} } +func (m *ListDocumentForHomeItem) String() string { return proto.CompactTextString(m) } +func (*ListDocumentForHomeItem) ProtoMessage() {} +func (*ListDocumentForHomeItem) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{10} +} +func (m *ListDocumentForHomeItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentForHomeItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentForHomeItem.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 *ListDocumentForHomeItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentForHomeItem.Merge(m, src) +} +func (m *ListDocumentForHomeItem) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentForHomeItem) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentForHomeItem.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentForHomeItem proto.InternalMessageInfo + +func (m *ListDocumentForHomeItem) GetCategoryId() int64 { + if m != nil { + return m.CategoryId + } + return 0 +} + +func (m *ListDocumentForHomeItem) GetCategoryCover() string { + if m != nil { + return m.CategoryCover + } + return "" +} + +func (m *ListDocumentForHomeItem) GetCategoryName() string { + if m != nil { + return m.CategoryName + } + return "" +} + +func (m *ListDocumentForHomeItem) GetDocument() []*Document { + if m != nil { + return m.Document + } + return nil +} + +type ListDocumentForHomeResponse struct { + Document []*ListDocumentForHomeItem `protobuf:"bytes,1,rep,name=document,proto3" json:"document,omitempty"` +} + +func (m *ListDocumentForHomeResponse) Reset() { *m = ListDocumentForHomeResponse{} } +func (m *ListDocumentForHomeResponse) String() string { return proto.CompactTextString(m) } +func (*ListDocumentForHomeResponse) ProtoMessage() {} +func (*ListDocumentForHomeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{11} +} +func (m *ListDocumentForHomeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentForHomeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentForHomeResponse.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 *ListDocumentForHomeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentForHomeResponse.Merge(m, src) +} +func (m *ListDocumentForHomeResponse) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentForHomeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentForHomeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentForHomeResponse proto.InternalMessageInfo + +func (m *ListDocumentForHomeResponse) GetDocument() []*ListDocumentForHomeItem { + if m != nil { + return m.Document + } + return nil +} + +type SearchDocumentRequest struct { + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size_ int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + CategoryId []int64 `protobuf:"varint,4,rep,packed,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Sort string `protobuf:"bytes,5,opt,name=sort,proto3" json:"sort,omitempty"` + Ext string `protobuf:"bytes,7,opt,name=ext,proto3" json:"ext,omitempty"` +} + +func (m *SearchDocumentRequest) Reset() { *m = SearchDocumentRequest{} } +func (m *SearchDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*SearchDocumentRequest) ProtoMessage() {} +func (*SearchDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{12} +} +func (m *SearchDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SearchDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SearchDocumentRequest.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 *SearchDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchDocumentRequest.Merge(m, src) +} +func (m *SearchDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *SearchDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SearchDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchDocumentRequest proto.InternalMessageInfo + +func (m *SearchDocumentRequest) GetPage() int32 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *SearchDocumentRequest) GetSize_() int32 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *SearchDocumentRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *SearchDocumentRequest) GetCategoryId() []int64 { + if m != nil { + return m.CategoryId + } + return nil +} + +func (m *SearchDocumentRequest) GetSort() string { + if m != nil { + return m.Sort + } + return "" +} + +func (m *SearchDocumentRequest) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + +type SearchDocumentReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Spend string `protobuf:"bytes,2,opt,name=spend,proto3" json:"spend,omitempty"` + Document []*Document `protobuf:"bytes,3,rep,name=document,proto3" json:"document,omitempty"` +} + +func (m *SearchDocumentReply) Reset() { *m = SearchDocumentReply{} } +func (m *SearchDocumentReply) String() string { return proto.CompactTextString(m) } +func (*SearchDocumentReply) ProtoMessage() {} +func (*SearchDocumentReply) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{13} +} +func (m *SearchDocumentReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SearchDocumentReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SearchDocumentReply.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 *SearchDocumentReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchDocumentReply.Merge(m, src) +} +func (m *SearchDocumentReply) XXX_Size() int { + return m.Size() +} +func (m *SearchDocumentReply) XXX_DiscardUnknown() { + xxx_messageInfo_SearchDocumentReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchDocumentReply proto.InternalMessageInfo + +func (m *SearchDocumentReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *SearchDocumentReply) GetSpend() string { + if m != nil { + return m.Spend + } + return "" +} + +func (m *SearchDocumentReply) GetDocument() []*Document { + if m != nil { + return m.Document + } + return nil +} + +type DownloadDocumentReply struct { + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` +} + +func (m *DownloadDocumentReply) Reset() { *m = DownloadDocumentReply{} } +func (m *DownloadDocumentReply) String() string { return proto.CompactTextString(m) } +func (*DownloadDocumentReply) ProtoMessage() {} +func (*DownloadDocumentReply) Descriptor() ([]byte, []int) { + return fileDescriptor_55a584ae3a7fc022, []int{14} +} +func (m *DownloadDocumentReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DownloadDocumentReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DownloadDocumentReply.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 *DownloadDocumentReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_DownloadDocumentReply.Merge(m, src) +} +func (m *DownloadDocumentReply) XXX_Size() int { + return m.Size() +} +func (m *DownloadDocumentReply) XXX_DiscardUnknown() { + xxx_messageInfo_DownloadDocumentReply.DiscardUnknown(m) +} + +var xxx_messageInfo_DownloadDocumentReply proto.InternalMessageInfo + +func (m *DownloadDocumentReply) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func init() { + proto.RegisterType((*Document)(nil), "api.v1.Document") + proto.RegisterType((*DeleteDocumentRequest)(nil), "api.v1.DeleteDocumentRequest") + proto.RegisterType((*RecoverRecycleDocumentRequest)(nil), "api.v1.RecoverRecycleDocumentRequest") + proto.RegisterType((*GetDocumentRequest)(nil), "api.v1.GetDocumentRequest") + proto.RegisterType((*ListDocumentRequest)(nil), "api.v1.ListDocumentRequest") + proto.RegisterType((*ListDocumentReply)(nil), "api.v1.ListDocumentReply") + proto.RegisterType((*CreateDocumentItem)(nil), "api.v1.CreateDocumentItem") + proto.RegisterType((*CreateDocumentRequest)(nil), "api.v1.CreateDocumentRequest") + proto.RegisterType((*SetDocumentRecommendRequest)(nil), "api.v1.SetDocumentRecommendRequest") + proto.RegisterType((*ListDocumentForHomeRequest)(nil), "api.v1.ListDocumentForHomeRequest") + proto.RegisterType((*ListDocumentForHomeItem)(nil), "api.v1.ListDocumentForHomeItem") + proto.RegisterType((*ListDocumentForHomeResponse)(nil), "api.v1.ListDocumentForHomeResponse") + proto.RegisterType((*SearchDocumentRequest)(nil), "api.v1.SearchDocumentRequest") + proto.RegisterType((*SearchDocumentReply)(nil), "api.v1.SearchDocumentReply") + proto.RegisterType((*DownloadDocumentReply)(nil), "api.v1.DownloadDocumentReply") +} + +func init() { proto.RegisterFile("api/v1/document.proto", fileDescriptor_55a584ae3a7fc022) } + +var fileDescriptor_55a584ae3a7fc022 = []byte{ + // 1515 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0x0e, 0x45, 0xd9, 0x96, 0x8f, 0x64, 0xc5, 0x1e, 0x5b, 0x36, 0x4d, 0xd9, 0x92, 0x42, 0x5f, + 0xdf, 0xab, 0x18, 0x17, 0x16, 0xe2, 0x8b, 0xdb, 0x45, 0xb3, 0x28, 0x1c, 0x27, 0x4d, 0x0d, 0x14, + 0x45, 0xc0, 0x34, 0x08, 0x90, 0x8d, 0xc1, 0x88, 0x63, 0x89, 0x28, 0x25, 0xb2, 0xe4, 0xc8, 0xaa, + 0x8d, 0x76, 0x53, 0x74, 0x5d, 0x04, 0x28, 0xd0, 0x37, 0xe8, 0x1b, 0x74, 0xd7, 0x17, 0xe8, 0x32, + 0x40, 0x37, 0x05, 0xba, 0x68, 0x91, 0xf4, 0x41, 0x8a, 0x39, 0x33, 0x43, 0x51, 0x22, 0x65, 0x07, + 0xd9, 0xf1, 0x9c, 0x39, 0xf3, 0x7d, 0x73, 0x7e, 0x67, 0x24, 0xa8, 0x39, 0xa1, 0xd7, 0xb9, 0xb8, + 0xd7, 0x71, 0x83, 0xee, 0x68, 0x40, 0x87, 0xec, 0x30, 0x8c, 0x02, 0x16, 0x90, 0x45, 0x27, 0xf4, + 0x0e, 0x2f, 0xee, 0x99, 0xcd, 0x5e, 0x10, 0xf4, 0x7c, 0xda, 0x41, 0xed, 0xcb, 0xd1, 0x79, 0x87, + 0x79, 0x03, 0x1a, 0x33, 0x67, 0x10, 0x0a, 0x43, 0x73, 0xa3, 0x17, 0xf4, 0x02, 0xfc, 0xec, 0xf0, + 0x2f, 0xa9, 0xdd, 0x91, 0xdb, 0x38, 0xb8, 0x33, 0x1c, 0x06, 0xcc, 0x61, 0x5e, 0x30, 0x8c, 0xe5, + 0x6a, 0x7d, 0x16, 0x94, 0x0e, 0x42, 0x76, 0x29, 0x17, 0xb7, 0xe4, 0x81, 0x1c, 0xc6, 0x9c, 0x6e, + 0x7f, 0x72, 0x24, 0x73, 0x4d, 0x2e, 0x8c, 0x62, 0x1a, 0x09, 0x95, 0xf5, 0x4b, 0x09, 0x4a, 0x0f, + 0xe5, 0xc1, 0x49, 0x15, 0x0a, 0x9e, 0x6b, 0x68, 0x2d, 0xad, 0xad, 0xdb, 0x05, 0xcf, 0x25, 0x1b, + 0xb0, 0xc0, 0x3c, 0xe6, 0x53, 0xa3, 0xd0, 0xd2, 0xda, 0xcb, 0xb6, 0x10, 0x88, 0x09, 0xa5, 0x2f, + 0xe8, 0xe5, 0x38, 0x88, 0xdc, 0xd8, 0xd0, 0x71, 0x21, 0x91, 0x49, 0x0b, 0xca, 0x2e, 0x8d, 0xbb, + 0x91, 0x17, 0xf2, 0xd3, 0x1a, 0x45, 0x5c, 0x4e, 0xab, 0xc8, 0x16, 0x2c, 0x71, 0xfa, 0x33, 0xcf, + 0x35, 0x16, 0x90, 0x68, 0x91, 0x8b, 0xa7, 0x48, 0xd6, 0x0d, 0x2e, 0x68, 0x64, 0x2c, 0x0a, 0x32, + 0x14, 0xb8, 0x76, 0xec, 0xb9, 0xac, 0x6f, 0x2c, 0xb5, 0xb4, 0xf6, 0x82, 0x2d, 0x04, 0xb2, 0x09, + 0x8b, 0x7d, 0xea, 0xf5, 0xfa, 0xcc, 0x28, 0xa1, 0x5a, 0x4a, 0xc4, 0x80, 0xa5, 0x30, 0xa2, 0x17, + 0x1e, 0x1d, 0x1b, 0xcb, 0xb8, 0xa0, 0x44, 0x8e, 0x13, 0x3a, 0x3d, 0x1a, 0x1b, 0x20, 0x70, 0x50, + 0x20, 0x04, 0x8a, 0xa3, 0x91, 0xe7, 0x1a, 0x65, 0xa4, 0xc4, 0x6f, 0xb2, 0x0f, 0x55, 0x37, 0x18, + 0x0f, 0xfd, 0xc0, 0x71, 0xcf, 0xba, 0xc1, 0x68, 0xc8, 0x8c, 0x0a, 0x6e, 0x59, 0x51, 0xda, 0x13, + 0xae, 0x24, 0xbb, 0x00, 0x1c, 0x58, 0x9a, 0xac, 0xa0, 0xc9, 0x32, 0xd7, 0x88, 0xe5, 0x7d, 0xa8, + 0x9e, 0x3b, 0x17, 0x41, 0xe4, 0x31, 0x2a, 0x4d, 0xaa, 0x02, 0x45, 0x69, 0x85, 0xd9, 0x1e, 0xac, + 0x74, 0x83, 0x01, 0x0f, 0xbe, 0xb4, 0xba, 0x8d, 0x56, 0x15, 0xa9, 0x14, 0x46, 0x1b, 0xb0, 0x10, + 0x77, 0x83, 0x88, 0x1a, 0xab, 0xe2, 0xec, 0x28, 0x90, 0x26, 0x94, 0xf1, 0x43, 0x6e, 0x5c, 0xc3, + 0x35, 0x40, 0x55, 0xb2, 0x2d, 0x8c, 0xbc, 0x2e, 0x35, 0x88, 0x74, 0x99, 0x0b, 0xdc, 0xe5, 0xd8, + 0xbb, 0xa2, 0xc6, 0x3a, 0x06, 0x1f, 0xbf, 0x79, 0x38, 0x63, 0xe6, 0xb0, 0x51, 0x6c, 0x6c, 0x88, + 0x70, 0x0a, 0x89, 0x7c, 0x04, 0xd0, 0x8d, 0xa8, 0xc3, 0xa8, 0x7b, 0xe6, 0x30, 0xa3, 0xd6, 0xd2, + 0xda, 0xe5, 0x23, 0xf3, 0x50, 0x94, 0xde, 0xa1, 0x2a, 0xbd, 0xc3, 0xcf, 0x55, 0x3d, 0x3f, 0x28, + 0xbe, 0xfa, 0xb3, 0xa9, 0xd9, 0xcb, 0x72, 0xcf, 0x31, 0xe3, 0x00, 0xa3, 0xd0, 0x55, 0x00, 0x9b, + 0xef, 0x0a, 0x20, 0xf7, 0x08, 0x00, 0x97, 0xfa, 0x54, 0x02, 0x6c, 0xbd, 0x2b, 0x80, 0xdc, 0x73, + 0xcc, 0xc8, 0x09, 0x54, 0x22, 0x2a, 0xa2, 0x89, 0x10, 0xbb, 0xef, 0x08, 0x51, 0x4e, 0x76, 0x1d, + 0x33, 0xf2, 0x6f, 0xb8, 0xad, 0x4e, 0xa1, 0x6a, 0xd7, 0xc0, 0xf0, 0xad, 0x48, 0xf5, 0x33, 0x51, + 0xc2, 0x26, 0x94, 0xf8, 0xfa, 0xd0, 0x19, 0x50, 0x63, 0x5b, 0x74, 0x86, 0x92, 0x79, 0xba, 0xba, + 0x0e, 0xa3, 0xbd, 0x20, 0xba, 0xe4, 0xfb, 0xcd, 0x96, 0xde, 0xd6, 0x6d, 0x50, 0xaa, 0x53, 0x97, + 0xdc, 0x85, 0xd5, 0x34, 0x09, 0x82, 0xd4, 0x11, 0xe4, 0x76, 0x8a, 0x05, 0xb1, 0x56, 0x41, 0xa7, + 0x5f, 0x31, 0x63, 0x07, 0x57, 0xf9, 0x27, 0x39, 0x02, 0x98, 0x74, 0xbb, 0xd1, 0x40, 0x27, 0xc9, + 0xa1, 0x98, 0x40, 0x87, 0xc7, 0xc9, 0x8a, 0x9d, 0xb2, 0x22, 0x2d, 0x28, 0x72, 0x22, 0xa3, 0x89, + 0xd6, 0x15, 0x65, 0xcd, 0x59, 0x6c, 0x5c, 0xe1, 0x67, 0xa6, 0x43, 0xe7, 0xa5, 0x4f, 0xcf, 0x7a, + 0x57, 0x5e, 0x68, 0xb4, 0x5a, 0x5a, 0xbb, 0x64, 0x83, 0x50, 0x3d, 0xbe, 0xf2, 0x42, 0xeb, 0x3f, + 0x50, 0x7b, 0x88, 0x67, 0x53, 0x23, 0xc4, 0xa6, 0x5f, 0x8e, 0x68, 0x3c, 0x99, 0x24, 0xba, 0x98, + 0x24, 0x56, 0x07, 0x76, 0x6d, 0x8a, 0x1d, 0x6d, 0xd3, 0xee, 0x65, 0xd7, 0xbf, 0x71, 0xc3, 0x23, + 0x20, 0x8f, 0x29, 0x9b, 0x67, 0xa5, 0x06, 0x54, 0x13, 0xca, 0x63, 0x8f, 0xf5, 0xcf, 0x9c, 0x11, + 0xeb, 0x07, 0x11, 0x8e, 0xa9, 0x92, 0x0d, 0x5c, 0x75, 0x8c, 0x1a, 0xeb, 0xbb, 0x02, 0xac, 0x7f, + 0xea, 0xc5, 0x19, 0x20, 0x02, 0x45, 0x3e, 0x01, 0x24, 0x14, 0x7e, 0x27, 0x9d, 0x51, 0x48, 0x75, + 0x46, 0x15, 0x0a, 0x63, 0x57, 0x4e, 0xb9, 0xc2, 0x18, 0x87, 0xd4, 0xb9, 0x47, 0x7d, 0xd7, 0x28, + 0xb6, 0x74, 0x3e, 0xa4, 0x50, 0xe0, 0xda, 0x20, 0x72, 0x69, 0x84, 0x13, 0x6d, 0xd9, 0x16, 0xc2, + 0x6c, 0xc6, 0x17, 0x33, 0x19, 0x4f, 0x8d, 0xc2, 0x25, 0x5c, 0x54, 0xa3, 0x70, 0xd2, 0x8f, 0xa5, + 0x96, 0x9e, 0xea, 0xc7, 0x3b, 0x50, 0xf1, 0xe2, 0xb3, 0xa4, 0x32, 0x8d, 0xe5, 0x96, 0xde, 0x2e, + 0xd9, 0x65, 0x2f, 0xb6, 0x95, 0x8a, 0x1f, 0xc5, 0xf7, 0x06, 0x1e, 0xc3, 0x39, 0xa7, 0xdb, 0x42, + 0xb0, 0x9e, 0xc3, 0xda, 0x74, 0x14, 0x42, 0xff, 0x12, 0xa7, 0x7b, 0xc0, 0x1c, 0x5f, 0x06, 0x41, + 0x08, 0xe4, 0xbf, 0x50, 0x52, 0x17, 0x99, 0x51, 0x68, 0xe9, 0xed, 0xf2, 0xd1, 0xaa, 0xaa, 0x8c, + 0x64, 0x7b, 0x62, 0x61, 0x51, 0x20, 0x27, 0xd8, 0xed, 0x6a, 0xed, 0x94, 0xd1, 0xc1, 0xe4, 0xde, + 0xd0, 0xd2, 0xf7, 0xc6, 0x1e, 0xac, 0x4c, 0xaa, 0x8f, 0x3b, 0x2d, 0x02, 0x5d, 0x99, 0x28, 0xc5, + 0x2d, 0x20, 0x86, 0x96, 0x9e, 0x1a, 0x5a, 0xd6, 0xf7, 0x1a, 0xd4, 0xa6, 0x79, 0x54, 0x22, 0x77, + 0x60, 0x99, 0x57, 0xd5, 0x98, 0x8f, 0x54, 0xa4, 0x2b, 0xd9, 0x13, 0xc5, 0x6c, 0x0a, 0x0a, 0x99, + 0x14, 0x7c, 0x90, 0xf2, 0x56, 0x47, 0x6f, 0x4d, 0xe5, 0x6d, 0xd6, 0xaf, 0x94, 0xdf, 0xc7, 0x50, + 0x7f, 0x9a, 0x2e, 0x4f, 0x19, 0xfe, 0x39, 0xd5, 0xcc, 0x4b, 0x8b, 0x5d, 0x86, 0xa2, 0xb4, 0x16, + 0x6c, 0xfc, 0xb6, 0x8e, 0xc0, 0x4c, 0xe7, 0xe4, 0xe3, 0x20, 0xfa, 0x24, 0x18, 0x50, 0x85, 0x90, + 0xe4, 0x51, 0x4b, 0xe7, 0xf1, 0x67, 0x0d, 0xb6, 0x72, 0x36, 0x61, 0xd0, 0x67, 0x7c, 0x15, 0xfb, + 0xd2, 0xbe, 0xee, 0x43, 0x35, 0x31, 0x10, 0x37, 0xad, 0xb8, 0xd6, 0x57, 0x94, 0xf6, 0x04, 0x6f, + 0x5c, 0x7e, 0x25, 0x29, 0x33, 0x1c, 0x42, 0xa2, 0xfa, 0x2b, 0x4a, 0xf9, 0x19, 0x9f, 0x40, 0xe9, + 0x2a, 0x29, 0xde, 0x58, 0x25, 0x2f, 0xa0, 0x9e, 0xeb, 0x6a, 0x1c, 0x06, 0xc3, 0x98, 0x92, 0xfb, + 0x29, 0x30, 0x0d, 0xc1, 0x9a, 0x0a, 0x6c, 0x8e, 0xb3, 0x29, 0xec, 0x1f, 0x35, 0xa8, 0x3d, 0xa5, + 0x4e, 0xd4, 0xed, 0x5f, 0xd7, 0xe3, 0x0b, 0x39, 0x3d, 0xbe, 0x30, 0xa7, 0xc7, 0x67, 0x02, 0x59, + 0xcc, 0x14, 0x0d, 0x07, 0x09, 0x22, 0x26, 0xbb, 0x1d, 0xbf, 0xd5, 0x48, 0x5e, 0x4a, 0x46, 0xb2, + 0x15, 0xc0, 0xfa, 0xec, 0xb9, 0xe6, 0x77, 0x1d, 0xbf, 0xe2, 0x43, 0xde, 0xd2, 0xf2, 0xa5, 0x85, + 0xc2, 0x54, 0x94, 0xf5, 0x1b, 0xa3, 0x7c, 0x17, 0x6a, 0x0f, 0xe5, 0x13, 0x65, 0x9a, 0x72, 0x15, + 0xf4, 0x51, 0xe4, 0xcb, 0x66, 0xe4, 0x9f, 0x47, 0x3f, 0x95, 0xa0, 0xac, 0x6c, 0x8e, 0x9f, 0x9c, + 0x92, 0x6f, 0xa6, 0xa7, 0xa4, 0x8c, 0x34, 0xb1, 0xae, 0x49, 0x83, 0x8c, 0xb2, 0xb9, 0x77, 0xad, + 0x8d, 0xc8, 0xb0, 0xb5, 0xfb, 0xed, 0x6f, 0x7f, 0xff, 0x50, 0xd8, 0x22, 0xb5, 0xce, 0xcc, 0x5b, + 0xb9, 0xd3, 0xe7, 0x3c, 0x57, 0xb0, 0x91, 0xd7, 0x4d, 0x24, 0xc1, 0xbe, 0xa6, 0xd7, 0xcc, 0xcd, + 0xcc, 0x5d, 0xfe, 0x88, 0xbf, 0x85, 0xad, 0x7d, 0xe4, 0x6c, 0x9a, 0x66, 0x86, 0x33, 0x19, 0xa0, + 0x1f, 0x6a, 0x07, 0xc4, 0x85, 0xea, 0x74, 0xa7, 0x93, 0xdd, 0xfc, 0x09, 0x70, 0x13, 0x5f, 0x1d, + 0xf9, 0x6a, 0xd6, 0xea, 0x2c, 0x1f, 0x67, 0x79, 0x0e, 0xd5, 0x67, 0xf8, 0xa8, 0x49, 0x58, 0x32, + 0x99, 0xbc, 0x09, 0xd8, 0xcc, 0x05, 0x76, 0xa0, 0x3a, 0x7d, 0x03, 0x4f, 0x8e, 0x9f, 0x7b, 0x33, + 0xcf, 0x65, 0x31, 0x90, 0x85, 0x1c, 0x64, 0x58, 0xc8, 0x33, 0x28, 0xa7, 0xae, 0x62, 0x92, 0x0c, + 0xc8, 0xec, 0xfd, 0x6c, 0x66, 0x9c, 0x52, 0xb0, 0x24, 0x0b, 0xeb, 0xc2, 0xfa, 0x63, 0xca, 0x6c, + 0xea, 0xf3, 0xa7, 0x9e, 0xb2, 0x8f, 0x73, 0xe2, 0xb2, 0x9d, 0x57, 0x61, 0x58, 0xd9, 0x56, 0x0b, + 0xd1, 0x4d, 0x62, 0xe4, 0xe4, 0x18, 0x71, 0xc9, 0x39, 0xac, 0xce, 0x36, 0x45, 0x0e, 0xc5, 0x24, + 0x66, 0x79, 0x0d, 0x64, 0xdd, 0x41, 0x9a, 0x3a, 0xd9, 0xce, 0xd0, 0xa8, 0xdf, 0x04, 0x84, 0x42, + 0x25, 0x7d, 0x3c, 0x52, 0xcf, 0x3f, 0xb4, 0x08, 0xd3, 0x35, 0x1e, 0xcd, 0xef, 0x14, 0xdf, 0x8b, + 0x19, 0x19, 0x40, 0x75, 0x7a, 0xa8, 0x4c, 0xd2, 0x9d, 0x3b, 0x04, 0xcd, 0xfa, 0xbc, 0x65, 0x4e, + 0xd6, 0x44, 0xb2, 0x6d, 0xb2, 0x95, 0x21, 0x8b, 0xd1, 0xfa, 0xe8, 0x0f, 0x1d, 0x40, 0x3e, 0xd8, + 0xf8, 0x98, 0x08, 0xc4, 0x98, 0x98, 0x79, 0xc2, 0xbd, 0xb7, 0xaf, 0xd7, 0x65, 0x0f, 0x19, 0xc8, + 0xd7, 0xb0, 0x99, 0xff, 0x6c, 0x24, 0xfb, 0x0a, 0xf6, 0xda, 0x67, 0xe5, 0xdc, 0x6a, 0xdf, 0x43, + 0xea, 0x5d, 0x73, 0x2e, 0x35, 0xef, 0xad, 0x50, 0xbd, 0x6e, 0x67, 0xc9, 0xdf, 0xb3, 0xc5, 0xa4, + 0xbf, 0x07, 0xf3, 0xfd, 0xf5, 0x61, 0xe3, 0xc4, 0xa7, 0x4e, 0xc6, 0xdb, 0x39, 0x88, 0x73, 0x99, + 0xfe, 0x85, 0x4c, 0x8d, 0x83, 0x9d, 0x79, 0x4c, 0x1d, 0xc7, 0xf7, 0x1f, 0xfc, 0xff, 0xd7, 0x37, + 0x0d, 0xed, 0xf5, 0x9b, 0x86, 0xf6, 0xd7, 0x9b, 0x86, 0xf6, 0xea, 0x6d, 0xe3, 0xd6, 0xeb, 0xb7, + 0x8d, 0x5b, 0xbf, 0xbf, 0x6d, 0xdc, 0x02, 0xf9, 0xdf, 0xc5, 0x13, 0xed, 0xc5, 0xda, 0x20, 0x88, + 0xa8, 0x1b, 0x74, 0x25, 0xd0, 0xfd, 0x8b, 0x7b, 0x2f, 0x17, 0x91, 0xec, 0x7f, 0xff, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x89, 0xa4, 0x10, 0x26, 0xf8, 0x10, 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 + +// DocumentAPIClient is the client API for DocumentAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type DocumentAPIClient interface { + ListDocumentForHome(ctx context.Context, in *ListDocumentForHomeRequest, opts ...grpc.CallOption) (*ListDocumentForHomeResponse, error) + SetDocumentRecommend(ctx context.Context, in *SetDocumentRecommendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) + GetRelatedDocuments(ctx context.Context, in *Document, opts ...grpc.CallOption) (*ListDocumentReply, error) + DownloadDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*DownloadDocumentReply, error) + ListDocument(ctx context.Context, in *ListDocumentRequest, opts ...grpc.CallOption) (*ListDocumentReply, error) + SearchDocument(ctx context.Context, in *SearchDocumentRequest, opts ...grpc.CallOption) (*SearchDocumentReply, error) +} + +type documentAPIClient struct { + cc *grpc.ClientConn +} + +func NewDocumentAPIClient(cc *grpc.ClientConn) DocumentAPIClient { + return &documentAPIClient{cc} +} + +func (c *documentAPIClient) ListDocumentForHome(ctx context.Context, in *ListDocumentForHomeRequest, opts ...grpc.CallOption) (*ListDocumentForHomeResponse, error) { + out := new(ListDocumentForHomeResponse) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/ListDocumentForHome", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) SetDocumentRecommend(ctx context.Context, in *SetDocumentRecommendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/SetDocumentRecommend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/CreateDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) UpdateDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/UpdateDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/DeleteDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/GetDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) GetRelatedDocuments(ctx context.Context, in *Document, opts ...grpc.CallOption) (*ListDocumentReply, error) { + out := new(ListDocumentReply) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/GetRelatedDocuments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) DownloadDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*DownloadDocumentReply, error) { + out := new(DownloadDocumentReply) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/DownloadDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) ListDocument(ctx context.Context, in *ListDocumentRequest, opts ...grpc.CallOption) (*ListDocumentReply, error) { + out := new(ListDocumentReply) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/ListDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentAPIClient) SearchDocument(ctx context.Context, in *SearchDocumentRequest, opts ...grpc.CallOption) (*SearchDocumentReply, error) { + out := new(SearchDocumentReply) + err := c.cc.Invoke(ctx, "/api.v1.DocumentAPI/SearchDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DocumentAPIServer is the server API for DocumentAPI service. +type DocumentAPIServer interface { + ListDocumentForHome(context.Context, *ListDocumentForHomeRequest) (*ListDocumentForHomeResponse, error) + SetDocumentRecommend(context.Context, *SetDocumentRecommendRequest) (*emptypb.Empty, error) + CreateDocument(context.Context, *CreateDocumentRequest) (*emptypb.Empty, error) + UpdateDocument(context.Context, *Document) (*emptypb.Empty, error) + DeleteDocument(context.Context, *DeleteDocumentRequest) (*emptypb.Empty, error) + GetDocument(context.Context, *GetDocumentRequest) (*Document, error) + GetRelatedDocuments(context.Context, *Document) (*ListDocumentReply, error) + DownloadDocument(context.Context, *Document) (*DownloadDocumentReply, error) + ListDocument(context.Context, *ListDocumentRequest) (*ListDocumentReply, error) + SearchDocument(context.Context, *SearchDocumentRequest) (*SearchDocumentReply, error) +} + +// UnimplementedDocumentAPIServer can be embedded to have forward compatible implementations. +type UnimplementedDocumentAPIServer struct { +} + +func (*UnimplementedDocumentAPIServer) ListDocumentForHome(ctx context.Context, req *ListDocumentForHomeRequest) (*ListDocumentForHomeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocumentForHome not implemented") +} +func (*UnimplementedDocumentAPIServer) SetDocumentRecommend(ctx context.Context, req *SetDocumentRecommendRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetDocumentRecommend not implemented") +} +func (*UnimplementedDocumentAPIServer) CreateDocument(ctx context.Context, req *CreateDocumentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) UpdateDocument(ctx context.Context, req *Document) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) DeleteDocument(ctx context.Context, req *DeleteDocumentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) GetDocument(ctx context.Context, req *GetDocumentRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) GetRelatedDocuments(ctx context.Context, req *Document) (*ListDocumentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRelatedDocuments not implemented") +} +func (*UnimplementedDocumentAPIServer) DownloadDocument(ctx context.Context, req *Document) (*DownloadDocumentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method DownloadDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) ListDocument(ctx context.Context, req *ListDocumentRequest) (*ListDocumentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocument not implemented") +} +func (*UnimplementedDocumentAPIServer) SearchDocument(ctx context.Context, req *SearchDocumentRequest) (*SearchDocumentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchDocument not implemented") +} + +func RegisterDocumentAPIServer(s *grpc.Server, srv DocumentAPIServer) { + s.RegisterService(&_DocumentAPI_serviceDesc, srv) +} + +func _DocumentAPI_ListDocumentForHome_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentForHomeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).ListDocumentForHome(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/ListDocumentForHome", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).ListDocumentForHome(ctx, req.(*ListDocumentForHomeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_SetDocumentRecommend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetDocumentRecommendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).SetDocumentRecommend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/SetDocumentRecommend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).SetDocumentRecommend(ctx, req.(*SetDocumentRecommendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_CreateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).CreateDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/CreateDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).CreateDocument(ctx, req.(*CreateDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_UpdateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Document) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).UpdateDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/UpdateDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).UpdateDocument(ctx, req.(*Document)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_DeleteDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).DeleteDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/DeleteDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).DeleteDocument(ctx, req.(*DeleteDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_GetDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).GetDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/GetDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).GetDocument(ctx, req.(*GetDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_GetRelatedDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Document) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).GetRelatedDocuments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/GetRelatedDocuments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).GetRelatedDocuments(ctx, req.(*Document)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_DownloadDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Document) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).DownloadDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/DownloadDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).DownloadDocument(ctx, req.(*Document)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_ListDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).ListDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/ListDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).ListDocument(ctx, req.(*ListDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DocumentAPI_SearchDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentAPIServer).SearchDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.DocumentAPI/SearchDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentAPIServer).SearchDocument(ctx, req.(*SearchDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DocumentAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.DocumentAPI", + HandlerType: (*DocumentAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDocumentForHome", + Handler: _DocumentAPI_ListDocumentForHome_Handler, + }, + { + MethodName: "SetDocumentRecommend", + Handler: _DocumentAPI_SetDocumentRecommend_Handler, + }, + { + MethodName: "CreateDocument", + Handler: _DocumentAPI_CreateDocument_Handler, + }, + { + MethodName: "UpdateDocument", + Handler: _DocumentAPI_UpdateDocument_Handler, + }, + { + MethodName: "DeleteDocument", + Handler: _DocumentAPI_DeleteDocument_Handler, + }, + { + MethodName: "GetDocument", + Handler: _DocumentAPI_GetDocument_Handler, + }, + { + MethodName: "GetRelatedDocuments", + Handler: _DocumentAPI_GetRelatedDocuments_Handler, + }, + { + MethodName: "DownloadDocument", + Handler: _DocumentAPI_DownloadDocument_Handler, + }, + { + MethodName: "ListDocument", + Handler: _DocumentAPI_ListDocument_Handler, + }, + { + MethodName: "SearchDocument", + Handler: _DocumentAPI_SearchDocument_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/document.proto", +} + +// RecycleAPIClient is the client API for RecycleAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RecycleAPIClient interface { + // 文档回收站列表 + ListRecycleDocument(ctx context.Context, in *ListDocumentRequest, opts ...grpc.CallOption) (*ListDocumentReply, error) + // 恢复回收站文档,支持恢复单个文档或者是批量恢复 + RecoverRecycleDocument(ctx context.Context, in *RecoverRecycleDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除回收站文档 + DeleteRecycleDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 清空回收站文档 + ClearRecycleDocument(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type recycleAPIClient struct { + cc *grpc.ClientConn +} + +func NewRecycleAPIClient(cc *grpc.ClientConn) RecycleAPIClient { + return &recycleAPIClient{cc} +} + +func (c *recycleAPIClient) ListRecycleDocument(ctx context.Context, in *ListDocumentRequest, opts ...grpc.CallOption) (*ListDocumentReply, error) { + out := new(ListDocumentReply) + err := c.cc.Invoke(ctx, "/api.v1.RecycleAPI/ListRecycleDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *recycleAPIClient) RecoverRecycleDocument(ctx context.Context, in *RecoverRecycleDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.RecycleAPI/RecoverRecycleDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *recycleAPIClient) DeleteRecycleDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.RecycleAPI/DeleteRecycleDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *recycleAPIClient) ClearRecycleDocument(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.RecycleAPI/ClearRecycleDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RecycleAPIServer is the server API for RecycleAPI service. +type RecycleAPIServer interface { + // 文档回收站列表 + ListRecycleDocument(context.Context, *ListDocumentRequest) (*ListDocumentReply, error) + // 恢复回收站文档,支持恢复单个文档或者是批量恢复 + RecoverRecycleDocument(context.Context, *RecoverRecycleDocumentRequest) (*emptypb.Empty, error) + // 删除回收站文档 + DeleteRecycleDocument(context.Context, *DeleteDocumentRequest) (*emptypb.Empty, error) + // 清空回收站文档 + ClearRecycleDocument(context.Context, *emptypb.Empty) (*emptypb.Empty, error) +} + +// UnimplementedRecycleAPIServer can be embedded to have forward compatible implementations. +type UnimplementedRecycleAPIServer struct { +} + +func (*UnimplementedRecycleAPIServer) ListRecycleDocument(ctx context.Context, req *ListDocumentRequest) (*ListDocumentReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRecycleDocument not implemented") +} +func (*UnimplementedRecycleAPIServer) RecoverRecycleDocument(ctx context.Context, req *RecoverRecycleDocumentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecoverRecycleDocument not implemented") +} +func (*UnimplementedRecycleAPIServer) DeleteRecycleDocument(ctx context.Context, req *DeleteDocumentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRecycleDocument not implemented") +} +func (*UnimplementedRecycleAPIServer) ClearRecycleDocument(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearRecycleDocument not implemented") +} + +func RegisterRecycleAPIServer(s *grpc.Server, srv RecycleAPIServer) { + s.RegisterService(&_RecycleAPI_serviceDesc, srv) +} + +func _RecycleAPI_ListRecycleDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RecycleAPIServer).ListRecycleDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.RecycleAPI/ListRecycleDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RecycleAPIServer).ListRecycleDocument(ctx, req.(*ListDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RecycleAPI_RecoverRecycleDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecoverRecycleDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RecycleAPIServer).RecoverRecycleDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.RecycleAPI/RecoverRecycleDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RecycleAPIServer).RecoverRecycleDocument(ctx, req.(*RecoverRecycleDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RecycleAPI_DeleteRecycleDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RecycleAPIServer).DeleteRecycleDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.RecycleAPI/DeleteRecycleDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RecycleAPIServer).DeleteRecycleDocument(ctx, req.(*DeleteDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RecycleAPI_ClearRecycleDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RecycleAPIServer).ClearRecycleDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.RecycleAPI/ClearRecycleDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RecycleAPIServer).ClearRecycleDocument(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _RecycleAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.RecycleAPI", + HandlerType: (*RecycleAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRecycleDocument", + Handler: _RecycleAPI_ListRecycleDocument_Handler, + }, + { + MethodName: "RecoverRecycleDocument", + Handler: _RecycleAPI_RecoverRecycleDocument_Handler, + }, + { + MethodName: "DeleteRecycleDocument", + Handler: _RecycleAPI_DeleteRecycleDocument_Handler, + }, + { + MethodName: "ClearRecycleDocument", + Handler: _RecycleAPI_ClearRecycleDocument_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/document.proto", +} + +func (m *Document) 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 *Document) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EnableGzip { + i-- + if m.EnableGzip { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x80 + } + if m.User != nil { + { + size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + if m.Attachment != nil { + { + size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if m.RecommendAt != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.RecommendAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.RecommendAt):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintDocument(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + if len(m.Ext) > 0 { + i -= len(m.Ext) + copy(dAtA[i:], m.Ext) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Ext))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 + } + if len(m.DeletedUsername) > 0 { + i -= len(m.DeletedUsername) + copy(dAtA[i:], m.DeletedUsername) + i = encodeVarintDocument(dAtA, i, uint64(len(m.DeletedUsername))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + if len(m.CategoryId) > 0 { + dAtA5 := make([]byte, len(m.CategoryId)*10) + var j4 int + for _, num1 := range m.CategoryId { + num := uint64(num1) + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintDocument(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + if m.DeletedUserId != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.DeletedUserId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc0 + } + if m.DeletedAt != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.DeletedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.DeletedAt):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintDocument(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.UpdatedAt != nil { + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintDocument(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.CreatedAt != nil { + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintDocument(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.Status != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.Size_ != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.Price != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Price)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ScoreCount != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.ScoreCount)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.Score != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Score)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.CommentCount != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.CommentCount)) + i-- + dAtA[i] = 0x78 + } + if m.FavoriteCount != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.FavoriteCount)) + i-- + dAtA[i] = 0x70 + } + if m.ViewCount != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.ViewCount)) + i-- + dAtA[i] = 0x68 + } + if m.DownloadCount != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.DownloadCount)) + i-- + dAtA[i] = 0x60 + } + if len(m.Uuid) > 0 { + i -= len(m.Uuid) + copy(dAtA[i:], m.Uuid) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Uuid))) + i-- + dAtA[i] = 0x5a + } + if m.Pages != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Pages)) + i-- + dAtA[i] = 0x50 + } + if m.Preview != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Preview)) + i-- + dAtA[i] = 0x48 + } + if m.Height != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x40 + } + if m.Width != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Width)) + i-- + dAtA[i] = 0x38 + } + if len(m.Cover) > 0 { + i -= len(m.Cover) + copy(dAtA[i:], m.Cover) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Cover))) + i-- + dAtA[i] = 0x32 + } + if m.UserId != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x28 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Keywords) > 0 { + i -= len(m.Keywords) + copy(dAtA[i:], m.Keywords) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Keywords))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteDocumentRequest) 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 *DeleteDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA10 := make([]byte, len(m.Id)*10) + var j9 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j9++ + } + dAtA10[j9] = uint8(num) + j9++ + } + i -= j9 + copy(dAtA[i:], dAtA10[:j9]) + i = encodeVarintDocument(dAtA, i, uint64(j9)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RecoverRecycleDocumentRequest) 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 *RecoverRecycleDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecoverRecycleDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA12 := make([]byte, len(m.Id)*10) + var j11 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j11++ + } + dAtA12[j11] = uint8(num) + j11++ + } + i -= j11 + copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintDocument(dAtA, i, uint64(j11)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetDocumentRequest) 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 *GetDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.WithAuthor { + i-- + if m.WithAuthor { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentRequest) 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 *ListDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x50 + } + if len(m.IsRecommend) > 0 { + for iNdEx := len(m.IsRecommend) - 1; iNdEx >= 0; iNdEx-- { + i-- + if m.IsRecommend[iNdEx] { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + } + i = encodeVarintDocument(dAtA, i, uint64(len(m.IsRecommend))) + i-- + dAtA[i] = 0x4a + } + if len(m.Status) > 0 { + dAtA14 := make([]byte, len(m.Status)*10) + var j13 int + for _, num1 := range m.Status { + num := uint64(num1) + for num >= 1<<7 { + dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j13++ + } + dAtA14[j13] = uint8(num) + j13++ + } + i -= j13 + copy(dAtA[i:], dAtA14[:j13]) + i = encodeVarintDocument(dAtA, i, uint64(j13)) + i-- + dAtA[i] = 0x42 + } + if len(m.UserId) > 0 { + dAtA16 := make([]byte, len(m.UserId)*10) + var j15 int + for _, num1 := range m.UserId { + num := uint64(num1) + for num >= 1<<7 { + dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j15++ + } + dAtA16[j15] = uint8(num) + j15++ + } + i -= j15 + copy(dAtA[i:], dAtA16[:j15]) + i = encodeVarintDocument(dAtA, i, uint64(j15)) + i-- + dAtA[i] = 0x3a + } + if len(m.CategoryId) > 0 { + dAtA18 := make([]byte, len(m.CategoryId)*10) + var j17 int + for _, num1 := range m.CategoryId { + num := uint64(num1) + for num >= 1<<7 { + dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j17++ + } + dAtA18[j17] = uint8(num) + j17++ + } + i -= j17 + copy(dAtA[i:], dAtA18[:j17]) + i = encodeVarintDocument(dAtA, i, uint64(j17)) + i-- + dAtA[i] = 0x32 + } + if len(m.Order) > 0 { + i -= len(m.Order) + copy(dAtA[i:], m.Order) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Order))) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintDocument(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentReply) 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 *ListDocumentReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Document) > 0 { + for iNdEx := len(m.Document) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Document[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CreateDocumentItem) 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 *CreateDocumentItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateDocumentItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Price != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Price)) + i-- + dAtA[i] = 0x18 + } + if m.AttachmentId != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.AttachmentId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateDocumentRequest) 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 *CreateDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Document) > 0 { + for iNdEx := len(m.Document) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Document[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.CategoryId) > 0 { + dAtA20 := make([]byte, len(m.CategoryId)*10) + var j19 int + for _, num1 := range m.CategoryId { + num := uint64(num1) + for num >= 1<<7 { + dAtA20[j19] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j19++ + } + dAtA20[j19] = uint8(num) + j19++ + } + i -= j19 + copy(dAtA[i:], dAtA20[:j19]) + i = encodeVarintDocument(dAtA, i, uint64(j19)) + i-- + dAtA[i] = 0x12 + } + if m.Overwrite { + i-- + if m.Overwrite { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SetDocumentRecommendRequest) 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 *SetDocumentRecommendRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetDocumentRecommendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Type != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + dAtA22 := make([]byte, len(m.Id)*10) + var j21 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j21++ + } + dAtA22[j21] = uint8(num) + j21++ + } + i -= j21 + copy(dAtA[i:], dAtA22[:j21]) + i = encodeVarintDocument(dAtA, i, uint64(j21)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentForHomeRequest) 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 *ListDocumentForHomeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentForHomeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentForHomeItem) 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 *ListDocumentForHomeItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentForHomeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Document) > 0 { + for iNdEx := len(m.Document) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Document[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.CategoryName) > 0 { + i -= len(m.CategoryName) + copy(dAtA[i:], m.CategoryName) + i = encodeVarintDocument(dAtA, i, uint64(len(m.CategoryName))) + i-- + dAtA[i] = 0x1a + } + if len(m.CategoryCover) > 0 { + i -= len(m.CategoryCover) + copy(dAtA[i:], m.CategoryCover) + i = encodeVarintDocument(dAtA, i, uint64(len(m.CategoryCover))) + i-- + dAtA[i] = 0x12 + } + if m.CategoryId != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.CategoryId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentForHomeResponse) 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 *ListDocumentForHomeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentForHomeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Document) > 0 { + for iNdEx := len(m.Document) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Document[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SearchDocumentRequest) 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 *SearchDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SearchDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ext) > 0 { + i -= len(m.Ext) + copy(dAtA[i:], m.Ext) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Ext))) + i-- + dAtA[i] = 0x3a + } + if len(m.Sort) > 0 { + i -= len(m.Sort) + copy(dAtA[i:], m.Sort) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Sort))) + i-- + dAtA[i] = 0x2a + } + if len(m.CategoryId) > 0 { + dAtA24 := make([]byte, len(m.CategoryId)*10) + var j23 int + for _, num1 := range m.CategoryId { + num := uint64(num1) + for num >= 1<<7 { + dAtA24[j23] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j23++ + } + dAtA24[j23] = uint8(num) + j23++ + } + i -= j23 + copy(dAtA[i:], dAtA24[:j23]) + i = encodeVarintDocument(dAtA, i, uint64(j23)) + i-- + dAtA[i] = 0x22 + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SearchDocumentReply) 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 *SearchDocumentReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SearchDocumentReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Document) > 0 { + for iNdEx := len(m.Document) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Document[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDocument(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Spend) > 0 { + i -= len(m.Spend) + copy(dAtA[i:], m.Spend) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Spend))) + i-- + dAtA[i] = 0x12 + } + if m.Total != 0 { + i = encodeVarintDocument(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DownloadDocumentReply) 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 *DownloadDocumentReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DownloadDocumentReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDocument(dAtA []byte, offset int, v uint64) int { + offset -= sovDocument(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Document) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovDocument(uint64(m.Id)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Keywords) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if m.UserId != 0 { + n += 1 + sovDocument(uint64(m.UserId)) + } + l = len(m.Cover) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if m.Width != 0 { + n += 1 + sovDocument(uint64(m.Width)) + } + if m.Height != 0 { + n += 1 + sovDocument(uint64(m.Height)) + } + if m.Preview != 0 { + n += 1 + sovDocument(uint64(m.Preview)) + } + if m.Pages != 0 { + n += 1 + sovDocument(uint64(m.Pages)) + } + l = len(m.Uuid) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if m.DownloadCount != 0 { + n += 1 + sovDocument(uint64(m.DownloadCount)) + } + if m.ViewCount != 0 { + n += 1 + sovDocument(uint64(m.ViewCount)) + } + if m.FavoriteCount != 0 { + n += 1 + sovDocument(uint64(m.FavoriteCount)) + } + if m.CommentCount != 0 { + n += 1 + sovDocument(uint64(m.CommentCount)) + } + if m.Score != 0 { + n += 2 + sovDocument(uint64(m.Score)) + } + if m.ScoreCount != 0 { + n += 2 + sovDocument(uint64(m.ScoreCount)) + } + if m.Price != 0 { + n += 2 + sovDocument(uint64(m.Price)) + } + if m.Size_ != 0 { + n += 2 + sovDocument(uint64(m.Size_)) + } + if m.Status != 0 { + n += 2 + sovDocument(uint64(m.Status)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 2 + l + sovDocument(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 2 + l + sovDocument(uint64(l)) + } + if m.DeletedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.DeletedAt) + n += 2 + l + sovDocument(uint64(l)) + } + if m.DeletedUserId != 0 { + n += 2 + sovDocument(uint64(m.DeletedUserId)) + } + l = len(m.Username) + if l > 0 { + n += 2 + l + sovDocument(uint64(l)) + } + if len(m.CategoryId) > 0 { + l = 0 + for _, e := range m.CategoryId { + l += sovDocument(uint64(e)) + } + n += 2 + sovDocument(uint64(l)) + l + } + l = len(m.DeletedUsername) + if l > 0 { + n += 2 + l + sovDocument(uint64(l)) + } + l = len(m.Ext) + if l > 0 { + n += 2 + l + sovDocument(uint64(l)) + } + if m.RecommendAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.RecommendAt) + n += 2 + l + sovDocument(uint64(l)) + } + if m.Attachment != nil { + l = m.Attachment.Size() + n += 2 + l + sovDocument(uint64(l)) + } + if m.User != nil { + l = m.User.Size() + n += 2 + l + sovDocument(uint64(l)) + } + if m.EnableGzip { + n += 3 + } + return n +} + +func (m *DeleteDocumentRequest) 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 += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + return n +} + +func (m *RecoverRecycleDocumentRequest) 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 += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + return n +} + +func (m *GetDocumentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovDocument(uint64(m.Id)) + } + if m.WithAuthor { + n += 2 + } + return n +} + +func (m *ListDocumentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovDocument(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovDocument(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovDocument(uint64(l)) + } + } + l = len(m.Order) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if len(m.CategoryId) > 0 { + l = 0 + for _, e := range m.CategoryId { + l += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + if len(m.UserId) > 0 { + l = 0 + for _, e := range m.UserId { + l += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + if len(m.Status) > 0 { + l = 0 + for _, e := range m.Status { + l += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + if len(m.IsRecommend) > 0 { + n += 1 + sovDocument(uint64(len(m.IsRecommend))) + len(m.IsRecommend)*1 + } + if m.Limit != 0 { + n += 1 + sovDocument(uint64(m.Limit)) + } + return n +} + +func (m *ListDocumentReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovDocument(uint64(m.Total)) + } + if len(m.Document) > 0 { + for _, e := range m.Document { + l = e.Size() + n += 1 + l + sovDocument(uint64(l)) + } + } + return n +} + +func (m *CreateDocumentItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if m.AttachmentId != 0 { + n += 1 + sovDocument(uint64(m.AttachmentId)) + } + if m.Price != 0 { + n += 1 + sovDocument(uint64(m.Price)) + } + return n +} + +func (m *CreateDocumentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Overwrite { + n += 2 + } + if len(m.CategoryId) > 0 { + l = 0 + for _, e := range m.CategoryId { + l += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + if len(m.Document) > 0 { + for _, e := range m.Document { + l = e.Size() + n += 1 + l + sovDocument(uint64(l)) + } + } + return n +} + +func (m *SetDocumentRecommendRequest) 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 += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + if m.Type != 0 { + n += 1 + sovDocument(uint64(m.Type)) + } + return n +} + +func (m *ListDocumentForHomeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Limit != 0 { + n += 1 + sovDocument(uint64(m.Limit)) + } + return n +} + +func (m *ListDocumentForHomeItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CategoryId != 0 { + n += 1 + sovDocument(uint64(m.CategoryId)) + } + l = len(m.CategoryCover) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.CategoryName) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if len(m.Document) > 0 { + for _, e := range m.Document { + l = e.Size() + n += 1 + l + sovDocument(uint64(l)) + } + } + return n +} + +func (m *ListDocumentForHomeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Document) > 0 { + for _, e := range m.Document { + l = e.Size() + n += 1 + l + sovDocument(uint64(l)) + } + } + return n +} + +func (m *SearchDocumentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovDocument(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovDocument(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if len(m.CategoryId) > 0 { + l = 0 + for _, e := range m.CategoryId { + l += sovDocument(uint64(e)) + } + n += 1 + sovDocument(uint64(l)) + l + } + l = len(m.Sort) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Ext) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + return n +} + +func (m *SearchDocumentReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovDocument(uint64(m.Total)) + } + l = len(m.Spend) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if len(m.Document) > 0 { + for _, e := range m.Document { + l = e.Size() + n += 1 + l + sovDocument(uint64(l)) + } + } + return n +} + +func (m *DownloadDocumentReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + return n +} + +func sovDocument(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDocument(x uint64) (n int) { + return sovDocument(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Document) 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 ErrIntOverflowDocument + } + 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: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Document: 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keywords", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keywords = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cover = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) + } + m.Width = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Width |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Preview", wireType) + } + m.Preview = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Preview |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pages", wireType) + } + m.Pages = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pages |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadCount", wireType) + } + m.DownloadCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DownloadCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ViewCount", wireType) + } + m.ViewCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ViewCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FavoriteCount", wireType) + } + m.FavoriteCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FavoriteCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommentCount", wireType) + } + m.CommentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommentCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType) + } + m.Score = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Score |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ScoreCount", wireType) + } + m.ScoreCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ScoreCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + m.Price = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Price |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 21: + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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 22: + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeletedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeletedAt == nil { + m.DeletedAt = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.DeletedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeletedUserId", wireType) + } + m.DeletedUserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DeletedUserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.CategoryId) == 0 { + m.CategoryId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryId", wireType) + } + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeletedUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeletedUsername = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecommendAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RecommendAt == nil { + m.RecommendAt = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.RecommendAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attachment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attachment == nil { + m.Attachment = &Attachment{} + } + if err := m.Attachment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableGzip", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableGzip = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteDocumentRequest) 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 ErrIntOverflowDocument + } + 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: DeleteDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteDocumentRequest: 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 ErrIntOverflowDocument + } + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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 ErrIntOverflowDocument + } + 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 := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RecoverRecycleDocumentRequest) 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 ErrIntOverflowDocument + } + 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: RecoverRecycleDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecoverRecycleDocumentRequest: 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 ErrIntOverflowDocument + } + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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 ErrIntOverflowDocument + } + 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 := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetDocumentRequest) 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 ErrIntOverflowDocument + } + 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: GetDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetDocumentRequest: 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithAuthor", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithAuthor = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentRequest) 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 ErrIntOverflowDocument + } + 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: ListDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentRequest: 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 ErrIntOverflowDocument + } + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Order = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.CategoryId) == 0 { + m.CategoryId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryId", wireType) + } + case 7: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserId = append(m.UserId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.UserId) == 0 { + m.UserId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserId = append(m.UserId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + case 8: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.Status) == 0 { + m.Status = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + case 9: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsRecommend = append(m.IsRecommend, bool(v != 0)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen + if elementCount != 0 && len(m.IsRecommend) == 0 { + m.IsRecommend = make([]bool, 0, elementCount) + } + for iNdEx < postIndex { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsRecommend = append(m.IsRecommend, bool(v != 0)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field IsRecommend", wireType) + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentReply) 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 ErrIntOverflowDocument + } + 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: ListDocumentReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentReply: 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 ErrIntOverflowDocument + } + 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 Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = append(m.Document, &Document{}) + if err := m.Document[len(m.Document)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateDocumentItem) 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 ErrIntOverflowDocument + } + 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: CreateDocumentItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateDocumentItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AttachmentId", wireType) + } + m.AttachmentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AttachmentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + m.Price = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Price |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateDocumentRequest) 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 ErrIntOverflowDocument + } + 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: CreateDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Overwrite", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Overwrite = bool(v != 0) + case 2: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.CategoryId) == 0 { + m.CategoryId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryId", wireType) + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = append(m.Document, &CreateDocumentItem{}) + if err := m.Document[len(m.Document)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SetDocumentRecommendRequest) 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 ErrIntOverflowDocument + } + 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: SetDocumentRecommendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetDocumentRecommendRequest: 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 ErrIntOverflowDocument + } + 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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 ErrIntOverflowDocument + } + 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) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentForHomeRequest) 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 ErrIntOverflowDocument + } + 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: ListDocumentForHomeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentForHomeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentForHomeItem) 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 ErrIntOverflowDocument + } + 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: ListDocumentForHomeItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentForHomeItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryId", wireType) + } + m.CategoryId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CategoryId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryCover", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CategoryCover = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CategoryName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = append(m.Document, &Document{}) + if err := m.Document[len(m.Document)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentForHomeResponse) 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 ErrIntOverflowDocument + } + 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: ListDocumentForHomeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentForHomeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = append(m.Document, &ListDocumentForHomeItem{}) + if err := m.Document[len(m.Document)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchDocumentRequest) 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 ErrIntOverflowDocument + } + 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: SearchDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchDocumentRequest: 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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Page |= int32(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 ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + 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.CategoryId) == 0 { + m.CategoryId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CategoryId = append(m.CategoryId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CategoryId", wireType) + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchDocumentReply) 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 ErrIntOverflowDocument + } + 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: SearchDocumentReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchDocumentReply: 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 ErrIntOverflowDocument + } + 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 Spend", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Spend = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDocument + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = append(m.Document, &Document{}) + if err := m.Document[len(m.Document)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DownloadDocumentReply) 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 ErrIntOverflowDocument + } + 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: DownloadDocumentReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DownloadDocumentReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDocument(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, ErrIntOverflowDocument + } + 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, ErrIntOverflowDocument + } + 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, ErrIntOverflowDocument + } + 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, ErrInvalidLengthDocument + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDocument + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDocument + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDocument = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDocument = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDocument = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/document.pb.gw.go b/api/v1/document.pb.gw.go new file mode 100644 index 0000000..863c7c4 --- /dev/null +++ b/api/v1/document.pb.gw.go @@ -0,0 +1,1279 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/document.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_DocumentAPI_ListDocumentForHome_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_ListDocumentForHome_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentForHomeRequest + 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_DocumentAPI_ListDocumentForHome_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListDocumentForHome(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_ListDocumentForHome_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentForHomeRequest + 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_DocumentAPI_ListDocumentForHome_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListDocumentForHome(ctx, &protoReq) + return msg, metadata, err + +} + +func request_DocumentAPI_SetDocumentRecommend_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetDocumentRecommendRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SetDocumentRecommend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_SetDocumentRecommend_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetDocumentRecommendRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SetDocumentRecommend(ctx, &protoReq) + return msg, metadata, err + +} + +func request_DocumentAPI_CreateDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_CreateDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateDocument(ctx, &protoReq) + return msg, metadata, err + +} + +func request_DocumentAPI_UpdateDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_UpdateDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_DeleteDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_DeleteDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + 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_DocumentAPI_DeleteDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_DeleteDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + 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_DocumentAPI_DeleteDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_GetDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_GetDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetDocumentRequest + 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_DocumentAPI_GetDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_GetDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetDocumentRequest + 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_DocumentAPI_GetDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_GetRelatedDocuments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_GetRelatedDocuments_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + 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_DocumentAPI_GetRelatedDocuments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRelatedDocuments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_GetRelatedDocuments_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + 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_DocumentAPI_GetRelatedDocuments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRelatedDocuments(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_DownloadDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_DownloadDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + 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_DocumentAPI_DownloadDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DownloadDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_DownloadDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Document + 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_DocumentAPI_DownloadDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DownloadDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_ListDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_ListDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentRequest + 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_DocumentAPI_ListDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_ListDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentRequest + 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_DocumentAPI_ListDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_DocumentAPI_SearchDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_DocumentAPI_SearchDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DocumentAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchDocumentRequest + 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_DocumentAPI_SearchDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SearchDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DocumentAPI_SearchDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DocumentAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchDocumentRequest + 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_DocumentAPI_SearchDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SearchDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RecycleAPI_ListRecycleDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RecycleAPI_ListRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, client RecycleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentRequest + 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_RecycleAPI_ListRecycleDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRecycleDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RecycleAPI_ListRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, server RecycleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDocumentRequest + 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_RecycleAPI_ListRecycleDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRecycleDocument(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RecycleAPI_RecoverRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, client RecycleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RecoverRecycleDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RecoverRecycleDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RecycleAPI_RecoverRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, server RecycleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RecoverRecycleDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RecoverRecycleDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RecycleAPI_DeleteRecycleDocument_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RecycleAPI_DeleteRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, client RecycleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + 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_RecycleAPI_DeleteRecycleDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteRecycleDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RecycleAPI_DeleteRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, server RecycleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + 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_RecycleAPI_DeleteRecycleDocument_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteRecycleDocument(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RecycleAPI_ClearRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, client RecycleAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.ClearRecycleDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RecycleAPI_ClearRecycleDocument_0(ctx context.Context, marshaler runtime.Marshaler, server RecycleAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.ClearRecycleDocument(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterDocumentAPIHandlerServer registers the http handlers for service DocumentAPI to "mux". +// UnaryRPC :call DocumentAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDocumentAPIHandlerFromEndpoint instead. +func RegisterDocumentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DocumentAPIServer) error { + + mux.Handle("GET", pattern_DocumentAPI_ListDocumentForHome_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_ListDocumentForHome_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_ListDocumentForHome_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_DocumentAPI_SetDocumentRecommend_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_SetDocumentRecommend_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_SetDocumentRecommend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_DocumentAPI_CreateDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_CreateDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_CreateDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_DocumentAPI_UpdateDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_UpdateDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_UpdateDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_DocumentAPI_DeleteDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_DeleteDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_DeleteDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_GetDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_GetDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_GetDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_GetRelatedDocuments_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_GetRelatedDocuments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_GetRelatedDocuments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_DownloadDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_DownloadDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_DownloadDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_ListDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_ListDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_ListDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_SearchDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DocumentAPI_SearchDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_SearchDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRecycleAPIHandlerServer registers the http handlers for service RecycleAPI to "mux". +// UnaryRPC :call RecycleAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRecycleAPIHandlerFromEndpoint instead. +func RegisterRecycleAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RecycleAPIServer) error { + + mux.Handle("GET", pattern_RecycleAPI_ListRecycleDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RecycleAPI_ListRecycleDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_ListRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_RecycleAPI_RecoverRecycleDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RecycleAPI_RecoverRecycleDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_RecoverRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RecycleAPI_DeleteRecycleDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RecycleAPI_DeleteRecycleDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_DeleteRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RecycleAPI_ClearRecycleDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RecycleAPI_ClearRecycleDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_ClearRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterDocumentAPIHandlerFromEndpoint is same as RegisterDocumentAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDocumentAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDocumentAPIHandler(ctx, mux, conn) +} + +// RegisterDocumentAPIHandler registers the http handlers for service DocumentAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDocumentAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterDocumentAPIHandlerClient(ctx, mux, NewDocumentAPIClient(conn)) +} + +// RegisterDocumentAPIHandlerClient registers the http handlers for service DocumentAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DocumentAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DocumentAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DocumentAPIClient" to call the correct interceptors. +func RegisterDocumentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DocumentAPIClient) error { + + mux.Handle("GET", pattern_DocumentAPI_ListDocumentForHome_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_ListDocumentForHome_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_ListDocumentForHome_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_DocumentAPI_SetDocumentRecommend_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_SetDocumentRecommend_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_SetDocumentRecommend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_DocumentAPI_CreateDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_CreateDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_CreateDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_DocumentAPI_UpdateDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_UpdateDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_UpdateDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_DocumentAPI_DeleteDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_DeleteDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_DeleteDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_GetDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_GetDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_GetDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_GetRelatedDocuments_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_GetRelatedDocuments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_GetRelatedDocuments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_DownloadDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_DownloadDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_DownloadDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_ListDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_ListDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_ListDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_DocumentAPI_SearchDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DocumentAPI_SearchDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DocumentAPI_SearchDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DocumentAPI_ListDocumentForHome_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "home"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_SetDocumentRecommend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "recommend"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_CreateDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "document"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_UpdateDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "document"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_DeleteDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "document"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_GetDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "document"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_GetRelatedDocuments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "related"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_DownloadDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "download"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_ListDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "list"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DocumentAPI_SearchDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "search"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_DocumentAPI_ListDocumentForHome_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_SetDocumentRecommend_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_CreateDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_UpdateDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_DeleteDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_GetDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_GetRelatedDocuments_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_DownloadDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_ListDocument_0 = runtime.ForwardResponseMessage + + forward_DocumentAPI_SearchDocument_0 = runtime.ForwardResponseMessage +) + +// RegisterRecycleAPIHandlerFromEndpoint is same as RegisterRecycleAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRecycleAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRecycleAPIHandler(ctx, mux, conn) +} + +// RegisterRecycleAPIHandler registers the http handlers for service RecycleAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRecycleAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRecycleAPIHandlerClient(ctx, mux, NewRecycleAPIClient(conn)) +} + +// RegisterRecycleAPIHandlerClient registers the http handlers for service RecycleAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RecycleAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RecycleAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RecycleAPIClient" to call the correct interceptors. +func RegisterRecycleAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RecycleAPIClient) error { + + mux.Handle("GET", pattern_RecycleAPI_ListRecycleDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RecycleAPI_ListRecycleDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_ListRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_RecycleAPI_RecoverRecycleDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RecycleAPI_RecoverRecycleDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_RecoverRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RecycleAPI_DeleteRecycleDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RecycleAPI_DeleteRecycleDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_DeleteRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RecycleAPI_ClearRecycleDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RecycleAPI_ClearRecycleDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RecycleAPI_ClearRecycleDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RecycleAPI_ListRecycleDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "recycle"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RecycleAPI_RecoverRecycleDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "recycle"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RecycleAPI_DeleteRecycleDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "document", "recycle"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RecycleAPI_ClearRecycleDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "document", "recycle", "all"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_RecycleAPI_ListRecycleDocument_0 = runtime.ForwardResponseMessage + + forward_RecycleAPI_RecoverRecycleDocument_0 = runtime.ForwardResponseMessage + + forward_RecycleAPI_DeleteRecycleDocument_0 = runtime.ForwardResponseMessage + + forward_RecycleAPI_ClearRecycleDocument_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/favorite.pb.go b/api/v1/favorite.pb.go new file mode 100644 index 0000000..2e3dce7 --- /dev/null +++ b/api/v1/favorite.pb.go @@ -0,0 +1,1747 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/favorite.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 Favorite struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + DocumentId int64 `protobuf:"varint,3,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` + Ext string `protobuf:"bytes,7,opt,name=ext,proto3" json:"ext,omitempty"` + Score int32 `protobuf:"varint,8,opt,name=score,proto3" json:"score,omitempty"` + Size_ int64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"` + Pages int32 `protobuf:"varint,10,opt,name=pages,proto3" json:"pages,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Favorite) Reset() { *m = Favorite{} } +func (m *Favorite) String() string { return proto.CompactTextString(m) } +func (*Favorite) ProtoMessage() {} +func (*Favorite) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e19a182b4c8c61, []int{0} +} +func (m *Favorite) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Favorite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Favorite.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 *Favorite) XXX_Merge(src proto.Message) { + xxx_messageInfo_Favorite.Merge(m, src) +} +func (m *Favorite) XXX_Size() int { + return m.Size() +} +func (m *Favorite) XXX_DiscardUnknown() { + xxx_messageInfo_Favorite.DiscardUnknown(m) +} + +var xxx_messageInfo_Favorite proto.InternalMessageInfo + +func (m *Favorite) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Favorite) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Favorite) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func (m *Favorite) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Favorite) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + +func (m *Favorite) GetScore() int32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *Favorite) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *Favorite) GetPages() int32 { + if m != nil { + return m.Pages + } + return 0 +} + +func (m *Favorite) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Favorite) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteFavoriteRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteFavoriteRequest) Reset() { *m = DeleteFavoriteRequest{} } +func (m *DeleteFavoriteRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteFavoriteRequest) ProtoMessage() {} +func (*DeleteFavoriteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e19a182b4c8c61, []int{1} +} +func (m *DeleteFavoriteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteFavoriteRequest.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 *DeleteFavoriteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFavoriteRequest.Merge(m, src) +} +func (m *DeleteFavoriteRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteFavoriteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFavoriteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFavoriteRequest proto.InternalMessageInfo + +func (m *DeleteFavoriteRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type ListFavoriteRequest 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"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (m *ListFavoriteRequest) Reset() { *m = ListFavoriteRequest{} } +func (m *ListFavoriteRequest) String() string { return proto.CompactTextString(m) } +func (*ListFavoriteRequest) ProtoMessage() {} +func (*ListFavoriteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e19a182b4c8c61, []int{2} +} +func (m *ListFavoriteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListFavoriteRequest.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 *ListFavoriteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListFavoriteRequest.Merge(m, src) +} +func (m *ListFavoriteRequest) XXX_Size() int { + return m.Size() +} +func (m *ListFavoriteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListFavoriteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListFavoriteRequest proto.InternalMessageInfo + +func (m *ListFavoriteRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListFavoriteRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListFavoriteRequest) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +type ListFavoriteReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Favorite []*Favorite `protobuf:"bytes,2,rep,name=favorite,proto3" json:"favorite,omitempty"` +} + +func (m *ListFavoriteReply) Reset() { *m = ListFavoriteReply{} } +func (m *ListFavoriteReply) String() string { return proto.CompactTextString(m) } +func (*ListFavoriteReply) ProtoMessage() {} +func (*ListFavoriteReply) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e19a182b4c8c61, []int{3} +} +func (m *ListFavoriteReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListFavoriteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListFavoriteReply.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 *ListFavoriteReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListFavoriteReply.Merge(m, src) +} +func (m *ListFavoriteReply) XXX_Size() int { + return m.Size() +} +func (m *ListFavoriteReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListFavoriteReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListFavoriteReply proto.InternalMessageInfo + +func (m *ListFavoriteReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListFavoriteReply) GetFavorite() []*Favorite { + if m != nil { + return m.Favorite + } + return nil +} + +type GetFavoriteRequest struct { + DocumentId int64 `protobuf:"varint,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (m *GetFavoriteRequest) Reset() { *m = GetFavoriteRequest{} } +func (m *GetFavoriteRequest) String() string { return proto.CompactTextString(m) } +func (*GetFavoriteRequest) ProtoMessage() {} +func (*GetFavoriteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e19a182b4c8c61, []int{4} +} +func (m *GetFavoriteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetFavoriteRequest.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 *GetFavoriteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFavoriteRequest.Merge(m, src) +} +func (m *GetFavoriteRequest) XXX_Size() int { + return m.Size() +} +func (m *GetFavoriteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetFavoriteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFavoriteRequest proto.InternalMessageInfo + +func (m *GetFavoriteRequest) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func init() { + proto.RegisterType((*Favorite)(nil), "api.v1.Favorite") + proto.RegisterType((*DeleteFavoriteRequest)(nil), "api.v1.DeleteFavoriteRequest") + proto.RegisterType((*ListFavoriteRequest)(nil), "api.v1.ListFavoriteRequest") + proto.RegisterType((*ListFavoriteReply)(nil), "api.v1.ListFavoriteReply") + proto.RegisterType((*GetFavoriteRequest)(nil), "api.v1.GetFavoriteRequest") +} + +func init() { proto.RegisterFile("api/v1/favorite.proto", fileDescriptor_a5e19a182b4c8c61) } + +var fileDescriptor_a5e19a182b4c8c61 = []byte{ + // 576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x8f, 0xd2, 0x40, + 0x18, 0x66, 0x5a, 0x60, 0xe1, 0xc5, 0x10, 0x76, 0x5c, 0xdc, 0x5a, 0xdc, 0x42, 0x7a, 0x91, 0x6c, + 0x4c, 0x1b, 0x30, 0x7b, 0xd1, 0x83, 0x61, 0xfd, 0x0a, 0x89, 0x87, 0x95, 0xf8, 0x91, 0x78, 0xd9, + 0xcc, 0xd2, 0x59, 0x32, 0x49, 0x61, 0x6a, 0x3b, 0x10, 0xf1, 0xa6, 0xbf, 0x60, 0x13, 0xff, 0x8f, + 0x67, 0x8f, 0x9b, 0x78, 0xf1, 0xa6, 0x01, 0x7f, 0x88, 0xe9, 0x74, 0x4a, 0xd8, 0x96, 0x83, 0xb7, + 0xf7, 0xf3, 0x79, 0xe7, 0x7d, 0x9e, 0xb7, 0x85, 0x26, 0x09, 0x98, 0xbb, 0xe8, 0xb9, 0x97, 0x64, + 0xc1, 0x43, 0x26, 0xa8, 0x13, 0x84, 0x5c, 0x70, 0x5c, 0x26, 0x01, 0x73, 0x16, 0x3d, 0xb3, 0x3d, + 0xe1, 0x7c, 0xe2, 0x53, 0x57, 0x46, 0x2f, 0xe6, 0x97, 0xae, 0x60, 0x53, 0x1a, 0x09, 0x32, 0x0d, + 0x92, 0x42, 0xf3, 0x60, 0xc2, 0x27, 0x5c, 0x9a, 0x6e, 0x6c, 0xa9, 0xe8, 0x3d, 0xd5, 0x16, 0x83, + 0x93, 0xd9, 0x8c, 0x0b, 0x22, 0x18, 0x9f, 0x45, 0x2a, 0xdb, 0xca, 0x82, 0xd2, 0x69, 0x20, 0x96, + 0x49, 0xd2, 0xfe, 0xae, 0x41, 0xe5, 0x85, 0x7a, 0x0c, 0xae, 0x83, 0xc6, 0x3c, 0x03, 0x75, 0x50, + 0x57, 0x1f, 0x69, 0xcc, 0xc3, 0x87, 0xb0, 0x37, 0x8f, 0x68, 0x78, 0xce, 0x3c, 0x43, 0x93, 0xc1, + 0x72, 0xec, 0x0e, 0x3d, 0xdc, 0x86, 0x9a, 0xc7, 0xc7, 0xf3, 0x29, 0x9d, 0x89, 0x38, 0xa9, 0xcb, + 0x24, 0xa4, 0xa1, 0xa1, 0x87, 0x0f, 0xa0, 0x24, 0x98, 0xf0, 0xa9, 0x51, 0xee, 0xa0, 0x6e, 0x75, + 0x94, 0x38, 0xb8, 0x01, 0x3a, 0xfd, 0x24, 0x8c, 0x3d, 0x19, 0x8b, 0xcd, 0xb8, 0x2e, 0x1a, 0xf3, + 0x90, 0x1a, 0x95, 0x0e, 0xea, 0x96, 0x46, 0x89, 0x83, 0x31, 0x14, 0x23, 0xf6, 0x99, 0x1a, 0x55, + 0x89, 0x2b, 0xed, 0xb8, 0x32, 0x20, 0x13, 0x1a, 0x19, 0x90, 0x54, 0x4a, 0x07, 0x3f, 0x01, 0x18, + 0x87, 0x94, 0x08, 0xea, 0x9d, 0x13, 0x61, 0x14, 0x3b, 0xa8, 0x5b, 0xeb, 0x9b, 0x4e, 0xb2, 0xb0, + 0x93, 0x2e, 0xec, 0xbc, 0x49, 0x59, 0x3c, 0x2d, 0x5e, 0xfd, 0x6e, 0xa3, 0x51, 0x55, 0xf5, 0x0c, + 0x44, 0x0c, 0x30, 0x0f, 0xbc, 0x14, 0xa0, 0xf4, 0xbf, 0x00, 0xaa, 0x67, 0x20, 0xec, 0xfb, 0xd0, + 0x7c, 0x46, 0x7d, 0x2a, 0x68, 0xca, 0xe2, 0x88, 0x7e, 0x9c, 0xd3, 0x48, 0x6c, 0xc8, 0xd4, 0x13, + 0x32, 0xed, 0x77, 0x70, 0xfb, 0x15, 0x8b, 0x44, 0xb6, 0x0c, 0x43, 0x31, 0x5e, 0x45, 0xb1, 0x2e, + 0xed, 0xcd, 0xfe, 0xda, 0xd6, 0xfe, 0x5b, 0x5a, 0xe8, 0xdb, 0x5a, 0xd8, 0xef, 0x61, 0xff, 0x26, + 0x6e, 0xe0, 0x2f, 0x25, 0xff, 0x5c, 0x10, 0x5f, 0xc1, 0x26, 0x0e, 0x7e, 0x00, 0x95, 0xf4, 0xf0, + 0x0c, 0xad, 0xa3, 0x77, 0x6b, 0xfd, 0x86, 0x93, 0x5c, 0x9e, 0xb3, 0x69, 0xdf, 0x54, 0xd8, 0x27, + 0x80, 0x5f, 0xd2, 0xdc, 0x7b, 0x33, 0xd2, 0xa3, 0xac, 0xf4, 0xfd, 0x2f, 0x3a, 0xd4, 0xd2, 0xa6, + 0xc1, 0xd9, 0x10, 0xbf, 0x86, 0xfa, 0x53, 0x49, 0xf7, 0xe6, 0xcc, 0x72, 0x43, 0xcd, 0x5c, 0xc4, + 0x6e, 0x7d, 0xfd, 0xf9, 0xf7, 0x9b, 0xd6, 0xb4, 0x1b, 0x6e, 0xe6, 0x8b, 0x79, 0x84, 0x8e, 0x31, + 0x81, 0xfa, 0x4d, 0xce, 0xf1, 0x51, 0x0a, 0xb0, 0x53, 0x0b, 0xf3, 0x4e, 0x4e, 0xd1, 0xe7, 0xf1, + 0x37, 0x60, 0x1b, 0x72, 0x0a, 0x3e, 0xce, 0x4d, 0xc1, 0x6f, 0xa1, 0xb6, 0xb5, 0x3c, 0x36, 0x53, + 0xfc, 0x3c, 0x23, 0x3b, 0x1e, 0xaf, 0x60, 0x71, 0x1e, 0x96, 0xc2, 0xad, 0x6d, 0xb1, 0x70, 0x2b, + 0xed, 0xdd, 0x71, 0x1a, 0xe6, 0xdd, 0xdd, 0xc9, 0xc0, 0x5f, 0xda, 0x47, 0x72, 0xc2, 0x21, 0x6e, + 0x66, 0x27, 0xb8, 0x3e, 0x8b, 0xc4, 0xe9, 0xc9, 0x8f, 0x95, 0x85, 0xae, 0x57, 0x16, 0xfa, 0xb3, + 0xb2, 0xd0, 0xd5, 0xda, 0x2a, 0x5c, 0xaf, 0xad, 0xc2, 0xaf, 0xb5, 0x55, 0x00, 0xf5, 0xa7, 0x39, + 0x43, 0x1f, 0xf6, 0xa7, 0x3c, 0xa4, 0x1e, 0x1f, 0x2b, 0x84, 0xc7, 0x8b, 0xde, 0x45, 0x59, 0xd2, + 0xf3, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x8c, 0x60, 0x34, 0xa6, 0x04, 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 + +// FavoriteAPIClient is the client API for FavoriteAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type FavoriteAPIClient interface { + // 添加收藏 + CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) + // 取消收藏 + DeleteFavorite(ctx context.Context, in *DeleteFavoriteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 根据文章id,查询用户是否有收藏某篇文档 + GetFavorite(ctx context.Context, in *GetFavoriteRequest, opts ...grpc.CallOption) (*Favorite, error) + // 查询用户的收藏 + ListFavorite(ctx context.Context, in *ListFavoriteRequest, opts ...grpc.CallOption) (*ListFavoriteReply, error) +} + +type favoriteAPIClient struct { + cc *grpc.ClientConn +} + +func NewFavoriteAPIClient(cc *grpc.ClientConn) FavoriteAPIClient { + return &favoriteAPIClient{cc} +} + +func (c *favoriteAPIClient) CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) { + out := new(Favorite) + err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/CreateFavorite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *favoriteAPIClient) DeleteFavorite(ctx context.Context, in *DeleteFavoriteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/DeleteFavorite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *favoriteAPIClient) GetFavorite(ctx context.Context, in *GetFavoriteRequest, opts ...grpc.CallOption) (*Favorite, error) { + out := new(Favorite) + err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/GetFavorite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *favoriteAPIClient) ListFavorite(ctx context.Context, in *ListFavoriteRequest, opts ...grpc.CallOption) (*ListFavoriteReply, error) { + out := new(ListFavoriteReply) + err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/ListFavorite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FavoriteAPIServer is the server API for FavoriteAPI service. +type FavoriteAPIServer interface { + // 添加收藏 + CreateFavorite(context.Context, *Favorite) (*Favorite, error) + // 取消收藏 + DeleteFavorite(context.Context, *DeleteFavoriteRequest) (*emptypb.Empty, error) + // 根据文章id,查询用户是否有收藏某篇文档 + GetFavorite(context.Context, *GetFavoriteRequest) (*Favorite, error) + // 查询用户的收藏 + ListFavorite(context.Context, *ListFavoriteRequest) (*ListFavoriteReply, error) +} + +// UnimplementedFavoriteAPIServer can be embedded to have forward compatible implementations. +type UnimplementedFavoriteAPIServer struct { +} + +func (*UnimplementedFavoriteAPIServer) CreateFavorite(ctx context.Context, req *Favorite) (*Favorite, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateFavorite not implemented") +} +func (*UnimplementedFavoriteAPIServer) DeleteFavorite(ctx context.Context, req *DeleteFavoriteRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteFavorite not implemented") +} +func (*UnimplementedFavoriteAPIServer) GetFavorite(ctx context.Context, req *GetFavoriteRequest) (*Favorite, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFavorite not implemented") +} +func (*UnimplementedFavoriteAPIServer) ListFavorite(ctx context.Context, req *ListFavoriteRequest) (*ListFavoriteReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFavorite not implemented") +} + +func RegisterFavoriteAPIServer(s *grpc.Server, srv FavoriteAPIServer) { + s.RegisterService(&_FavoriteAPI_serviceDesc, srv) +} + +func _FavoriteAPI_CreateFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Favorite) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FavoriteAPIServer).CreateFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FavoriteAPI/CreateFavorite", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FavoriteAPIServer).CreateFavorite(ctx, req.(*Favorite)) + } + return interceptor(ctx, in, info, handler) +} + +func _FavoriteAPI_DeleteFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteFavoriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FavoriteAPIServer).DeleteFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FavoriteAPI/DeleteFavorite", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FavoriteAPIServer).DeleteFavorite(ctx, req.(*DeleteFavoriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FavoriteAPI_GetFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFavoriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FavoriteAPIServer).GetFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FavoriteAPI/GetFavorite", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FavoriteAPIServer).GetFavorite(ctx, req.(*GetFavoriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FavoriteAPI_ListFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFavoriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FavoriteAPIServer).ListFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FavoriteAPI/ListFavorite", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FavoriteAPIServer).ListFavorite(ctx, req.(*ListFavoriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _FavoriteAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.FavoriteAPI", + HandlerType: (*FavoriteAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateFavorite", + Handler: _FavoriteAPI_CreateFavorite_Handler, + }, + { + MethodName: "DeleteFavorite", + Handler: _FavoriteAPI_DeleteFavorite_Handler, + }, + { + MethodName: "GetFavorite", + Handler: _FavoriteAPI_GetFavorite_Handler, + }, + { + MethodName: "ListFavorite", + Handler: _FavoriteAPI_ListFavorite_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/favorite.proto", +} + +func (m *Favorite) 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 *Favorite) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Favorite) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pages != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Pages)) + i-- + dAtA[i] = 0x50 + } + if m.Size_ != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x48 + } + if m.Score != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Score)) + i-- + dAtA[i] = 0x40 + } + if len(m.Ext) > 0 { + i -= len(m.Ext) + copy(dAtA[i:], m.Ext) + i = encodeVarintFavorite(dAtA, i, uint64(len(m.Ext))) + i-- + dAtA[i] = 0x3a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintFavorite(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x32 + } + 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 = encodeVarintFavorite(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintFavorite(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x22 + } + if m.DocumentId != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x18 + } + if m.UserId != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteFavoriteRequest) 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 *DeleteFavoriteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintFavorite(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListFavoriteRequest) 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 *ListFavoriteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UserId != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x18 + } + if m.Size_ != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListFavoriteReply) 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 *ListFavoriteReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListFavoriteReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Favorite) > 0 { + for iNdEx := len(m.Favorite) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Favorite[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFavorite(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetFavoriteRequest) 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 *GetFavoriteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DocumentId != 0 { + i = encodeVarintFavorite(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintFavorite(dAtA []byte, offset int, v uint64) int { + offset -= sovFavorite(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Favorite) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovFavorite(uint64(m.Id)) + } + if m.UserId != 0 { + n += 1 + sovFavorite(uint64(m.UserId)) + } + if m.DocumentId != 0 { + n += 1 + sovFavorite(uint64(m.DocumentId)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovFavorite(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovFavorite(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovFavorite(uint64(l)) + } + l = len(m.Ext) + if l > 0 { + n += 1 + l + sovFavorite(uint64(l)) + } + if m.Score != 0 { + n += 1 + sovFavorite(uint64(m.Score)) + } + if m.Size_ != 0 { + n += 1 + sovFavorite(uint64(m.Size_)) + } + if m.Pages != 0 { + n += 1 + sovFavorite(uint64(m.Pages)) + } + return n +} + +func (m *DeleteFavoriteRequest) 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 += sovFavorite(uint64(e)) + } + n += 1 + sovFavorite(uint64(l)) + l + } + return n +} + +func (m *ListFavoriteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovFavorite(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovFavorite(uint64(m.Size_)) + } + if m.UserId != 0 { + n += 1 + sovFavorite(uint64(m.UserId)) + } + return n +} + +func (m *ListFavoriteReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovFavorite(uint64(m.Total)) + } + if len(m.Favorite) > 0 { + for _, e := range m.Favorite { + l = e.Size() + n += 1 + l + sovFavorite(uint64(l)) + } + } + return n +} + +func (m *GetFavoriteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DocumentId != 0 { + n += 1 + sovFavorite(uint64(m.DocumentId)) + } + return n +} + +func sovFavorite(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFavorite(x uint64) (n int) { + return sovFavorite(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Favorite) 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 ErrIntOverflowFavorite + } + 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: Favorite: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Favorite: 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 ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFavorite + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + 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 5: + 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 ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFavorite + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + 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 6: + 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 ErrIntOverflowFavorite + } + 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 ErrInvalidLengthFavorite + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + 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 ErrInvalidLengthFavorite + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType) + } + m.Score = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Score |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + 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 ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pages", wireType) + } + m.Pages = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pages |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFavorite(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFavorite + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteFavoriteRequest) 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 ErrIntOverflowFavorite + } + 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: DeleteFavoriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteFavoriteRequest: 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 ErrIntOverflowFavorite + } + 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 ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthFavorite + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + 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 ErrIntOverflowFavorite + } + 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 := skipFavorite(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFavorite + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListFavoriteRequest) 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 ErrIntOverflowFavorite + } + 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: ListFavoriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListFavoriteRequest: 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 ErrIntOverflowFavorite + } + 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 ErrIntOverflowFavorite + } + 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 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFavorite(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFavorite + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListFavoriteReply) 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 ErrIntOverflowFavorite + } + 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: ListFavoriteReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListFavoriteReply: 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 ErrIntOverflowFavorite + } + 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 Favorite", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFavorite + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFavorite + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Favorite = append(m.Favorite, &Favorite{}) + if err := m.Favorite[len(m.Favorite)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFavorite(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFavorite + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetFavoriteRequest) 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 ErrIntOverflowFavorite + } + 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: GetFavoriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetFavoriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFavorite + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFavorite(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFavorite + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFavorite(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, ErrIntOverflowFavorite + } + 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, ErrIntOverflowFavorite + } + 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, ErrIntOverflowFavorite + } + 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, ErrInvalidLengthFavorite + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFavorite + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFavorite + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFavorite = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFavorite = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFavorite = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/favorite.pb.gw.go b/api/v1/favorite.pb.gw.go new file mode 100644 index 0000000..f919743 --- /dev/null +++ b/api/v1/favorite.pb.gw.go @@ -0,0 +1,418 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/favorite.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_FavoriteAPI_CreateFavorite_0(ctx context.Context, marshaler runtime.Marshaler, client FavoriteAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Favorite + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateFavorite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FavoriteAPI_CreateFavorite_0(ctx context.Context, marshaler runtime.Marshaler, server FavoriteAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Favorite + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateFavorite(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FavoriteAPI_DeleteFavorite_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FavoriteAPI_DeleteFavorite_0(ctx context.Context, marshaler runtime.Marshaler, client FavoriteAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteFavoriteRequest + 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_FavoriteAPI_DeleteFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteFavorite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FavoriteAPI_DeleteFavorite_0(ctx context.Context, marshaler runtime.Marshaler, server FavoriteAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteFavoriteRequest + 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_FavoriteAPI_DeleteFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteFavorite(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FavoriteAPI_GetFavorite_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FavoriteAPI_GetFavorite_0(ctx context.Context, marshaler runtime.Marshaler, client FavoriteAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetFavoriteRequest + 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_FavoriteAPI_GetFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetFavorite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FavoriteAPI_GetFavorite_0(ctx context.Context, marshaler runtime.Marshaler, server FavoriteAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetFavoriteRequest + 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_FavoriteAPI_GetFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetFavorite(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FavoriteAPI_ListFavorite_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FavoriteAPI_ListFavorite_0(ctx context.Context, marshaler runtime.Marshaler, client FavoriteAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListFavoriteRequest + 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_FavoriteAPI_ListFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListFavorite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FavoriteAPI_ListFavorite_0(ctx context.Context, marshaler runtime.Marshaler, server FavoriteAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListFavoriteRequest + 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_FavoriteAPI_ListFavorite_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListFavorite(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterFavoriteAPIHandlerServer registers the http handlers for service FavoriteAPI to "mux". +// UnaryRPC :call FavoriteAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFavoriteAPIHandlerFromEndpoint instead. +func RegisterFavoriteAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FavoriteAPIServer) error { + + mux.Handle("POST", pattern_FavoriteAPI_CreateFavorite_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FavoriteAPI_CreateFavorite_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_CreateFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_FavoriteAPI_DeleteFavorite_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FavoriteAPI_DeleteFavorite_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_DeleteFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FavoriteAPI_GetFavorite_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FavoriteAPI_GetFavorite_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_GetFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FavoriteAPI_ListFavorite_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FavoriteAPI_ListFavorite_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_ListFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterFavoriteAPIHandlerFromEndpoint is same as RegisterFavoriteAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterFavoriteAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterFavoriteAPIHandler(ctx, mux, conn) +} + +// RegisterFavoriteAPIHandler registers the http handlers for service FavoriteAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterFavoriteAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterFavoriteAPIHandlerClient(ctx, mux, NewFavoriteAPIClient(conn)) +} + +// RegisterFavoriteAPIHandlerClient registers the http handlers for service FavoriteAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FavoriteAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FavoriteAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "FavoriteAPIClient" to call the correct interceptors. +func RegisterFavoriteAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FavoriteAPIClient) error { + + mux.Handle("POST", pattern_FavoriteAPI_CreateFavorite_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FavoriteAPI_CreateFavorite_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_CreateFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_FavoriteAPI_DeleteFavorite_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FavoriteAPI_DeleteFavorite_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_DeleteFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FavoriteAPI_GetFavorite_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FavoriteAPI_GetFavorite_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_GetFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FavoriteAPI_ListFavorite_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FavoriteAPI_ListFavorite_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FavoriteAPI_ListFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_FavoriteAPI_CreateFavorite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "favorite"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FavoriteAPI_DeleteFavorite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "favorite"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FavoriteAPI_GetFavorite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "favorite"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FavoriteAPI_ListFavorite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "favorite", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_FavoriteAPI_CreateFavorite_0 = runtime.ForwardResponseMessage + + forward_FavoriteAPI_DeleteFavorite_0 = runtime.ForwardResponseMessage + + forward_FavoriteAPI_GetFavorite_0 = runtime.ForwardResponseMessage + + forward_FavoriteAPI_ListFavorite_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/friendlink.pb.go b/api/v1/friendlink.pb.go new file mode 100644 index 0000000..2c752f4 --- /dev/null +++ b/api/v1/friendlink.pb.go @@ -0,0 +1,1894 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/friendlink.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 Friendlink struct { + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,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"` + 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"` +} + +func (m *Friendlink) Reset() { *m = Friendlink{} } +func (m *Friendlink) String() string { return proto.CompactTextString(m) } +func (*Friendlink) ProtoMessage() {} +func (*Friendlink) Descriptor() ([]byte, []int) { + return fileDescriptor_b63ace7f53d1b08a, []int{0} +} +func (m *Friendlink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Friendlink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Friendlink.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 *Friendlink) XXX_Merge(src proto.Message) { + xxx_messageInfo_Friendlink.Merge(m, src) +} +func (m *Friendlink) XXX_Size() int { + return m.Size() +} +func (m *Friendlink) XXX_DiscardUnknown() { + xxx_messageInfo_Friendlink.DiscardUnknown(m) +} + +var xxx_messageInfo_Friendlink proto.InternalMessageInfo + +func (m *Friendlink) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Friendlink) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Friendlink) GetLink() string { + if m != nil { + return m.Link + } + return "" +} + +func (m *Friendlink) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Friendlink) GetSort() int32 { + if m != nil { + return m.Sort + } + return 0 +} + +func (m *Friendlink) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + +func (m *Friendlink) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Friendlink) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteFriendlinkRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteFriendlinkRequest) Reset() { *m = DeleteFriendlinkRequest{} } +func (m *DeleteFriendlinkRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteFriendlinkRequest) ProtoMessage() {} +func (*DeleteFriendlinkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b63ace7f53d1b08a, []int{1} +} +func (m *DeleteFriendlinkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteFriendlinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteFriendlinkRequest.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 *DeleteFriendlinkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFriendlinkRequest.Merge(m, src) +} +func (m *DeleteFriendlinkRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteFriendlinkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFriendlinkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFriendlinkRequest proto.InternalMessageInfo + +func (m *DeleteFriendlinkRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetFriendlinkRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetFriendlinkRequest) Reset() { *m = GetFriendlinkRequest{} } +func (m *GetFriendlinkRequest) String() string { return proto.CompactTextString(m) } +func (*GetFriendlinkRequest) ProtoMessage() {} +func (*GetFriendlinkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b63ace7f53d1b08a, []int{2} +} +func (m *GetFriendlinkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetFriendlinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetFriendlinkRequest.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 *GetFriendlinkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendlinkRequest.Merge(m, src) +} +func (m *GetFriendlinkRequest) XXX_Size() int { + return m.Size() +} +func (m *GetFriendlinkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendlinkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendlinkRequest proto.InternalMessageInfo + +func (m *GetFriendlinkRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type ListFriendlinkRequest struct { + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size_ int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Enable []bool `protobuf:"varint,4,rep,packed,name=enable,proto3" json:"enable,omitempty"` + Field []string `protobuf:"bytes,5,rep,name=field,proto3" json:"field,omitempty"` +} + +func (m *ListFriendlinkRequest) Reset() { *m = ListFriendlinkRequest{} } +func (m *ListFriendlinkRequest) String() string { return proto.CompactTextString(m) } +func (*ListFriendlinkRequest) ProtoMessage() {} +func (*ListFriendlinkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b63ace7f53d1b08a, []int{3} +} +func (m *ListFriendlinkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListFriendlinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListFriendlinkRequest.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 *ListFriendlinkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListFriendlinkRequest.Merge(m, src) +} +func (m *ListFriendlinkRequest) XXX_Size() int { + return m.Size() +} +func (m *ListFriendlinkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListFriendlinkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListFriendlinkRequest proto.InternalMessageInfo + +func (m *ListFriendlinkRequest) GetPage() int32 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListFriendlinkRequest) GetSize_() int32 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListFriendlinkRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListFriendlinkRequest) GetEnable() []bool { + if m != nil { + return m.Enable + } + return nil +} + +func (m *ListFriendlinkRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +type ListFriendlinkReply struct { + Friendlink []*Friendlink `protobuf:"bytes,1,rep,name=friendlink,proto3" json:"friendlink,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (m *ListFriendlinkReply) Reset() { *m = ListFriendlinkReply{} } +func (m *ListFriendlinkReply) String() string { return proto.CompactTextString(m) } +func (*ListFriendlinkReply) ProtoMessage() {} +func (*ListFriendlinkReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b63ace7f53d1b08a, []int{4} +} +func (m *ListFriendlinkReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListFriendlinkReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListFriendlinkReply.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 *ListFriendlinkReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListFriendlinkReply.Merge(m, src) +} +func (m *ListFriendlinkReply) XXX_Size() int { + return m.Size() +} +func (m *ListFriendlinkReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListFriendlinkReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListFriendlinkReply proto.InternalMessageInfo + +func (m *ListFriendlinkReply) GetFriendlink() []*Friendlink { + if m != nil { + return m.Friendlink + } + return nil +} + +func (m *ListFriendlinkReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func init() { + proto.RegisterType((*Friendlink)(nil), "api.v1.Friendlink") + proto.RegisterType((*DeleteFriendlinkRequest)(nil), "api.v1.DeleteFriendlinkRequest") + proto.RegisterType((*GetFriendlinkRequest)(nil), "api.v1.GetFriendlinkRequest") + proto.RegisterType((*ListFriendlinkRequest)(nil), "api.v1.ListFriendlinkRequest") + proto.RegisterType((*ListFriendlinkReply)(nil), "api.v1.ListFriendlinkReply") +} + +func init() { proto.RegisterFile("api/v1/friendlink.proto", fileDescriptor_b63ace7f53d1b08a) } + +var fileDescriptor_b63ace7f53d1b08a = []byte{ + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6f, 0xd3, 0x4c, + 0x10, 0xc6, 0xbb, 0xb6, 0x93, 0xb7, 0x9d, 0xaa, 0x55, 0xdf, 0x25, 0x34, 0xc6, 0x6d, 0x1d, 0xcb, + 0x07, 0x14, 0x7a, 0xb0, 0xd5, 0x20, 0x2e, 0x70, 0x40, 0x2d, 0xff, 0x84, 0xc4, 0xa1, 0xb2, 0xe0, + 0x00, 0x52, 0x55, 0xb9, 0xf5, 0xd6, 0x5a, 0xe1, 0x78, 0x8d, 0xbd, 0x49, 0x95, 0x4a, 0x48, 0x88, + 0x4f, 0x50, 0x09, 0x89, 0xcf, 0xc4, 0xb1, 0x12, 0x17, 0x6e, 0xa0, 0x84, 0x0f, 0x82, 0xbc, 0x5e, + 0x37, 0x6e, 0xe2, 0x08, 0x6e, 0xb3, 0xb3, 0x33, 0xbf, 0xf1, 0x3e, 0xf3, 0x24, 0xd0, 0xf6, 0x13, + 0xea, 0x0e, 0xf7, 0xdc, 0xb3, 0x94, 0x92, 0x38, 0x88, 0x68, 0xfc, 0xde, 0x49, 0x52, 0xc6, 0x19, + 0x6e, 0xfa, 0x09, 0x75, 0x86, 0x7b, 0x46, 0x27, 0x64, 0x2c, 0x8c, 0x88, 0x2b, 0xb2, 0x27, 0x83, + 0x33, 0x97, 0xd3, 0x3e, 0xc9, 0xb8, 0xdf, 0x4f, 0x8a, 0x42, 0xa3, 0x15, 0xb2, 0x90, 0x89, 0xd0, + 0xcd, 0x23, 0x99, 0xdd, 0x96, 0x6d, 0x39, 0xde, 0x8f, 0x63, 0xc6, 0x7d, 0x4e, 0x59, 0x9c, 0xc9, + 0xdb, 0xad, 0x59, 0x28, 0xe9, 0x27, 0x7c, 0x54, 0x5c, 0xda, 0x5f, 0x15, 0x80, 0xe7, 0xd7, 0x9f, + 0x83, 0xd7, 0x41, 0xa1, 0x81, 0x8e, 0x2c, 0xd4, 0x6d, 0x78, 0x0a, 0x0d, 0x70, 0x0b, 0x1a, 0x9c, + 0xf2, 0x88, 0xe8, 0x8a, 0x85, 0xba, 0x2b, 0x5e, 0x71, 0xc0, 0x18, 0xb4, 0xbc, 0x5a, 0x57, 0x45, + 0x52, 0xc4, 0xd8, 0x82, 0xd5, 0x80, 0x64, 0xa7, 0x29, 0x4d, 0xf2, 0xd9, 0xba, 0x26, 0xae, 0xaa, + 0xa9, 0xbc, 0x2b, 0x63, 0x29, 0xd7, 0x1b, 0x82, 0x2e, 0x62, 0xbc, 0x09, 0x4d, 0x12, 0xfb, 0x27, + 0x11, 0xd1, 0x9b, 0x16, 0xea, 0x2e, 0x7b, 0xf2, 0x84, 0x1f, 0x03, 0x9c, 0xa6, 0xc4, 0xe7, 0x24, + 0x38, 0xf6, 0xb9, 0xfe, 0x9f, 0x85, 0xba, 0xab, 0x3d, 0xc3, 0x29, 0x1e, 0xe2, 0x94, 0x0f, 0x71, + 0x5e, 0x97, 0xea, 0x1c, 0x68, 0x97, 0x3f, 0x3b, 0xc8, 0x5b, 0x91, 0x3d, 0xfb, 0x3c, 0x07, 0x0c, + 0x92, 0xa0, 0x04, 0x2c, 0xff, 0x2b, 0x40, 0xf6, 0xec, 0x73, 0xfb, 0x1e, 0xb4, 0x9f, 0x92, 0x88, + 0x70, 0x32, 0x55, 0xc7, 0x23, 0x1f, 0x06, 0x24, 0xe3, 0xd7, 0x22, 0xa9, 0x5d, 0x35, 0x17, 0xc9, + 0xbe, 0x0b, 0xad, 0x17, 0x84, 0x2f, 0xae, 0x43, 0xb2, 0xee, 0x23, 0xdc, 0x7e, 0x45, 0xb3, 0x9a, + 0x42, 0x0c, 0x5a, 0xe2, 0x87, 0x44, 0xea, 0x2e, 0x62, 0xa1, 0x16, 0xbd, 0x28, 0x84, 0xcf, 0xd5, + 0xa2, 0x17, 0x24, 0x07, 0x9e, 0x07, 0x52, 0x75, 0xe5, 0x3c, 0xa8, 0xa8, 0xa7, 0x59, 0x6a, 0x45, + 0xbd, 0x16, 0x34, 0xce, 0x28, 0x89, 0x02, 0xbd, 0x61, 0xa9, 0xf9, 0xd6, 0xc4, 0xc1, 0x3e, 0x86, + 0x5b, 0xb3, 0xe3, 0x93, 0x68, 0x84, 0x7b, 0x00, 0x53, 0x3f, 0x8a, 0x57, 0xad, 0xf6, 0xb0, 0x53, + 0x18, 0xd2, 0xa9, 0x14, 0x57, 0xaa, 0x84, 0x2d, 0x18, 0xf7, 0x23, 0xf1, 0x75, 0xaa, 0x57, 0x1c, + 0x7a, 0x9f, 0x34, 0x58, 0x9b, 0x36, 0xec, 0x1f, 0xbe, 0xc4, 0x6f, 0x61, 0xe3, 0x89, 0x58, 0x49, + 0xc5, 0x62, 0x35, 0x6c, 0xa3, 0x26, 0x67, 0xef, 0x7c, 0xfe, 0xfe, 0xfb, 0x8b, 0xd2, 0xb6, 0xb1, + 0x3b, 0xf7, 0xab, 0x79, 0x88, 0x76, 0xf1, 0x11, 0x6c, 0xbc, 0x11, 0xcb, 0xfa, 0x0b, 0x7a, 0x73, + 0x6e, 0xe9, 0xcf, 0x72, 0xfb, 0x97, 0x78, 0x63, 0x01, 0x3e, 0x84, 0x8d, 0xd9, 0xf5, 0xe3, 0x4e, + 0x89, 0x5f, 0x60, 0x8c, 0x85, 0xb3, 0x0c, 0x31, 0xab, 0xb5, 0x5b, 0x33, 0x0b, 0x1f, 0xc1, 0xda, + 0x0d, 0xf3, 0xe0, 0xed, 0x72, 0x4a, 0x9d, 0xa7, 0x6a, 0x95, 0x92, 0x78, 0x5c, 0x87, 0xef, 0xc3, + 0xfa, 0xcd, 0xa5, 0xe3, 0x9d, 0x92, 0x50, 0xeb, 0x45, 0x63, 0x6b, 0xd1, 0x75, 0x12, 0x8d, 0xec, + 0x8e, 0x98, 0x74, 0x07, 0xb7, 0xe7, 0x27, 0xb9, 0x11, 0xcd, 0xf8, 0xc1, 0x83, 0x6f, 0x63, 0x13, + 0x5d, 0x8d, 0x4d, 0xf4, 0x6b, 0x6c, 0xa2, 0xcb, 0x89, 0xb9, 0x74, 0x35, 0x31, 0x97, 0x7e, 0x4c, + 0xcc, 0x25, 0x90, 0x7f, 0x71, 0x87, 0xe8, 0xdd, 0xff, 0x7d, 0x96, 0x92, 0x80, 0x9d, 0x4a, 0xc6, + 0xa3, 0xe1, 0xde, 0x49, 0x53, 0x08, 0x76, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x7d, + 0x7b, 0xf2, 0x21, 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 + +// FriendlinkAPIClient is the client API for FriendlinkAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type FriendlinkAPIClient interface { + CreateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*Friendlink, error) + UpdateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteFriendlink(ctx context.Context, in *DeleteFriendlinkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetFriendlink(ctx context.Context, in *GetFriendlinkRequest, opts ...grpc.CallOption) (*Friendlink, error) + ListFriendlink(ctx context.Context, in *ListFriendlinkRequest, opts ...grpc.CallOption) (*ListFriendlinkReply, error) +} + +type friendlinkAPIClient struct { + cc *grpc.ClientConn +} + +func NewFriendlinkAPIClient(cc *grpc.ClientConn) FriendlinkAPIClient { + return &friendlinkAPIClient{cc} +} + +func (c *friendlinkAPIClient) CreateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*Friendlink, error) { + out := new(Friendlink) + err := c.cc.Invoke(ctx, "/api.v1.FriendlinkAPI/CreateFriendlink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendlinkAPIClient) UpdateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.FriendlinkAPI/UpdateFriendlink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendlinkAPIClient) DeleteFriendlink(ctx context.Context, in *DeleteFriendlinkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.FriendlinkAPI/DeleteFriendlink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendlinkAPIClient) GetFriendlink(ctx context.Context, in *GetFriendlinkRequest, opts ...grpc.CallOption) (*Friendlink, error) { + out := new(Friendlink) + err := c.cc.Invoke(ctx, "/api.v1.FriendlinkAPI/GetFriendlink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendlinkAPIClient) ListFriendlink(ctx context.Context, in *ListFriendlinkRequest, opts ...grpc.CallOption) (*ListFriendlinkReply, error) { + out := new(ListFriendlinkReply) + err := c.cc.Invoke(ctx, "/api.v1.FriendlinkAPI/ListFriendlink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FriendlinkAPIServer is the server API for FriendlinkAPI service. +type FriendlinkAPIServer interface { + CreateFriendlink(context.Context, *Friendlink) (*Friendlink, error) + UpdateFriendlink(context.Context, *Friendlink) (*emptypb.Empty, error) + DeleteFriendlink(context.Context, *DeleteFriendlinkRequest) (*emptypb.Empty, error) + GetFriendlink(context.Context, *GetFriendlinkRequest) (*Friendlink, error) + ListFriendlink(context.Context, *ListFriendlinkRequest) (*ListFriendlinkReply, error) +} + +// UnimplementedFriendlinkAPIServer can be embedded to have forward compatible implementations. +type UnimplementedFriendlinkAPIServer struct { +} + +func (*UnimplementedFriendlinkAPIServer) CreateFriendlink(ctx context.Context, req *Friendlink) (*Friendlink, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateFriendlink not implemented") +} +func (*UnimplementedFriendlinkAPIServer) UpdateFriendlink(ctx context.Context, req *Friendlink) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateFriendlink not implemented") +} +func (*UnimplementedFriendlinkAPIServer) DeleteFriendlink(ctx context.Context, req *DeleteFriendlinkRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteFriendlink not implemented") +} +func (*UnimplementedFriendlinkAPIServer) GetFriendlink(ctx context.Context, req *GetFriendlinkRequest) (*Friendlink, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFriendlink not implemented") +} +func (*UnimplementedFriendlinkAPIServer) ListFriendlink(ctx context.Context, req *ListFriendlinkRequest) (*ListFriendlinkReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFriendlink not implemented") +} + +func RegisterFriendlinkAPIServer(s *grpc.Server, srv FriendlinkAPIServer) { + s.RegisterService(&_FriendlinkAPI_serviceDesc, srv) +} + +func _FriendlinkAPI_CreateFriendlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Friendlink) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendlinkAPIServer).CreateFriendlink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FriendlinkAPI/CreateFriendlink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendlinkAPIServer).CreateFriendlink(ctx, req.(*Friendlink)) + } + return interceptor(ctx, in, info, handler) +} + +func _FriendlinkAPI_UpdateFriendlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Friendlink) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendlinkAPIServer).UpdateFriendlink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FriendlinkAPI/UpdateFriendlink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendlinkAPIServer).UpdateFriendlink(ctx, req.(*Friendlink)) + } + return interceptor(ctx, in, info, handler) +} + +func _FriendlinkAPI_DeleteFriendlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteFriendlinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendlinkAPIServer).DeleteFriendlink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FriendlinkAPI/DeleteFriendlink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendlinkAPIServer).DeleteFriendlink(ctx, req.(*DeleteFriendlinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FriendlinkAPI_GetFriendlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFriendlinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendlinkAPIServer).GetFriendlink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FriendlinkAPI/GetFriendlink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendlinkAPIServer).GetFriendlink(ctx, req.(*GetFriendlinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FriendlinkAPI_ListFriendlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFriendlinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendlinkAPIServer).ListFriendlink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.FriendlinkAPI/ListFriendlink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendlinkAPIServer).ListFriendlink(ctx, req.(*ListFriendlinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _FriendlinkAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.FriendlinkAPI", + HandlerType: (*FriendlinkAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateFriendlink", + Handler: _FriendlinkAPI_CreateFriendlink_Handler, + }, + { + MethodName: "UpdateFriendlink", + Handler: _FriendlinkAPI_UpdateFriendlink_Handler, + }, + { + MethodName: "DeleteFriendlink", + Handler: _FriendlinkAPI_DeleteFriendlink_Handler, + }, + { + MethodName: "GetFriendlink", + Handler: _FriendlinkAPI_GetFriendlink_Handler, + }, + { + MethodName: "ListFriendlink", + Handler: _FriendlinkAPI_ListFriendlink_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/friendlink.proto", +} + +func (m *Friendlink) 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 *Friendlink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Friendlink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 = encodeVarintFriendlink(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 = encodeVarintFriendlink(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 = encodeVarintFriendlink(dAtA, i, uint64(m.Sort)) + i-- + dAtA[i] = 0x28 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintFriendlink(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Link) > 0 { + i -= len(m.Link) + copy(dAtA[i:], m.Link) + i = encodeVarintFriendlink(dAtA, i, uint64(len(m.Link))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintFriendlink(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintFriendlink(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteFriendlinkRequest) 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 *DeleteFriendlinkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteFriendlinkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintFriendlink(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetFriendlinkRequest) 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 *GetFriendlinkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetFriendlinkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintFriendlink(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListFriendlinkRequest) 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 *ListFriendlinkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListFriendlinkRequest) 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 = encodeVarintFriendlink(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + 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 = encodeVarintFriendlink(dAtA, i, uint64(len(m.Enable))) + i-- + dAtA[i] = 0x22 + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintFriendlink(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintFriendlink(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintFriendlink(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListFriendlinkReply) 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 *ListFriendlinkReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListFriendlinkReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Total != 0 { + i = encodeVarintFriendlink(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x10 + } + if len(m.Friendlink) > 0 { + for iNdEx := len(m.Friendlink) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Friendlink[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFriendlink(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintFriendlink(dAtA []byte, offset int, v uint64) int { + offset -= sovFriendlink(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Friendlink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovFriendlink(uint64(m.Id)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovFriendlink(uint64(l)) + } + l = len(m.Link) + if l > 0 { + n += 1 + l + sovFriendlink(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovFriendlink(uint64(l)) + } + if m.Sort != 0 { + n += 1 + sovFriendlink(uint64(m.Sort)) + } + if m.Enable { + n += 2 + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovFriendlink(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovFriendlink(uint64(l)) + } + return n +} + +func (m *DeleteFriendlinkRequest) 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 += sovFriendlink(uint64(e)) + } + n += 1 + sovFriendlink(uint64(l)) + l + } + return n +} + +func (m *GetFriendlinkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovFriendlink(uint64(m.Id)) + } + return n +} + +func (m *ListFriendlinkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovFriendlink(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovFriendlink(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovFriendlink(uint64(l)) + } + if len(m.Enable) > 0 { + n += 1 + sovFriendlink(uint64(len(m.Enable))) + len(m.Enable)*1 + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovFriendlink(uint64(l)) + } + } + return n +} + +func (m *ListFriendlinkReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Friendlink) > 0 { + for _, e := range m.Friendlink { + l = e.Size() + n += 1 + l + sovFriendlink(uint64(l)) + } + } + if m.Total != 0 { + n += 1 + sovFriendlink(uint64(m.Total)) + } + return n +} + +func sovFriendlink(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFriendlink(x uint64) (n int) { + return sovFriendlink(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Friendlink) 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 ErrIntOverflowFriendlink + } + 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: Friendlink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Friendlink: 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowFriendlink + } + 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 ErrInvalidLengthFriendlink + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Link", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFriendlink + } + 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 ErrInvalidLengthFriendlink + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Link = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowFriendlink + } + 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 ErrInvalidLengthFriendlink + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 ErrIntOverflowFriendlink + } + 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 ErrIntOverflowFriendlink + } + 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFriendlink + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFriendlink + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + 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 + default: + iNdEx = preIndex + skippy, err := skipFriendlink(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFriendlink + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteFriendlinkRequest) 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 ErrIntOverflowFriendlink + } + 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: DeleteFriendlinkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteFriendlinkRequest: 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 ErrIntOverflowFriendlink + } + 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthFriendlink + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + 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 ErrIntOverflowFriendlink + } + 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 := skipFriendlink(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFriendlink + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetFriendlinkRequest) 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 ErrIntOverflowFriendlink + } + 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: GetFriendlinkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetFriendlinkRequest: 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 ErrIntOverflowFriendlink + } + 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 := skipFriendlink(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFriendlink + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListFriendlinkRequest) 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 ErrIntOverflowFriendlink + } + 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: ListFriendlinkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListFriendlinkRequest: 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Page |= int32(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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowFriendlink + } + 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 ErrInvalidLengthFriendlink + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFriendlink + } + 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthFriendlink + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + 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 ErrIntOverflowFriendlink + } + 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 5: + 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 ErrIntOverflowFriendlink + } + 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 ErrInvalidLengthFriendlink + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFriendlink(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFriendlink + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListFriendlinkReply) 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 ErrIntOverflowFriendlink + } + 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: ListFriendlinkReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListFriendlinkReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Friendlink", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFriendlink + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFriendlink + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Friendlink = append(m.Friendlink, &Friendlink{}) + if err := m.Friendlink[len(m.Friendlink)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowFriendlink + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFriendlink(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFriendlink + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFriendlink(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, ErrIntOverflowFriendlink + } + 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, ErrIntOverflowFriendlink + } + 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, ErrIntOverflowFriendlink + } + 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, ErrInvalidLengthFriendlink + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFriendlink + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFriendlink + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFriendlink = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFriendlink = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFriendlink = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/friendlink.pb.gw.go b/api/v1/friendlink.pb.gw.go new file mode 100644 index 0000000..bb03876 --- /dev/null +++ b/api/v1/friendlink.pb.gw.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/friendlink.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_FriendlinkAPI_CreateFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, client FriendlinkAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Friendlink + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateFriendlink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FriendlinkAPI_CreateFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, server FriendlinkAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Friendlink + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateFriendlink(ctx, &protoReq) + return msg, metadata, err + +} + +func request_FriendlinkAPI_UpdateFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, client FriendlinkAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Friendlink + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateFriendlink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FriendlinkAPI_UpdateFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, server FriendlinkAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Friendlink + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateFriendlink(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FriendlinkAPI_DeleteFriendlink_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FriendlinkAPI_DeleteFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, client FriendlinkAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteFriendlinkRequest + 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_FriendlinkAPI_DeleteFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteFriendlink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FriendlinkAPI_DeleteFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, server FriendlinkAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteFriendlinkRequest + 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_FriendlinkAPI_DeleteFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteFriendlink(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FriendlinkAPI_GetFriendlink_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FriendlinkAPI_GetFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, client FriendlinkAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetFriendlinkRequest + 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_FriendlinkAPI_GetFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetFriendlink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FriendlinkAPI_GetFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, server FriendlinkAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetFriendlinkRequest + 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_FriendlinkAPI_GetFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetFriendlink(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_FriendlinkAPI_ListFriendlink_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_FriendlinkAPI_ListFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, client FriendlinkAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListFriendlinkRequest + 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_FriendlinkAPI_ListFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListFriendlink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FriendlinkAPI_ListFriendlink_0(ctx context.Context, marshaler runtime.Marshaler, server FriendlinkAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListFriendlinkRequest + 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_FriendlinkAPI_ListFriendlink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListFriendlink(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterFriendlinkAPIHandlerServer registers the http handlers for service FriendlinkAPI to "mux". +// UnaryRPC :call FriendlinkAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFriendlinkAPIHandlerFromEndpoint instead. +func RegisterFriendlinkAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FriendlinkAPIServer) error { + + mux.Handle("POST", pattern_FriendlinkAPI_CreateFriendlink_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FriendlinkAPI_CreateFriendlink_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_CreateFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_FriendlinkAPI_UpdateFriendlink_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FriendlinkAPI_UpdateFriendlink_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_UpdateFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_FriendlinkAPI_DeleteFriendlink_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FriendlinkAPI_DeleteFriendlink_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_DeleteFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FriendlinkAPI_GetFriendlink_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FriendlinkAPI_GetFriendlink_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_GetFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FriendlinkAPI_ListFriendlink_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FriendlinkAPI_ListFriendlink_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_ListFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterFriendlinkAPIHandlerFromEndpoint is same as RegisterFriendlinkAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterFriendlinkAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterFriendlinkAPIHandler(ctx, mux, conn) +} + +// RegisterFriendlinkAPIHandler registers the http handlers for service FriendlinkAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterFriendlinkAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterFriendlinkAPIHandlerClient(ctx, mux, NewFriendlinkAPIClient(conn)) +} + +// RegisterFriendlinkAPIHandlerClient registers the http handlers for service FriendlinkAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FriendlinkAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FriendlinkAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "FriendlinkAPIClient" to call the correct interceptors. +func RegisterFriendlinkAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FriendlinkAPIClient) error { + + mux.Handle("POST", pattern_FriendlinkAPI_CreateFriendlink_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FriendlinkAPI_CreateFriendlink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_CreateFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_FriendlinkAPI_UpdateFriendlink_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FriendlinkAPI_UpdateFriendlink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_UpdateFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_FriendlinkAPI_DeleteFriendlink_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FriendlinkAPI_DeleteFriendlink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_DeleteFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FriendlinkAPI_GetFriendlink_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FriendlinkAPI_GetFriendlink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_GetFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_FriendlinkAPI_ListFriendlink_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FriendlinkAPI_ListFriendlink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FriendlinkAPI_ListFriendlink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_FriendlinkAPI_CreateFriendlink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "friendlink"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FriendlinkAPI_UpdateFriendlink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "friendlink"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FriendlinkAPI_DeleteFriendlink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "friendlink"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FriendlinkAPI_GetFriendlink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "friendlink"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_FriendlinkAPI_ListFriendlink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "friendlink", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_FriendlinkAPI_CreateFriendlink_0 = runtime.ForwardResponseMessage + + forward_FriendlinkAPI_UpdateFriendlink_0 = runtime.ForwardResponseMessage + + forward_FriendlinkAPI_DeleteFriendlink_0 = runtime.ForwardResponseMessage + + forward_FriendlinkAPI_GetFriendlink_0 = runtime.ForwardResponseMessage + + forward_FriendlinkAPI_ListFriendlink_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/group.pb.go b/api/v1/group.pb.go new file mode 100644 index 0000000..61ebb44 --- /dev/null +++ b/api/v1/group.pb.go @@ -0,0 +1,2804 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/group.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 Group struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Color string `protobuf:"bytes,3,opt,name=color,proto3" json:"color,omitempty"` + IsDefault bool `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` + IsDisplay bool `protobuf:"varint,5,opt,name=is_display,json=isDisplay,proto3" json:"is_display,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + UserCount int32 `protobuf:"varint,7,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"` + Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"` + EnableUpload bool `protobuf:"varint,11,opt,name=enable_upload,json=enableUpload,proto3" json:"enable_upload,omitempty"` + EnableCommentApproval bool `protobuf:"varint,12,opt,name=enable_comment_approval,json=enableCommentApproval,proto3" json:"enable_comment_approval,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Group) Reset() { *m = Group{} } +func (m *Group) String() string { return proto.CompactTextString(m) } +func (*Group) ProtoMessage() {} +func (*Group) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{0} +} +func (m *Group) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Group.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 *Group) XXX_Merge(src proto.Message) { + xxx_messageInfo_Group.Merge(m, src) +} +func (m *Group) XXX_Size() int { + return m.Size() +} +func (m *Group) XXX_DiscardUnknown() { + xxx_messageInfo_Group.DiscardUnknown(m) +} + +var xxx_messageInfo_Group proto.InternalMessageInfo + +func (m *Group) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Group) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Group) GetColor() string { + if m != nil { + return m.Color + } + return "" +} + +func (m *Group) GetIsDefault() bool { + if m != nil { + return m.IsDefault + } + return false +} + +func (m *Group) GetIsDisplay() bool { + if m != nil { + return m.IsDisplay + } + return false +} + +func (m *Group) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Group) GetUserCount() int32 { + if m != nil { + return m.UserCount + } + return 0 +} + +func (m *Group) GetSort() int32 { + if m != nil { + return m.Sort + } + return 0 +} + +func (m *Group) GetEnableUpload() bool { + if m != nil { + return m.EnableUpload + } + return false +} + +func (m *Group) GetEnableCommentApproval() bool { + if m != nil { + return m.EnableCommentApproval + } + return false +} + +func (m *Group) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Group) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeleteGroupRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteGroupRequest) Reset() { *m = DeleteGroupRequest{} } +func (m *DeleteGroupRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteGroupRequest) ProtoMessage() {} +func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{1} +} +func (m *DeleteGroupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteGroupRequest.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 *DeleteGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteGroupRequest.Merge(m, src) +} +func (m *DeleteGroupRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteGroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteGroupRequest proto.InternalMessageInfo + +func (m *DeleteGroupRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +// 根据组名或者ID获取用户组 +type GetGroupRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` +} + +func (m *GetGroupRequest) Reset() { *m = GetGroupRequest{} } +func (m *GetGroupRequest) String() string { return proto.CompactTextString(m) } +func (*GetGroupRequest) ProtoMessage() {} +func (*GetGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{2} +} +func (m *GetGroupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetGroupRequest.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 *GetGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupRequest.Merge(m, src) +} +func (m *GetGroupRequest) XXX_Size() int { + return m.Size() +} +func (m *GetGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupRequest proto.InternalMessageInfo + +func (m *GetGroupRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *GetGroupRequest) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +// 查询用户组列表。不需要分页,直接返回全部用户组,只是可以指定查询哪些字段 +type ListGroupRequest struct { + Wd string `protobuf:"bytes,1,opt,name=wd,proto3" json:"wd,omitempty"` + Page int64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Sort string `protobuf:"bytes,4,opt,name=sort,proto3" json:"sort,omitempty"` + Field []string `protobuf:"bytes,5,rep,name=field,proto3" json:"field,omitempty"` +} + +func (m *ListGroupRequest) Reset() { *m = ListGroupRequest{} } +func (m *ListGroupRequest) String() string { return proto.CompactTextString(m) } +func (*ListGroupRequest) ProtoMessage() {} +func (*ListGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{3} +} +func (m *ListGroupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListGroupRequest.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 *ListGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListGroupRequest.Merge(m, src) +} +func (m *ListGroupRequest) XXX_Size() int { + return m.Size() +} +func (m *ListGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListGroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListGroupRequest proto.InternalMessageInfo + +func (m *ListGroupRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListGroupRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListGroupRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListGroupRequest) GetSort() string { + if m != nil { + return m.Sort + } + return "" +} + +func (m *ListGroupRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +type ListGroupReply struct { + Group []*Group `protobuf:"bytes,1,rep,name=group,proto3" json:"group,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (m *ListGroupReply) Reset() { *m = ListGroupReply{} } +func (m *ListGroupReply) String() string { return proto.CompactTextString(m) } +func (*ListGroupReply) ProtoMessage() {} +func (*ListGroupReply) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{4} +} +func (m *ListGroupReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListGroupReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListGroupReply.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 *ListGroupReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListGroupReply.Merge(m, src) +} +func (m *ListGroupReply) XXX_Size() int { + return m.Size() +} +func (m *ListGroupReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListGroupReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListGroupReply proto.InternalMessageInfo + +func (m *ListGroupReply) GetGroup() []*Group { + if m != nil { + return m.Group + } + return nil +} + +func (m *ListGroupReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +type GetGroupPermissionRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetGroupPermissionRequest) Reset() { *m = GetGroupPermissionRequest{} } +func (m *GetGroupPermissionRequest) String() string { return proto.CompactTextString(m) } +func (*GetGroupPermissionRequest) ProtoMessage() {} +func (*GetGroupPermissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{5} +} +func (m *GetGroupPermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetGroupPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetGroupPermissionRequest.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 *GetGroupPermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupPermissionRequest.Merge(m, src) +} +func (m *GetGroupPermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *GetGroupPermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupPermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupPermissionRequest proto.InternalMessageInfo + +func (m *GetGroupPermissionRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type UpdateGroupPermissionRequest struct { + GroupId int64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + PermissionId []int64 `protobuf:"varint,2,rep,packed,name=permission_id,json=permissionId,proto3" json:"permission_id,omitempty"` +} + +func (m *UpdateGroupPermissionRequest) Reset() { *m = UpdateGroupPermissionRequest{} } +func (m *UpdateGroupPermissionRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateGroupPermissionRequest) ProtoMessage() {} +func (*UpdateGroupPermissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{6} +} +func (m *UpdateGroupPermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateGroupPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateGroupPermissionRequest.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 *UpdateGroupPermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateGroupPermissionRequest.Merge(m, src) +} +func (m *UpdateGroupPermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *UpdateGroupPermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateGroupPermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateGroupPermissionRequest proto.InternalMessageInfo + +func (m *UpdateGroupPermissionRequest) GetGroupId() int64 { + if m != nil { + return m.GroupId + } + return 0 +} + +func (m *UpdateGroupPermissionRequest) GetPermissionId() []int64 { + if m != nil { + return m.PermissionId + } + return nil +} + +type GroupPermissions struct { + PermissionId []int64 `protobuf:"varint,1,rep,packed,name=permission_id,json=permissionId,proto3" json:"permission_id,omitempty"` +} + +func (m *GroupPermissions) Reset() { *m = GroupPermissions{} } +func (m *GroupPermissions) String() string { return proto.CompactTextString(m) } +func (*GroupPermissions) ProtoMessage() {} +func (*GroupPermissions) Descriptor() ([]byte, []int) { + return fileDescriptor_e95c92b0421dbd41, []int{7} +} +func (m *GroupPermissions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GroupPermissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GroupPermissions.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 *GroupPermissions) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupPermissions.Merge(m, src) +} +func (m *GroupPermissions) XXX_Size() int { + return m.Size() +} +func (m *GroupPermissions) XXX_DiscardUnknown() { + xxx_messageInfo_GroupPermissions.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupPermissions proto.InternalMessageInfo + +func (m *GroupPermissions) GetPermissionId() []int64 { + if m != nil { + return m.PermissionId + } + return nil +} + +func init() { + proto.RegisterType((*Group)(nil), "api.v1.Group") + proto.RegisterType((*DeleteGroupRequest)(nil), "api.v1.DeleteGroupRequest") + proto.RegisterType((*GetGroupRequest)(nil), "api.v1.GetGroupRequest") + proto.RegisterType((*ListGroupRequest)(nil), "api.v1.ListGroupRequest") + proto.RegisterType((*ListGroupReply)(nil), "api.v1.ListGroupReply") + proto.RegisterType((*GetGroupPermissionRequest)(nil), "api.v1.GetGroupPermissionRequest") + proto.RegisterType((*UpdateGroupPermissionRequest)(nil), "api.v1.UpdateGroupPermissionRequest") + proto.RegisterType((*GroupPermissions)(nil), "api.v1.GroupPermissions") +} + +func init() { proto.RegisterFile("api/v1/group.proto", fileDescriptor_e95c92b0421dbd41) } + +var fileDescriptor_e95c92b0421dbd41 = []byte{ + // 784 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x4e, 0xdb, 0x4c, + 0x14, 0xc5, 0x49, 0x0c, 0xc9, 0x0d, 0x7f, 0xdf, 0x28, 0xc0, 0xe0, 0x0f, 0x82, 0x6b, 0x58, 0x44, + 0x54, 0x4a, 0x04, 0x55, 0x5b, 0x89, 0x2e, 0xaa, 0xf0, 0x23, 0x14, 0xb5, 0xaa, 0x90, 0x55, 0xa4, + 0xb6, 0x8b, 0x46, 0x26, 0x1e, 0xa2, 0x91, 0x9c, 0x8c, 0x6b, 0x8f, 0x83, 0xc2, 0xb2, 0x4f, 0x80, + 0xda, 0x67, 0xe9, 0x3b, 0x74, 0x89, 0xd4, 0x4d, 0x77, 0xad, 0xa0, 0x0f, 0x52, 0xcd, 0x8c, 0x1d, + 0x92, 0x98, 0xa0, 0xee, 0x66, 0xce, 0xbd, 0xe7, 0xdc, 0x3b, 0xf7, 0x1e, 0x27, 0x80, 0x1c, 0x9f, + 0xd6, 0x7a, 0x3b, 0xb5, 0x76, 0xc0, 0x22, 0xbf, 0xea, 0x07, 0x8c, 0x33, 0x34, 0xed, 0xf8, 0xb4, + 0xda, 0xdb, 0x31, 0x36, 0xda, 0x8c, 0xb5, 0x3d, 0x52, 0x93, 0xe8, 0x59, 0x74, 0x5e, 0xe3, 0xb4, + 0x43, 0x42, 0xee, 0x74, 0xe2, 0x44, 0xa3, 0xd4, 0x66, 0x6d, 0x26, 0x8f, 0x35, 0x71, 0x8a, 0xd1, + 0xb5, 0x98, 0x26, 0x94, 0x9d, 0x6e, 0x97, 0x71, 0x87, 0x53, 0xd6, 0x0d, 0xe3, 0xe8, 0xff, 0xe3, + 0xa2, 0xa4, 0xe3, 0xf3, 0xbe, 0x0a, 0x5a, 0xdf, 0xb2, 0xa0, 0x1f, 0x8b, 0x4e, 0xd0, 0x3c, 0x64, + 0xa8, 0x8b, 0x35, 0x53, 0xab, 0x64, 0xed, 0x0c, 0x75, 0x51, 0x09, 0x74, 0x4e, 0xb9, 0x47, 0x70, + 0xc6, 0xd4, 0x2a, 0x05, 0x5b, 0x5d, 0x04, 0xda, 0x62, 0x1e, 0x0b, 0x70, 0x56, 0xa1, 0xf2, 0x82, + 0xd6, 0x01, 0x68, 0xd8, 0x74, 0xc9, 0xb9, 0x13, 0x79, 0x1c, 0xe7, 0x4c, 0xad, 0x92, 0xb7, 0x0b, + 0x34, 0x3c, 0x54, 0x40, 0x12, 0xa6, 0xa1, 0xef, 0x39, 0x7d, 0xac, 0x0f, 0xc2, 0x0a, 0x40, 0x26, + 0x14, 0x5d, 0x12, 0xb6, 0x02, 0xea, 0x8b, 0xb6, 0xf1, 0xb4, 0x54, 0x1e, 0x86, 0x84, 0x40, 0x14, + 0x92, 0xa0, 0xd9, 0x62, 0x51, 0x97, 0xe3, 0x19, 0x53, 0xab, 0xe8, 0x76, 0x41, 0x20, 0x07, 0x02, + 0x40, 0x08, 0x72, 0x21, 0x0b, 0x38, 0xce, 0xcb, 0x80, 0x3c, 0xa3, 0x4d, 0x98, 0x23, 0x5d, 0xe7, + 0xcc, 0x23, 0xcd, 0xc8, 0xf7, 0x98, 0xe3, 0xe2, 0xa2, 0x2c, 0x3b, 0xab, 0xc0, 0x53, 0x89, 0xa1, + 0x67, 0xb0, 0x12, 0x27, 0xb5, 0x58, 0xa7, 0x43, 0xba, 0xbc, 0xe9, 0xf8, 0x7e, 0xc0, 0x7a, 0x8e, + 0x87, 0x67, 0x65, 0xfa, 0x92, 0x0a, 0x1f, 0xa8, 0x68, 0x3d, 0x0e, 0xa2, 0x97, 0x00, 0xad, 0x80, + 0x38, 0x9c, 0xb8, 0x4d, 0x87, 0xe3, 0x82, 0xa9, 0x55, 0x8a, 0xbb, 0x46, 0x55, 0xcd, 0xb9, 0x9a, + 0xcc, 0xb9, 0xfa, 0x36, 0x59, 0xde, 0x7e, 0xee, 0xea, 0xd7, 0x86, 0x66, 0x17, 0x62, 0x4e, 0x9d, + 0x0b, 0x81, 0xc8, 0x77, 0x13, 0x01, 0xf8, 0x57, 0x81, 0x98, 0x53, 0xe7, 0xd6, 0x16, 0xa0, 0x43, + 0xe2, 0x11, 0x4e, 0xe4, 0xf2, 0x6c, 0xf2, 0x29, 0x22, 0x21, 0x1f, 0xec, 0x30, 0xab, 0x76, 0x68, + 0x3d, 0x87, 0x85, 0x63, 0xc2, 0xef, 0x4d, 0x79, 0x70, 0xcd, 0x16, 0x87, 0xc5, 0xd7, 0x34, 0x4c, + 0x31, 0x2f, 0x14, 0xb3, 0x60, 0x67, 0x2e, 0x5c, 0x31, 0x75, 0xdf, 0x69, 0x2b, 0x62, 0xd6, 0x96, + 0x67, 0xb9, 0x09, 0x7a, 0x49, 0xa4, 0x3b, 0xb2, 0xb6, 0x3c, 0x0f, 0xb6, 0x93, 0x93, 0x4c, 0xb5, + 0x9d, 0x12, 0xe8, 0xe7, 0x94, 0x78, 0x2e, 0xd6, 0xcd, 0xac, 0xa8, 0x2a, 0x2f, 0xd6, 0x2b, 0x98, + 0x1f, 0xaa, 0xea, 0x7b, 0x7d, 0xb4, 0x09, 0xba, 0xfc, 0x4e, 0xe4, 0x9b, 0x8a, 0xbb, 0x73, 0x55, + 0xf5, 0xa1, 0x54, 0x55, 0x8a, 0x8a, 0xc9, 0x27, 0x30, 0xee, 0x78, 0x71, 0x27, 0xea, 0x62, 0x3d, + 0x86, 0xd5, 0xe4, 0xed, 0x27, 0x24, 0xe8, 0xd0, 0x30, 0xa4, 0xac, 0x3b, 0x61, 0x0a, 0xd6, 0x47, + 0x58, 0x3b, 0x95, 0xb3, 0x9d, 0x90, 0xbf, 0x0a, 0x79, 0x59, 0xab, 0x39, 0x60, 0xcd, 0xc8, 0x7b, + 0xc3, 0x15, 0x46, 0xf3, 0x07, 0xf9, 0x22, 0x9e, 0x91, 0xe3, 0x9f, 0xbd, 0x03, 0x1b, 0x62, 0x11, + 0x8b, 0x63, 0xca, 0x61, 0x9a, 0xa8, 0xa5, 0x89, 0xbb, 0x5f, 0x74, 0xc8, 0x4b, 0x66, 0xfd, 0xa4, + 0x81, 0x8e, 0xa0, 0x78, 0x20, 0x2d, 0xa4, 0xbe, 0xd8, 0xd1, 0x69, 0x18, 0xa3, 0x57, 0x0b, 0x7f, + 0xfe, 0xf1, 0xe7, 0x6b, 0x06, 0x59, 0x73, 0xb5, 0xe1, 0x1f, 0x9c, 0x3d, 0x6d, 0x1b, 0xbd, 0x81, + 0xe2, 0xd0, 0x63, 0xc7, 0x65, 0x96, 0x53, 0x36, 0x3c, 0x12, 0xbf, 0x17, 0x89, 0x9e, 0x91, 0xd6, + 0x7b, 0x07, 0xc5, 0x21, 0x2f, 0x22, 0x23, 0xd1, 0x4b, 0x1b, 0x74, 0xa2, 0xf8, 0x92, 0x14, 0x5f, + 0xd8, 0x1e, 0x15, 0x47, 0x0d, 0xc8, 0x27, 0x3b, 0x44, 0x2b, 0x83, 0x36, 0x47, 0x1d, 0x3d, 0xfe, + 0xee, 0x58, 0x0a, 0x8d, 0x49, 0xbd, 0x87, 0xc2, 0xc0, 0x5b, 0x08, 0x27, 0x94, 0x71, 0x93, 0x1b, + 0xcb, 0xf7, 0x44, 0x7c, 0xaf, 0x6f, 0x19, 0x52, 0xb5, 0x84, 0xd0, 0x88, 0x6a, 0xcd, 0xa3, 0x21, + 0x47, 0x21, 0xa0, 0xb4, 0xd3, 0xd0, 0xa3, 0xf1, 0x7e, 0x53, 0xae, 0x32, 0xf0, 0x48, 0xe7, 0x43, + 0xde, 0xb0, 0x4c, 0x59, 0xce, 0x40, 0x78, 0xb4, 0xdc, 0x9d, 0x35, 0xd0, 0x25, 0x2c, 0xdd, 0xeb, + 0x58, 0xb4, 0x95, 0x88, 0x3e, 0x64, 0xe8, 0x89, 0x8b, 0xd8, 0x94, 0x85, 0xd7, 0x8d, 0x89, 0x85, + 0xf7, 0xb4, 0xed, 0xfd, 0xa7, 0xdf, 0x6f, 0xca, 0xda, 0xf5, 0x4d, 0x59, 0xfb, 0x7d, 0x53, 0xd6, + 0xae, 0x6e, 0xcb, 0x53, 0xd7, 0xb7, 0xe5, 0xa9, 0x9f, 0xb7, 0xe5, 0x29, 0x88, 0xff, 0xc8, 0x4e, + 0xb4, 0x0f, 0xff, 0x75, 0x58, 0x40, 0x5c, 0xd6, 0x8a, 0x75, 0x5e, 0xf4, 0x76, 0xce, 0xa6, 0x65, + 0xad, 0x27, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x77, 0x34, 0x48, 0xfc, 0x02, 0x07, 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 + +// GroupAPIClient is the client API for GroupAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type GroupAPIClient interface { + // 创建用户组 + CreateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*Group, error) + // 更新用户组 + UpdateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除用户组 + DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 获取用户组列表 + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) + ListGroup(ctx context.Context, in *ListGroupRequest, opts ...grpc.CallOption) (*ListGroupReply, error) + // 获取用户组权限列表 + GetGroupPermission(ctx context.Context, in *GetGroupPermissionRequest, opts ...grpc.CallOption) (*GroupPermissions, error) + // 更新用户组权限,给用户组设置权限 + UpdateGroupPermission(ctx context.Context, in *UpdateGroupPermissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type groupAPIClient struct { + cc *grpc.ClientConn +} + +func NewGroupAPIClient(cc *grpc.ClientConn) GroupAPIClient { + return &groupAPIClient{cc} +} + +func (c *groupAPIClient) CreateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/CreateGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) UpdateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/UpdateGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/DeleteGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/GetGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) ListGroup(ctx context.Context, in *ListGroupRequest, opts ...grpc.CallOption) (*ListGroupReply, error) { + out := new(ListGroupReply) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/ListGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) GetGroupPermission(ctx context.Context, in *GetGroupPermissionRequest, opts ...grpc.CallOption) (*GroupPermissions, error) { + out := new(GroupPermissions) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/GetGroupPermission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupAPIClient) UpdateGroupPermission(ctx context.Context, in *UpdateGroupPermissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.GroupAPI/UpdateGroupPermission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GroupAPIServer is the server API for GroupAPI service. +type GroupAPIServer interface { + // 创建用户组 + CreateGroup(context.Context, *Group) (*Group, error) + // 更新用户组 + UpdateGroup(context.Context, *Group) (*emptypb.Empty, error) + // 删除用户组 + DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) + // 获取用户组列表 + GetGroup(context.Context, *GetGroupRequest) (*Group, error) + ListGroup(context.Context, *ListGroupRequest) (*ListGroupReply, error) + // 获取用户组权限列表 + GetGroupPermission(context.Context, *GetGroupPermissionRequest) (*GroupPermissions, error) + // 更新用户组权限,给用户组设置权限 + UpdateGroupPermission(context.Context, *UpdateGroupPermissionRequest) (*emptypb.Empty, error) +} + +// UnimplementedGroupAPIServer can be embedded to have forward compatible implementations. +type UnimplementedGroupAPIServer struct { +} + +func (*UnimplementedGroupAPIServer) CreateGroup(ctx context.Context, req *Group) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") +} +func (*UnimplementedGroupAPIServer) UpdateGroup(ctx context.Context, req *Group) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") +} +func (*UnimplementedGroupAPIServer) DeleteGroup(ctx context.Context, req *DeleteGroupRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") +} +func (*UnimplementedGroupAPIServer) GetGroup(ctx context.Context, req *GetGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") +} +func (*UnimplementedGroupAPIServer) ListGroup(ctx context.Context, req *ListGroupRequest) (*ListGroupReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroup not implemented") +} +func (*UnimplementedGroupAPIServer) GetGroupPermission(ctx context.Context, req *GetGroupPermissionRequest) (*GroupPermissions, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupPermission not implemented") +} +func (*UnimplementedGroupAPIServer) UpdateGroupPermission(ctx context.Context, req *UpdateGroupPermissionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGroupPermission not implemented") +} + +func RegisterGroupAPIServer(s *grpc.Server, srv GroupAPIServer) { + s.RegisterService(&_GroupAPI_serviceDesc, srv) +} + +func _GroupAPI_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Group) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).CreateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/CreateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).CreateGroup(ctx, req.(*Group)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Group) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/UpdateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).UpdateGroup(ctx, req.(*Group)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/DeleteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/GetGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).GetGroup(ctx, req.(*GetGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_ListGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).ListGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/ListGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).ListGroup(ctx, req.(*ListGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_GetGroupPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupPermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).GetGroupPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/GetGroupPermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).GetGroupPermission(ctx, req.(*GetGroupPermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupAPI_UpdateGroupPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupPermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupAPIServer).UpdateGroupPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.GroupAPI/UpdateGroupPermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupAPIServer).UpdateGroupPermission(ctx, req.(*UpdateGroupPermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _GroupAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.GroupAPI", + HandlerType: (*GroupAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateGroup", + Handler: _GroupAPI_CreateGroup_Handler, + }, + { + MethodName: "UpdateGroup", + Handler: _GroupAPI_UpdateGroup_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _GroupAPI_DeleteGroup_Handler, + }, + { + MethodName: "GetGroup", + Handler: _GroupAPI_GetGroup_Handler, + }, + { + MethodName: "ListGroup", + Handler: _GroupAPI_ListGroup_Handler, + }, + { + MethodName: "GetGroupPermission", + Handler: _GroupAPI_GetGroupPermission_Handler, + }, + { + MethodName: "UpdateGroupPermission", + Handler: _GroupAPI_UpdateGroupPermission_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/group.proto", +} + +func (m *Group) 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 *Group) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Group) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EnableCommentApproval { + i-- + if m.EnableCommentApproval { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.EnableUpload { + i-- + if m.EnableUpload { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + 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 = encodeVarintGroup(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x52 + } + 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 = encodeVarintGroup(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x4a + } + if m.Sort != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Sort)) + i-- + dAtA[i] = 0x40 + } + if m.UserCount != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.UserCount)) + i-- + dAtA[i] = 0x38 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x32 + } + if m.IsDisplay { + i-- + if m.IsDisplay { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.IsDefault { + i-- + if m.IsDefault { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Color) > 0 { + i -= len(m.Color) + copy(dAtA[i:], m.Color) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Color))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteGroupRequest) 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 *DeleteGroupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteGroupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintGroup(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetGroupRequest) 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 *GetGroupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetGroupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListGroupRequest) 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 *ListGroupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListGroupRequest) 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 = encodeVarintGroup(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Sort) > 0 { + i -= len(m.Sort) + copy(dAtA[i:], m.Sort) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Sort))) + i-- + dAtA[i] = 0x22 + } + if m.Size_ != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x18 + } + if m.Page != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x10 + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintGroup(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListGroupReply) 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 *ListGroupReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListGroupReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Total != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x10 + } + if len(m.Group) > 0 { + for iNdEx := len(m.Group) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Group[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGroup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetGroupPermissionRequest) 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 *GetGroupPermissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetGroupPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateGroupPermissionRequest) 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 *UpdateGroupPermissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateGroupPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PermissionId) > 0 { + dAtA6 := make([]byte, len(m.PermissionId)*10) + var j5 int + for _, num1 := range m.PermissionId { + 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 = encodeVarintGroup(dAtA, i, uint64(j5)) + i-- + dAtA[i] = 0x12 + } + if m.GroupId != 0 { + i = encodeVarintGroup(dAtA, i, uint64(m.GroupId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GroupPermissions) 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 *GroupPermissions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GroupPermissions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PermissionId) > 0 { + dAtA8 := make([]byte, len(m.PermissionId)*10) + var j7 int + for _, num1 := range m.PermissionId { + num := uint64(num1) + for num >= 1<<7 { + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j7++ + } + dAtA8[j7] = uint8(num) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintGroup(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGroup(dAtA []byte, offset int, v uint64) int { + offset -= sovGroup(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Group) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovGroup(uint64(m.Id)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + l = len(m.Color) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + if m.IsDefault { + n += 2 + } + if m.IsDisplay { + n += 2 + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + if m.UserCount != 0 { + n += 1 + sovGroup(uint64(m.UserCount)) + } + if m.Sort != 0 { + n += 1 + sovGroup(uint64(m.Sort)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovGroup(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovGroup(uint64(l)) + } + if m.EnableUpload { + n += 2 + } + if m.EnableCommentApproval { + n += 2 + } + return n +} + +func (m *DeleteGroupRequest) 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 += sovGroup(uint64(e)) + } + n += 1 + sovGroup(uint64(l)) + l + } + return n +} + +func (m *GetGroupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovGroup(uint64(m.Id)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + return n +} + +func (m *ListGroupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + if m.Page != 0 { + n += 1 + sovGroup(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovGroup(uint64(m.Size_)) + } + l = len(m.Sort) + if l > 0 { + n += 1 + l + sovGroup(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovGroup(uint64(l)) + } + } + return n +} + +func (m *ListGroupReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Group) > 0 { + for _, e := range m.Group { + l = e.Size() + n += 1 + l + sovGroup(uint64(l)) + } + } + if m.Total != 0 { + n += 1 + sovGroup(uint64(m.Total)) + } + return n +} + +func (m *GetGroupPermissionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovGroup(uint64(m.Id)) + } + return n +} + +func (m *UpdateGroupPermissionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GroupId != 0 { + n += 1 + sovGroup(uint64(m.GroupId)) + } + if len(m.PermissionId) > 0 { + l = 0 + for _, e := range m.PermissionId { + l += sovGroup(uint64(e)) + } + n += 1 + sovGroup(uint64(l)) + l + } + return n +} + +func (m *GroupPermissions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PermissionId) > 0 { + l = 0 + for _, e := range m.PermissionId { + l += sovGroup(uint64(e)) + } + n += 1 + sovGroup(uint64(l)) + l + } + return n +} + +func sovGroup(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGroup(x uint64) (n int) { + return sovGroup(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Group) 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 ErrIntOverflowGroup + } + 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: Group: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Group: 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Color", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Color = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDefault", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsDefault = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDisplay", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsDisplay = bool(v != 0) + case 6: + 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 ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserCount", wireType) + } + m.UserCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + 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 10: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + 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 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableUpload", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableUpload = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCommentApproval", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCommentApproval = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteGroupRequest) 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 ErrIntOverflowGroup + } + 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: DeleteGroupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteGroupRequest: 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 ErrIntOverflowGroup + } + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + 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 ErrIntOverflowGroup + } + 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 := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetGroupRequest) 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 ErrIntOverflowGroup + } + 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: GetGroupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetGroupRequest: 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListGroupRequest) 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 ErrIntOverflowGroup + } + 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: ListGroupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListGroupRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Page |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowGroup + } + 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 ErrInvalidLengthGroup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListGroupReply) 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 ErrIntOverflowGroup + } + 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: ListGroupReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListGroupReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Group = append(m.Group, &Group{}) + if err := m.Group[len(m.Group)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetGroupPermissionRequest) 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 ErrIntOverflowGroup + } + 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: GetGroupPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetGroupPermissionRequest: 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 ErrIntOverflowGroup + } + 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 := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateGroupPermissionRequest) 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 ErrIntOverflowGroup + } + 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: UpdateGroupPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateGroupPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + m.GroupId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PermissionId = append(m.PermissionId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + 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.PermissionId) == 0 { + m.PermissionId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PermissionId = append(m.PermissionId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PermissionId", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GroupPermissions) 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 ErrIntOverflowGroup + } + 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: GroupPermissions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GroupPermissions: 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 ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PermissionId = append(m.PermissionId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGroup + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGroup + } + 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.PermissionId) == 0 { + m.PermissionId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGroup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PermissionId = append(m.PermissionId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PermissionId", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipGroup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGroup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGroup(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, ErrIntOverflowGroup + } + 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, ErrIntOverflowGroup + } + 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, ErrIntOverflowGroup + } + 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, ErrInvalidLengthGroup + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGroup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGroup + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGroup = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGroup = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGroup = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/group.pb.gw.go b/api/v1/group.pb.gw.go new file mode 100644 index 0000000..6bfd89b --- /dev/null +++ b/api/v1/group.pb.gw.go @@ -0,0 +1,663 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/group.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_GroupAPI_CreateGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Group + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_CreateGroup_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Group + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateGroup(ctx, &protoReq) + return msg, metadata, err + +} + +func request_GroupAPI_UpdateGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Group + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_UpdateGroup_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Group + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateGroup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_GroupAPI_DeleteGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_GroupAPI_DeleteGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteGroupRequest + 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_GroupAPI_DeleteGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_DeleteGroup_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteGroupRequest + 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_GroupAPI_DeleteGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteGroup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_GroupAPI_GetGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_GroupAPI_GetGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGroupRequest + 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_GroupAPI_GetGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_GetGroup_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGroupRequest + 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_GroupAPI_GetGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetGroup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_GroupAPI_ListGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_GroupAPI_ListGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListGroupRequest + 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_GroupAPI_ListGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_ListGroup_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListGroupRequest + 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_GroupAPI_ListGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListGroup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_GroupAPI_GetGroupPermission_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_GroupAPI_GetGroupPermission_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGroupPermissionRequest + 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_GroupAPI_GetGroupPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetGroupPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_GetGroupPermission_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGroupPermissionRequest + 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_GroupAPI_GetGroupPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetGroupPermission(ctx, &protoReq) + return msg, metadata, err + +} + +func request_GroupAPI_UpdateGroupPermission_0(ctx context.Context, marshaler runtime.Marshaler, client GroupAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateGroupPermissionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateGroupPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_GroupAPI_UpdateGroupPermission_0(ctx context.Context, marshaler runtime.Marshaler, server GroupAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateGroupPermissionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateGroupPermission(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterGroupAPIHandlerServer registers the http handlers for service GroupAPI to "mux". +// UnaryRPC :call GroupAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGroupAPIHandlerFromEndpoint instead. +func RegisterGroupAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GroupAPIServer) error { + + mux.Handle("POST", pattern_GroupAPI_CreateGroup_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_CreateGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_CreateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_GroupAPI_UpdateGroup_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_UpdateGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_UpdateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_GroupAPI_DeleteGroup_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_DeleteGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_DeleteGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_GetGroup_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_GetGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_GetGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_ListGroup_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_ListGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_ListGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_GetGroupPermission_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_GetGroupPermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_GetGroupPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_GroupAPI_UpdateGroupPermission_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_GroupAPI_UpdateGroupPermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_UpdateGroupPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterGroupAPIHandlerFromEndpoint is same as RegisterGroupAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterGroupAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterGroupAPIHandler(ctx, mux, conn) +} + +// RegisterGroupAPIHandler registers the http handlers for service GroupAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterGroupAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterGroupAPIHandlerClient(ctx, mux, NewGroupAPIClient(conn)) +} + +// RegisterGroupAPIHandlerClient registers the http handlers for service GroupAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GroupAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GroupAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "GroupAPIClient" to call the correct interceptors. +func RegisterGroupAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GroupAPIClient) error { + + mux.Handle("POST", pattern_GroupAPI_CreateGroup_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_CreateGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_CreateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_GroupAPI_UpdateGroup_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_UpdateGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_UpdateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_GroupAPI_DeleteGroup_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_DeleteGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_DeleteGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_GetGroup_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_GetGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_GetGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_ListGroup_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_ListGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_ListGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_GroupAPI_GetGroupPermission_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_GetGroupPermission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_GetGroupPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_GroupAPI_UpdateGroupPermission_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_GroupAPI_UpdateGroupPermission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_GroupAPI_UpdateGroupPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_GroupAPI_CreateGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "group"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_UpdateGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "group"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_DeleteGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "group"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_GetGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "group"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_ListGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "group", "list"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_GetGroupPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "group", "permission"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_GroupAPI_UpdateGroupPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "group", "permission"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_GroupAPI_CreateGroup_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_UpdateGroup_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_DeleteGroup_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_GetGroup_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_ListGroup_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_GetGroupPermission_0 = runtime.ForwardResponseMessage + + forward_GroupAPI_UpdateGroupPermission_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/health.pb.go b/api/v1/health.pb.go new file mode 100644 index 0000000..2bd21c8 --- /dev/null +++ b/api/v1/health.pb.go @@ -0,0 +1,679 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/health.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 PingRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *PingRequest) Reset() { *m = PingRequest{} } +func (m *PingRequest) String() string { return proto.CompactTextString(m) } +func (*PingRequest) ProtoMessage() {} +func (*PingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f530b02e2e7cc3b8, []int{0} +} +func (m *PingRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PingRequest.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 *PingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PingRequest.Merge(m, src) +} +func (m *PingRequest) XXX_Size() int { + return m.Size() +} +func (m *PingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PingRequest proto.InternalMessageInfo + +func (m *PingRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type PongReply struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` +} + +func (m *PongReply) Reset() { *m = PongReply{} } +func (m *PongReply) String() string { return proto.CompactTextString(m) } +func (*PongReply) ProtoMessage() {} +func (*PongReply) Descriptor() ([]byte, []int) { + return fileDescriptor_f530b02e2e7cc3b8, []int{1} +} +func (m *PongReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PongReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PongReply.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 *PongReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_PongReply.Merge(m, src) +} +func (m *PongReply) XXX_Size() int { + return m.Size() +} +func (m *PongReply) XXX_DiscardUnknown() { + xxx_messageInfo_PongReply.DiscardUnknown(m) +} + +var xxx_messageInfo_PongReply proto.InternalMessageInfo + +func (m *PongReply) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PongReply) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func init() { + proto.RegisterType((*PingRequest)(nil), "PingRequest") + proto.RegisterType((*PongReply)(nil), "PongReply") +} + +func init() { proto.RegisterFile("api/v1/health.proto", fileDescriptor_f530b02e2e7cc3b8) } + +var fileDescriptor_f530b02e2e7cc3b8 = []byte{ + // 319 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x2c, 0xc8, 0xd4, + 0x2f, 0x33, 0xd4, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x97, + 0x92, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xf3, 0x92, 0x4a, 0xd3, 0xf4, 0x4b, 0x32, + 0x73, 0x53, 0x8b, 0x4b, 0x12, 0x73, 0x0b, 0xa0, 0x0a, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, + 0x7d, 0x10, 0x0b, 0x2a, 0x2a, 0x03, 0xd5, 0x06, 0x32, 0x32, 0x31, 0x2f, 0x2f, 0xbf, 0x24, 0xb1, + 0x24, 0x33, 0x3f, 0xaf, 0x18, 0x2a, 0x2b, 0x8d, 0x6e, 0x68, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, + 0x52, 0x49, 0x91, 0x8b, 0x3b, 0x20, 0x33, 0x2f, 0x3d, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, + 0x48, 0x88, 0x8b, 0x25, 0x2f, 0x31, 0x37, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, + 0x56, 0x4a, 0xe0, 0xe2, 0x0c, 0xc8, 0x07, 0x29, 0x29, 0xc8, 0xa9, 0xc4, 0xa6, 0x40, 0xc8, 0x9e, + 0x8b, 0x2b, 0xb9, 0x28, 0x35, 0xb1, 0x24, 0x35, 0x25, 0x3e, 0xb1, 0x44, 0x82, 0x49, 0x81, 0x51, + 0x83, 0xdb, 0x48, 0x4a, 0x0f, 0x62, 0xab, 0x1e, 0xcc, 0x56, 0xbd, 0x10, 0x98, 0x57, 0x9c, 0x58, + 0x26, 0xdc, 0x97, 0x67, 0x0c, 0xe2, 0x84, 0xea, 0x71, 0x2c, 0x31, 0xea, 0x63, 0xe4, 0xe2, 0xf4, + 0x00, 0x87, 0x83, 0x63, 0x80, 0xa7, 0x90, 0x27, 0x17, 0x1b, 0x84, 0x23, 0x24, 0x86, 0x61, 0x88, + 0x2b, 0xc8, 0xe9, 0x52, 0x38, 0xc4, 0x95, 0xf8, 0x9b, 0x2e, 0x3f, 0x99, 0xcc, 0xc4, 0x29, 0xc4, + 0x0e, 0x0d, 0x55, 0x21, 0x33, 0x2e, 0x16, 0x90, 0xef, 0x84, 0x78, 0xf4, 0x90, 0x3c, 0x29, 0xc5, + 0xa5, 0x07, 0xf7, 0x8f, 0x92, 0x08, 0x58, 0x0b, 0x9f, 0x10, 0x8f, 0x3e, 0x34, 0x3e, 0x0a, 0x32, + 0xf3, 0xd2, 0x9d, 0xb4, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, + 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x30, + 0x37, 0xbf, 0x28, 0x35, 0x25, 0x3f, 0x19, 0xaa, 0xdc, 0xba, 0xcc, 0x30, 0x89, 0x0d, 0xec, 0x0a, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x8b, 0x1f, 0x4e, 0xd2, 0x01, 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 + +// HealthAPIClient is the client API for HealthAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type HealthAPIClient interface { + Health(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongReply, error) +} + +type healthAPIClient struct { + cc *grpc.ClientConn +} + +func NewHealthAPIClient(cc *grpc.ClientConn) HealthAPIClient { + return &healthAPIClient{cc} +} + +func (c *healthAPIClient) Health(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/HealthAPI/Health", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *healthAPIClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongReply, error) { + out := new(PongReply) + err := c.cc.Invoke(ctx, "/HealthAPI/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HealthAPIServer is the server API for HealthAPI service. +type HealthAPIServer interface { + Health(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + Ping(context.Context, *PingRequest) (*PongReply, error) +} + +// UnimplementedHealthAPIServer can be embedded to have forward compatible implementations. +type UnimplementedHealthAPIServer struct { +} + +func (*UnimplementedHealthAPIServer) Health(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Health not implemented") +} +func (*UnimplementedHealthAPIServer) Ping(ctx context.Context, req *PingRequest) (*PongReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} + +func RegisterHealthAPIServer(s *grpc.Server, srv HealthAPIServer) { + s.RegisterService(&_HealthAPI_serviceDesc, srv) +} + +func _HealthAPI_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthAPIServer).Health(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/HealthAPI/Health", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthAPIServer).Health(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _HealthAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthAPIServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/HealthAPI/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthAPIServer).Ping(ctx, req.(*PingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _HealthAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "HealthAPI", + HandlerType: (*HealthAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Health", + Handler: _HealthAPI_Health_Handler, + }, + { + MethodName: "Ping", + Handler: _HealthAPI_Ping_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/health.proto", +} + +func (m *PingRequest) 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 *PingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintHealth(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PongReply) 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 *PongReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PongReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreatedAt != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintHealth(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintHealth(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintHealth(dAtA []byte, offset int, v uint64) int { + offset -= sovHealth(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovHealth(uint64(l)) + } + return n +} + +func (m *PongReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovHealth(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovHealth(uint64(l)) + } + return n +} + +func sovHealth(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHealth(x uint64) (n int) { + return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PingRequest) 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 ErrIntOverflowHealth + } + 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: PingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PingRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealth + } + 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 ErrInvalidLengthHealth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHealth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHealth + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PongReply) 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 ErrIntOverflowHealth + } + 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: PongReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PongReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealth + } + 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 ErrInvalidLengthHealth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowHealth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealth + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealth + } + 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 + default: + iNdEx = preIndex + skippy, err := skipHealth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHealth + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHealth(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, ErrIntOverflowHealth + } + 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, ErrIntOverflowHealth + } + 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, ErrIntOverflowHealth + } + 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, ErrInvalidLengthHealth + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHealth + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthHealth + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/health.pb.gw.go b/api/v1/health.pb.gw.go new file mode 100644 index 0000000..0fcc026 --- /dev/null +++ b/api/v1/health.pb.gw.go @@ -0,0 +1,237 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/health.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_HealthAPI_Health_0(ctx context.Context, marshaler runtime.Marshaler, client HealthAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.Health(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HealthAPI_Health_0(ctx context.Context, marshaler runtime.Marshaler, server HealthAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.Health(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_HealthAPI_Ping_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_HealthAPI_Ping_0(ctx context.Context, marshaler runtime.Marshaler, client HealthAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PingRequest + 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_HealthAPI_Ping_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Ping(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HealthAPI_Ping_0(ctx context.Context, marshaler runtime.Marshaler, server HealthAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PingRequest + 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_HealthAPI_Ping_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Ping(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterHealthAPIHandlerServer registers the http handlers for service HealthAPI to "mux". +// UnaryRPC :call HealthAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthAPIHandlerFromEndpoint instead. +func RegisterHealthAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthAPIServer) error { + + mux.Handle("GET", pattern_HealthAPI_Health_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HealthAPI_Health_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthAPI_Health_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HealthAPI_Ping_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HealthAPI_Ping_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthAPI_Ping_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterHealthAPIHandlerFromEndpoint is same as RegisterHealthAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterHealthAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterHealthAPIHandler(ctx, mux, conn) +} + +// RegisterHealthAPIHandler registers the http handlers for service HealthAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterHealthAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterHealthAPIHandlerClient(ctx, mux, NewHealthAPIClient(conn)) +} + +// RegisterHealthAPIHandlerClient registers the http handlers for service HealthAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "HealthAPIClient" to call the correct interceptors. +func RegisterHealthAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthAPIClient) error { + + mux.Handle("GET", pattern_HealthAPI_Health_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HealthAPI_Health_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthAPI_Health_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HealthAPI_Ping_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HealthAPI_Ping_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthAPI_Ping_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_HealthAPI_Health_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"health"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_HealthAPI_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "ping"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_HealthAPI_Health_0 = runtime.ForwardResponseMessage + + forward_HealthAPI_Ping_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/permission.pb.go b/api/v1/permission.pb.go new file mode 100644 index 0000000..91b64d7 --- /dev/null +++ b/api/v1/permission.pb.go @@ -0,0 +1,1930 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/permission.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 Permission struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Permission) Reset() { *m = Permission{} } +func (m *Permission) String() string { return proto.CompactTextString(m) } +func (*Permission) ProtoMessage() {} +func (*Permission) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{0} +} +func (m *Permission) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Permission.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 *Permission) XXX_Merge(src proto.Message) { + xxx_messageInfo_Permission.Merge(m, src) +} +func (m *Permission) XXX_Size() int { + return m.Size() +} +func (m *Permission) XXX_DiscardUnknown() { + xxx_messageInfo_Permission.DiscardUnknown(m) +} + +var xxx_messageInfo_Permission proto.InternalMessageInfo + +func (m *Permission) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Permission) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *Permission) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Permission) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Permission) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Permission) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Permission) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type DeletePermissionRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeletePermissionRequest) Reset() { *m = DeletePermissionRequest{} } +func (m *DeletePermissionRequest) String() string { return proto.CompactTextString(m) } +func (*DeletePermissionRequest) ProtoMessage() {} +func (*DeletePermissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{1} +} +func (m *DeletePermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeletePermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeletePermissionRequest.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 *DeletePermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeletePermissionRequest.Merge(m, src) +} +func (m *DeletePermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *DeletePermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeletePermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeletePermissionRequest proto.InternalMessageInfo + +func (m *DeletePermissionRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetPermissionRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetPermissionRequest) Reset() { *m = GetPermissionRequest{} } +func (m *GetPermissionRequest) String() string { return proto.CompactTextString(m) } +func (*GetPermissionRequest) ProtoMessage() {} +func (*GetPermissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{2} +} +func (m *GetPermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetPermissionRequest.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 *GetPermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPermissionRequest.Merge(m, src) +} +func (m *GetPermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *GetPermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPermissionRequest proto.InternalMessageInfo + +func (m *GetPermissionRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type GetPermissionReply struct { + Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *GetPermissionReply) Reset() { *m = GetPermissionReply{} } +func (m *GetPermissionReply) String() string { return proto.CompactTextString(m) } +func (*GetPermissionReply) ProtoMessage() {} +func (*GetPermissionReply) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{3} +} +func (m *GetPermissionReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetPermissionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetPermissionReply.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 *GetPermissionReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPermissionReply.Merge(m, src) +} +func (m *GetPermissionReply) XXX_Size() int { + return m.Size() +} +func (m *GetPermissionReply) XXX_DiscardUnknown() { + xxx_messageInfo_GetPermissionReply.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPermissionReply proto.InternalMessageInfo + +func (m *GetPermissionReply) GetPermission() *Permission { + if m != nil { + return m.Permission + } + return nil +} + +type ListPermissionRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Method []string `protobuf:"bytes,4,rep,name=method,proto3" json:"method,omitempty"` + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` +} + +func (m *ListPermissionRequest) Reset() { *m = ListPermissionRequest{} } +func (m *ListPermissionRequest) String() string { return proto.CompactTextString(m) } +func (*ListPermissionRequest) ProtoMessage() {} +func (*ListPermissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{4} +} +func (m *ListPermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListPermissionRequest.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 *ListPermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPermissionRequest.Merge(m, src) +} +func (m *ListPermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *ListPermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListPermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPermissionRequest proto.InternalMessageInfo + +func (m *ListPermissionRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListPermissionRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListPermissionRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListPermissionRequest) GetMethod() []string { + if m != nil { + return m.Method + } + return nil +} + +func (m *ListPermissionRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +type ListPermissionReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Permission []*Permission `protobuf:"bytes,2,rep,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *ListPermissionReply) Reset() { *m = ListPermissionReply{} } +func (m *ListPermissionReply) String() string { return proto.CompactTextString(m) } +func (*ListPermissionReply) ProtoMessage() {} +func (*ListPermissionReply) Descriptor() ([]byte, []int) { + return fileDescriptor_6f5311b1c95edab2, []int{5} +} +func (m *ListPermissionReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListPermissionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListPermissionReply.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 *ListPermissionReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPermissionReply.Merge(m, src) +} +func (m *ListPermissionReply) XXX_Size() int { + return m.Size() +} +func (m *ListPermissionReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListPermissionReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPermissionReply proto.InternalMessageInfo + +func (m *ListPermissionReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListPermissionReply) GetPermission() []*Permission { + if m != nil { + return m.Permission + } + return nil +} + +func init() { + proto.RegisterType((*Permission)(nil), "api.v1.Permission") + proto.RegisterType((*DeletePermissionRequest)(nil), "api.v1.DeletePermissionRequest") + proto.RegisterType((*GetPermissionRequest)(nil), "api.v1.GetPermissionRequest") + proto.RegisterType((*GetPermissionReply)(nil), "api.v1.GetPermissionReply") + proto.RegisterType((*ListPermissionRequest)(nil), "api.v1.ListPermissionRequest") + proto.RegisterType((*ListPermissionReply)(nil), "api.v1.ListPermissionReply") +} + +func init() { proto.RegisterFile("api/v1/permission.proto", fileDescriptor_6f5311b1c95edab2) } + +var fileDescriptor_6f5311b1c95edab2 = []byte{ + // 549 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x76, 0x12, 0xd4, 0x89, 0x5a, 0xc1, 0x12, 0x1a, 0xe3, 0xb6, 0x8e, 0xe5, 0x03, + 0x0a, 0x1c, 0x6c, 0x25, 0x88, 0x0b, 0x1c, 0x50, 0x2a, 0x10, 0x20, 0x71, 0x88, 0x22, 0xb8, 0x20, + 0x55, 0x95, 0x1b, 0x2f, 0xe9, 0x4a, 0x76, 0x76, 0xb1, 0x37, 0xa9, 0x02, 0xb7, 0x3e, 0x41, 0x25, + 0x5e, 0x87, 0x07, 0xe0, 0x58, 0x89, 0x0b, 0x37, 0x50, 0xc2, 0x83, 0x20, 0xaf, 0xd7, 0x8d, 0x9b, + 0xb8, 0x82, 0xdb, 0xec, 0xcc, 0xec, 0xff, 0xcf, 0xce, 0xe7, 0x04, 0x5a, 0x3e, 0xa7, 0xde, 0xac, + 0xeb, 0x71, 0x12, 0x47, 0x34, 0x49, 0x28, 0x9b, 0xb8, 0x3c, 0x66, 0x82, 0xe1, 0xba, 0xcf, 0xa9, + 0x3b, 0xeb, 0x9a, 0xed, 0x31, 0x63, 0xe3, 0x90, 0x78, 0x32, 0x7b, 0x32, 0xfd, 0xe8, 0x09, 0x1a, + 0x91, 0x44, 0xf8, 0x11, 0xcf, 0x1a, 0xcd, 0xe6, 0x98, 0x8d, 0x99, 0x0c, 0xbd, 0x34, 0x52, 0xd9, + 0x7d, 0x75, 0x2d, 0x95, 0xf7, 0x27, 0x13, 0x26, 0x7c, 0x41, 0xd9, 0x24, 0x51, 0xd5, 0xbd, 0x75, + 0x51, 0x12, 0x71, 0x31, 0xcf, 0x8a, 0xce, 0xb9, 0x06, 0x30, 0xb8, 0x1a, 0x07, 0xef, 0x80, 0x46, + 0x03, 0x03, 0xd9, 0xa8, 0xa3, 0x0f, 0x35, 0x1a, 0xe0, 0x5d, 0xa8, 0x47, 0x44, 0x9c, 0xb2, 0xc0, + 0xd0, 0x6c, 0xd4, 0xd9, 0x1a, 0xaa, 0x13, 0xc6, 0x50, 0xe5, 0xbe, 0x38, 0x35, 0x74, 0x99, 0x95, + 0x31, 0x6e, 0x42, 0x4d, 0x50, 0x11, 0x12, 0xa3, 0x2a, 0x93, 0xd9, 0x01, 0xdb, 0xd0, 0x08, 0x48, + 0x32, 0x8a, 0x29, 0x4f, 0x67, 0x32, 0x6a, 0xb2, 0x56, 0x4c, 0xe1, 0xe7, 0x00, 0xa3, 0x98, 0xf8, + 0x82, 0x04, 0xc7, 0xbe, 0x30, 0xea, 0x36, 0xea, 0x34, 0x7a, 0xa6, 0x9b, 0x0d, 0xed, 0xe6, 0x43, + 0xbb, 0xef, 0xf2, 0x4d, 0x1c, 0x56, 0x2f, 0x7e, 0xb5, 0xd1, 0x70, 0x4b, 0xdd, 0xe9, 0x8b, 0x54, + 0x60, 0xca, 0x83, 0x5c, 0xe0, 0xd6, 0xff, 0x0a, 0xa8, 0x3b, 0x7d, 0xe1, 0x3c, 0x84, 0xd6, 0x0b, + 0x12, 0x12, 0x41, 0x56, 0x9b, 0x18, 0x92, 0x4f, 0x53, 0x92, 0x88, 0xab, 0x85, 0xe8, 0xd9, 0x42, + 0x9c, 0x07, 0xd0, 0x7c, 0x45, 0xc4, 0xcd, 0x7d, 0x6a, 0x71, 0xce, 0x6b, 0xc0, 0x6b, 0x7d, 0x3c, + 0x9c, 0xe3, 0x1e, 0xc0, 0x8a, 0xbd, 0xec, 0x6e, 0xf4, 0xb0, 0x9b, 0xc1, 0x77, 0x0b, 0xcd, 0x85, + 0x2e, 0xe7, 0x0b, 0xdc, 0x7b, 0x4b, 0x93, 0x12, 0x4b, 0xc9, 0x60, 0x4c, 0x94, 0xa9, 0x8c, 0xd3, + 0x5c, 0x42, 0x3f, 0x13, 0x49, 0x4b, 0x1f, 0xca, 0x38, 0x1d, 0xed, 0x2c, 0x50, 0xa4, 0xb4, 0xb3, + 0x22, 0xd3, 0xaa, 0xad, 0x97, 0x30, 0xad, 0xad, 0x98, 0x3a, 0xc7, 0x70, 0x77, 0xdd, 0x3c, 0x7d, + 0x47, 0x8a, 0x9a, 0x09, 0x3f, 0x54, 0xde, 0xd9, 0x61, 0xed, 0x75, 0x9a, 0xad, 0xff, 0xfb, 0x75, + 0xbd, 0x6f, 0x1a, 0x6c, 0xaf, 0x4a, 0xfd, 0xc1, 0x1b, 0x7c, 0x04, 0xb7, 0xdf, 0x4b, 0x32, 0x85, + 0xcf, 0xb2, 0x44, 0xc5, 0xdc, 0xdd, 0x20, 0xfc, 0x32, 0xfd, 0xae, 0x9d, 0x83, 0xf3, 0x1f, 0x7f, + 0xbe, 0x6a, 0x2d, 0x13, 0x7b, 0x1b, 0xbf, 0xb6, 0xa7, 0xe8, 0x11, 0x3e, 0x82, 0xed, 0x6b, 0x60, + 0xf0, 0x7e, 0xae, 0x5d, 0xc6, 0xd5, 0x2c, 0x71, 0x76, 0x4c, 0xe9, 0xd0, 0xc4, 0x25, 0x0e, 0x38, + 0x82, 0x9d, 0xeb, 0x0b, 0xc3, 0x07, 0xb9, 0x42, 0x29, 0x45, 0x73, 0xef, 0xa6, 0x32, 0x0f, 0xe7, + 0x4e, 0x5b, 0x3a, 0xdd, 0xc7, 0xad, 0x4d, 0x27, 0x2f, 0xa4, 0x89, 0x38, 0x7c, 0xf2, 0x7d, 0x61, + 0xa1, 0xcb, 0x85, 0x85, 0x7e, 0x2f, 0x2c, 0x74, 0xb1, 0xb4, 0x2a, 0x97, 0x4b, 0xab, 0xf2, 0x73, + 0x69, 0x55, 0x40, 0xfd, 0xa5, 0x0c, 0xd0, 0x87, 0x3b, 0x11, 0x8b, 0x49, 0xc0, 0x46, 0x4a, 0xe3, + 0xd9, 0xac, 0x7b, 0x52, 0x97, 0x3b, 0x7b, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xc9, 0x53, + 0xe7, 0x91, 0x04, 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 + +// PermissionAPIClient is the client API for PermissionAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type PermissionAPIClient interface { + UpdatePermission(ctx context.Context, in *Permission, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error) + ListPermission(ctx context.Context, in *ListPermissionRequest, opts ...grpc.CallOption) (*ListPermissionReply, error) +} + +type permissionAPIClient struct { + cc *grpc.ClientConn +} + +func NewPermissionAPIClient(cc *grpc.ClientConn) PermissionAPIClient { + return &permissionAPIClient{cc} +} + +func (c *permissionAPIClient) UpdatePermission(ctx context.Context, in *Permission, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/UpdatePermission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionAPIClient) GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error) { + out := new(Permission) + err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/GetPermission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionAPIClient) ListPermission(ctx context.Context, in *ListPermissionRequest, opts ...grpc.CallOption) (*ListPermissionReply, error) { + out := new(ListPermissionReply) + err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/ListPermission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PermissionAPIServer is the server API for PermissionAPI service. +type PermissionAPIServer interface { + UpdatePermission(context.Context, *Permission) (*emptypb.Empty, error) + GetPermission(context.Context, *GetPermissionRequest) (*Permission, error) + ListPermission(context.Context, *ListPermissionRequest) (*ListPermissionReply, error) +} + +// UnimplementedPermissionAPIServer can be embedded to have forward compatible implementations. +type UnimplementedPermissionAPIServer struct { +} + +func (*UnimplementedPermissionAPIServer) UpdatePermission(ctx context.Context, req *Permission) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePermission not implemented") +} +func (*UnimplementedPermissionAPIServer) GetPermission(ctx context.Context, req *GetPermissionRequest) (*Permission, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPermission not implemented") +} +func (*UnimplementedPermissionAPIServer) ListPermission(ctx context.Context, req *ListPermissionRequest) (*ListPermissionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPermission not implemented") +} + +func RegisterPermissionAPIServer(s *grpc.Server, srv PermissionAPIServer) { + s.RegisterService(&_PermissionAPI_serviceDesc, srv) +} + +func _PermissionAPI_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Permission) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionAPIServer).UpdatePermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PermissionAPI/UpdatePermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionAPIServer).UpdatePermission(ctx, req.(*Permission)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionAPI_GetPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionAPIServer).GetPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PermissionAPI/GetPermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionAPIServer).GetPermission(ctx, req.(*GetPermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionAPI_ListPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionAPIServer).ListPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PermissionAPI/ListPermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionAPIServer).ListPermission(ctx, req.(*ListPermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _PermissionAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.PermissionAPI", + HandlerType: (*PermissionAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdatePermission", + Handler: _PermissionAPI_UpdatePermission_Handler, + }, + { + MethodName: "GetPermission", + Handler: _PermissionAPI_GetPermission_Handler, + }, + { + MethodName: "ListPermission", + Handler: _PermissionAPI_ListPermission_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/permission.proto", +} + +func (m *Permission) 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 *Permission) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 = encodeVarintPermission(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + } + 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 = encodeVarintPermission(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x22 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x1a + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintPermission(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeletePermissionRequest) 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 *DeletePermissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeletePermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintPermission(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetPermissionRequest) 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 *GetPermissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintPermission(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetPermissionReply) 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 *GetPermissionReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetPermissionReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Permission != nil { + { + size, err := m.Permission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPermission(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListPermissionRequest) 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 *ListPermissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x2a + } + if len(m.Method) > 0 { + for iNdEx := len(m.Method) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Method[iNdEx]) + copy(dAtA[i:], m.Method[iNdEx]) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Method[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintPermission(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintPermission(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintPermission(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListPermissionReply) 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 *ListPermissionReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListPermissionReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permission) > 0 { + for iNdEx := len(m.Permission) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Permission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPermission(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintPermission(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPermission(dAtA []byte, offset int, v uint64) int { + offset -= sovPermission(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Permission) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovPermission(uint64(m.Id)) + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovPermission(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovPermission(uint64(l)) + } + return n +} + +func (m *DeletePermissionRequest) 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 += sovPermission(uint64(e)) + } + n += 1 + sovPermission(uint64(l)) + l + } + return n +} + +func (m *GetPermissionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovPermission(uint64(m.Id)) + } + return n +} + +func (m *GetPermissionReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Permission != nil { + l = m.Permission.Size() + n += 1 + l + sovPermission(uint64(l)) + } + return n +} + +func (m *ListPermissionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovPermission(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovPermission(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + if len(m.Method) > 0 { + for _, s := range m.Method { + l = len(s) + n += 1 + l + sovPermission(uint64(l)) + } + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovPermission(uint64(l)) + } + return n +} + +func (m *ListPermissionReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovPermission(uint64(m.Total)) + } + if len(m.Permission) > 0 { + for _, e := range m.Permission { + l = e.Size() + n += 1 + l + sovPermission(uint64(l)) + } + } + return n +} + +func sovPermission(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPermission(x uint64) (n int) { + return sovPermission(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Permission) 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 ErrIntOverflowPermission + } + 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: Permission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Permission: 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 ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + 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 ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPermission + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + 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 7: + 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 ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPermission + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + 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 + default: + iNdEx = preIndex + skippy, err := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeletePermissionRequest) 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 ErrIntOverflowPermission + } + 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: DeletePermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeletePermissionRequest: 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 ErrIntOverflowPermission + } + 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 ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthPermission + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + 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 ErrIntOverflowPermission + } + 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 := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetPermissionRequest) 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 ErrIntOverflowPermission + } + 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: GetPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetPermissionRequest: 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 ErrIntOverflowPermission + } + 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 := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetPermissionReply) 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 ErrIntOverflowPermission + } + 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: GetPermissionReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetPermissionReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPermission + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Permission == nil { + m.Permission = &Permission{} + } + if err := m.Permission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListPermissionRequest) 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 ErrIntOverflowPermission + } + 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: ListPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListPermissionRequest: 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 ErrIntOverflowPermission + } + 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 ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = append(m.Method, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + 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 ErrInvalidLengthPermission + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListPermissionReply) 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 ErrIntOverflowPermission + } + 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: ListPermissionReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListPermissionReply: 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 ErrIntOverflowPermission + } + 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 Permission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPermission + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPermission + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPermission + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = append(m.Permission, &Permission{}) + if err := m.Permission[len(m.Permission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPermission(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPermission + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPermission(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, ErrIntOverflowPermission + } + 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, ErrIntOverflowPermission + } + 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, ErrIntOverflowPermission + } + 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, ErrInvalidLengthPermission + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPermission + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPermission + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPermission = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPermission = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPermission = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/permission.pb.gw.go b/api/v1/permission.pb.gw.go new file mode 100644 index 0000000..6c29cbf --- /dev/null +++ b/api/v1/permission.pb.gw.go @@ -0,0 +1,335 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/permission.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_PermissionAPI_UpdatePermission_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Permission + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdatePermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PermissionAPI_UpdatePermission_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Permission + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdatePermission(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_PermissionAPI_GetPermission_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_PermissionAPI_GetPermission_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPermissionRequest + 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_PermissionAPI_GetPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PermissionAPI_GetPermission_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPermissionRequest + 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_PermissionAPI_GetPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPermission(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_PermissionAPI_ListPermission_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_PermissionAPI_ListPermission_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPermissionRequest + 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_PermissionAPI_ListPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PermissionAPI_ListPermission_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPermissionRequest + 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_PermissionAPI_ListPermission_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListPermission(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterPermissionAPIHandlerServer registers the http handlers for service PermissionAPI to "mux". +// UnaryRPC :call PermissionAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPermissionAPIHandlerFromEndpoint instead. +func RegisterPermissionAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PermissionAPIServer) error { + + mux.Handle("PUT", pattern_PermissionAPI_UpdatePermission_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PermissionAPI_UpdatePermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_UpdatePermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PermissionAPI_GetPermission_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PermissionAPI_GetPermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_GetPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PermissionAPI_ListPermission_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PermissionAPI_ListPermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_ListPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterPermissionAPIHandlerFromEndpoint is same as RegisterPermissionAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterPermissionAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterPermissionAPIHandler(ctx, mux, conn) +} + +// RegisterPermissionAPIHandler registers the http handlers for service PermissionAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterPermissionAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterPermissionAPIHandlerClient(ctx, mux, NewPermissionAPIClient(conn)) +} + +// RegisterPermissionAPIHandlerClient registers the http handlers for service PermissionAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PermissionAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PermissionAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "PermissionAPIClient" to call the correct interceptors. +func RegisterPermissionAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PermissionAPIClient) error { + + mux.Handle("PUT", pattern_PermissionAPI_UpdatePermission_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PermissionAPI_UpdatePermission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_UpdatePermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PermissionAPI_GetPermission_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PermissionAPI_GetPermission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_GetPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PermissionAPI_ListPermission_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PermissionAPI_ListPermission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PermissionAPI_ListPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_PermissionAPI_UpdatePermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "permission"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_PermissionAPI_GetPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "permission"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_PermissionAPI_ListPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "permission", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_PermissionAPI_UpdatePermission_0 = runtime.ForwardResponseMessage + + forward_PermissionAPI_GetPermission_0 = runtime.ForwardResponseMessage + + forward_PermissionAPI_ListPermission_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/report.pb.go b/api/v1/report.pb.go new file mode 100644 index 0000000..c4418b1 --- /dev/null +++ b/api/v1/report.pb.go @@ -0,0 +1,1826 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/report.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 + +// 这里是proto文件中的结构体,可以根据需要删除或者调整 +type Report struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + DocumentId int64 `protobuf:"varint,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Reason int32 `protobuf:"varint,4,opt,name=reason,proto3" json:"reason,omitempty"` + Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` + DocumentTitle string `protobuf:"bytes,8,opt,name=document_title,json=documentTitle,proto3" json:"document_title,omitempty"` + Remark string `protobuf:"bytes,9,opt,name=remark,proto3" json:"remark,omitempty"` + Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"` +} + +func (m *Report) Reset() { *m = Report{} } +func (m *Report) String() string { return proto.CompactTextString(m) } +func (*Report) ProtoMessage() {} +func (*Report) Descriptor() ([]byte, []int) { + return fileDescriptor_1e440702eea137dd, []int{0} +} +func (m *Report) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Report) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Report.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 *Report) XXX_Merge(src proto.Message) { + xxx_messageInfo_Report.Merge(m, src) +} +func (m *Report) XXX_Size() int { + return m.Size() +} +func (m *Report) XXX_DiscardUnknown() { + xxx_messageInfo_Report.DiscardUnknown(m) +} + +var xxx_messageInfo_Report proto.InternalMessageInfo + +func (m *Report) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Report) GetDocumentId() int64 { + if m != nil { + return m.DocumentId + } + return 0 +} + +func (m *Report) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Report) GetReason() int32 { + if m != nil { + return m.Reason + } + return 0 +} + +func (m *Report) GetStatus() bool { + if m != nil { + return m.Status + } + return false +} + +func (m *Report) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Report) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +func (m *Report) GetDocumentTitle() string { + if m != nil { + return m.DocumentTitle + } + return "" +} + +func (m *Report) GetRemark() string { + if m != nil { + return m.Remark + } + return "" +} + +func (m *Report) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +type DeleteReportRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteReportRequest) Reset() { *m = DeleteReportRequest{} } +func (m *DeleteReportRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteReportRequest) ProtoMessage() {} +func (*DeleteReportRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e440702eea137dd, []int{1} +} +func (m *DeleteReportRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteReportRequest.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 *DeleteReportRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteReportRequest.Merge(m, src) +} +func (m *DeleteReportRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteReportRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteReportRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteReportRequest proto.InternalMessageInfo + +func (m *DeleteReportRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type ListReportRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Field []string `protobuf:"bytes,4,rep,name=field,proto3" json:"field,omitempty"` + Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"` + Status []bool `protobuf:"varint,6,rep,packed,name=status,proto3" json:"status,omitempty"` +} + +func (m *ListReportRequest) Reset() { *m = ListReportRequest{} } +func (m *ListReportRequest) String() string { return proto.CompactTextString(m) } +func (*ListReportRequest) ProtoMessage() {} +func (*ListReportRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e440702eea137dd, []int{2} +} +func (m *ListReportRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListReportRequest.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 *ListReportRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListReportRequest.Merge(m, src) +} +func (m *ListReportRequest) XXX_Size() int { + return m.Size() +} +func (m *ListReportRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListReportRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListReportRequest proto.InternalMessageInfo + +func (m *ListReportRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListReportRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListReportRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListReportRequest) GetField() []string { + if m != nil { + return m.Field + } + return nil +} + +func (m *ListReportRequest) GetOrder() string { + if m != nil { + return m.Order + } + return "" +} + +func (m *ListReportRequest) GetStatus() []bool { + if m != nil { + return m.Status + } + return nil +} + +type ListReportReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Report []*Report `protobuf:"bytes,2,rep,name=report,proto3" json:"report,omitempty"` +} + +func (m *ListReportReply) Reset() { *m = ListReportReply{} } +func (m *ListReportReply) String() string { return proto.CompactTextString(m) } +func (*ListReportReply) ProtoMessage() {} +func (*ListReportReply) Descriptor() ([]byte, []int) { + return fileDescriptor_1e440702eea137dd, []int{3} +} +func (m *ListReportReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListReportReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListReportReply.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 *ListReportReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListReportReply.Merge(m, src) +} +func (m *ListReportReply) XXX_Size() int { + return m.Size() +} +func (m *ListReportReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListReportReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListReportReply proto.InternalMessageInfo + +func (m *ListReportReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListReportReply) GetReport() []*Report { + if m != nil { + return m.Report + } + return nil +} + +func init() { + proto.RegisterType((*Report)(nil), "api.v1.Report") + proto.RegisterType((*DeleteReportRequest)(nil), "api.v1.DeleteReportRequest") + proto.RegisterType((*ListReportRequest)(nil), "api.v1.ListReportRequest") + proto.RegisterType((*ListReportReply)(nil), "api.v1.ListReportReply") +} + +func init() { proto.RegisterFile("api/v1/report.proto", fileDescriptor_1e440702eea137dd) } + +var fileDescriptor_1e440702eea137dd = []byte{ + // 606 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x4f, 0xd5, 0x4c, + 0x14, 0xc6, 0x99, 0xf6, 0x52, 0xe8, 0xc0, 0x7b, 0x5f, 0x99, 0x8b, 0x50, 0x8a, 0x29, 0x4d, 0x13, + 0x4c, 0xc3, 0xa2, 0x0d, 0x18, 0x37, 0xba, 0x30, 0xa0, 0x2e, 0x48, 0x4c, 0xc4, 0x06, 0x37, 0x1a, + 0x43, 0x06, 0x66, 0xb8, 0x99, 0xd8, 0x76, 0x6a, 0x3b, 0x85, 0xe0, 0xd2, 0x2f, 0x20, 0x89, 0x5f, + 0xca, 0x25, 0x89, 0x1b, 0x77, 0x18, 0x70, 0xeb, 0x77, 0x30, 0xf3, 0xa7, 0xc0, 0x05, 0x4c, 0x8c, + 0xbb, 0x39, 0xcf, 0xd3, 0xf3, 0xcb, 0x99, 0xf3, 0xcc, 0xbd, 0x70, 0x80, 0x2b, 0x96, 0x1e, 0xac, + 0xa6, 0x35, 0xad, 0x78, 0x2d, 0x92, 0xaa, 0xe6, 0x82, 0x23, 0x07, 0x57, 0x2c, 0x39, 0x58, 0xf5, + 0x97, 0x86, 0x9c, 0x0f, 0x73, 0x9a, 0x2a, 0x75, 0xb7, 0xdd, 0x4f, 0x05, 0x2b, 0x68, 0x23, 0x70, + 0x51, 0xe9, 0x0f, 0xfd, 0xd9, 0x21, 0x1f, 0x72, 0x75, 0x4c, 0xe5, 0xc9, 0xa8, 0xf7, 0x4c, 0x9b, + 0x44, 0xe3, 0xb2, 0xe4, 0x02, 0x0b, 0xc6, 0xcb, 0xc6, 0xb8, 0x8b, 0xd7, 0xa1, 0xb4, 0xa8, 0xc4, + 0x91, 0x36, 0xa3, 0x53, 0x0b, 0x3a, 0x99, 0x1a, 0x05, 0xf5, 0xa1, 0xc5, 0x88, 0x07, 0x42, 0x10, + 0xdb, 0x99, 0xc5, 0x08, 0x5a, 0x82, 0x53, 0x84, 0xef, 0xb5, 0x05, 0x2d, 0xc5, 0x0e, 0x23, 0x9e, + 0xa5, 0x0c, 0xd8, 0x49, 0x9b, 0x04, 0xcd, 0xc3, 0x89, 0xb6, 0xa1, 0xb5, 0x34, 0x6d, 0x65, 0x3a, + 0xb2, 0xdc, 0x24, 0x68, 0x0e, 0x3a, 0x35, 0xc5, 0x0d, 0x2f, 0xbd, 0x5e, 0x08, 0xe2, 0xf1, 0xcc, + 0x54, 0x52, 0x6f, 0x04, 0x16, 0x6d, 0xe3, 0x8d, 0x87, 0x20, 0x9e, 0xcc, 0x4c, 0x85, 0x9e, 0x40, + 0xb8, 0x57, 0x53, 0x2c, 0x28, 0xd9, 0xc1, 0xc2, 0x73, 0x42, 0x10, 0x4f, 0xad, 0xf9, 0x89, 0x1e, + 0x3b, 0xe9, 0xc6, 0x4e, 0xb6, 0xbb, 0x5d, 0x6c, 0xf4, 0x8e, 0x4f, 0x97, 0x40, 0xe6, 0x9a, 0x9e, + 0x75, 0x21, 0x01, 0x6d, 0x45, 0x3a, 0xc0, 0xc4, 0xdf, 0x02, 0x4c, 0xcf, 0xba, 0x40, 0xcb, 0xb0, + 0x7f, 0x71, 0x57, 0xc1, 0x44, 0x4e, 0xbd, 0xc9, 0x10, 0xc4, 0x6e, 0xf6, 0x5f, 0xa7, 0x6e, 0x4b, + 0x51, 0x5f, 0xac, 0xc0, 0xf5, 0x7b, 0xcf, 0x55, 0xb6, 0xa9, 0x90, 0x0f, 0x27, 0xe5, 0xd5, 0x4b, + 0x5c, 0x50, 0x0f, 0x2a, 0xe7, 0xa2, 0x8e, 0x96, 0xe1, 0xe0, 0x19, 0xcd, 0xa9, 0xa0, 0x7a, 0xcd, + 0x19, 0xfd, 0xd0, 0xd2, 0xe6, 0x72, 0xdb, 0xb6, 0xde, 0x76, 0xf4, 0x19, 0xc0, 0x99, 0x17, 0xac, + 0x11, 0xa3, 0x5f, 0x21, 0xd8, 0xab, 0xf0, 0x90, 0x9a, 0x54, 0xd4, 0x59, 0x6a, 0x0d, 0xfb, 0x48, + 0x4d, 0x20, 0xea, 0x2c, 0x69, 0x87, 0x3a, 0x05, 0x37, 0xb3, 0x0e, 0x09, 0x9a, 0x85, 0xe3, 0xfb, + 0x8c, 0xe6, 0xc4, 0xeb, 0x85, 0x76, 0xec, 0x66, 0xba, 0x90, 0x2a, 0xaf, 0x09, 0xad, 0xd5, 0xfa, + 0xdd, 0x4c, 0x17, 0x57, 0x52, 0x71, 0x42, 0xfb, 0x32, 0x95, 0xe8, 0x25, 0xfc, 0xff, 0xea, 0x40, + 0x55, 0x7e, 0x24, 0x01, 0x82, 0x0b, 0x9c, 0x9b, 0x79, 0x74, 0x81, 0xee, 0xcb, 0xad, 0xc8, 0x8f, + 0x3c, 0x2b, 0xb4, 0xe3, 0xa9, 0xb5, 0x7e, 0xa2, 0x9f, 0x73, 0x62, 0x5a, 0x8d, 0xbb, 0xf6, 0xcb, + 0x82, 0xae, 0x96, 0xd6, 0xb7, 0x36, 0xd1, 0x2b, 0x38, 0xfd, 0x54, 0x05, 0xd8, 0x3d, 0xbf, 0xd1, + 0x2e, 0x7f, 0xee, 0x46, 0x7e, 0xcf, 0xe5, 0xbb, 0x8d, 0x16, 0x3e, 0x7d, 0xfb, 0xf9, 0xc5, 0x1a, + 0x44, 0xfd, 0x74, 0xe4, 0x97, 0xf4, 0x08, 0xac, 0x48, 0xe4, 0x6b, 0x15, 0xe9, 0xbf, 0x21, 0xfd, + 0x5b, 0x90, 0x6f, 0xe1, 0xf4, 0xd5, 0xf4, 0xd0, 0x62, 0x87, 0xbc, 0x25, 0xd3, 0x3f, 0xf2, 0xe7, + 0x14, 0xff, 0xce, 0xca, 0x35, 0x3e, 0x7a, 0x07, 0xe1, 0xe5, 0x86, 0xd1, 0x42, 0x87, 0xbe, 0xf1, + 0x0c, 0xfc, 0xf9, 0xdb, 0xac, 0x2a, 0x3f, 0x8a, 0x16, 0x15, 0xf9, 0x2e, 0x1a, 0x8c, 0x92, 0xd3, + 0x9c, 0x35, 0x62, 0xe3, 0xe1, 0xd7, 0xb3, 0x00, 0x9c, 0x9c, 0x05, 0xe0, 0xc7, 0x59, 0x00, 0x8e, + 0xcf, 0x83, 0xb1, 0x93, 0xf3, 0x60, 0xec, 0xfb, 0x79, 0x30, 0x06, 0xcd, 0xff, 0xcd, 0x16, 0x78, + 0x33, 0x53, 0xf0, 0x9a, 0x12, 0xbe, 0x67, 0xfa, 0x1f, 0x1f, 0xac, 0xee, 0x3a, 0x6a, 0xfa, 0x07, + 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x19, 0xe4, 0x23, 0xcf, 0xaa, 0x04, 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 + +// ReportAPIClient is the client API for ReportAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ReportAPIClient interface { + CreateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeleteReport(ctx context.Context, in *DeleteReportRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ListReport(ctx context.Context, in *ListReportRequest, opts ...grpc.CallOption) (*ListReportReply, error) +} + +type reportAPIClient struct { + cc *grpc.ClientConn +} + +func NewReportAPIClient(cc *grpc.ClientConn) ReportAPIClient { + return &reportAPIClient{cc} +} + +func (c *reportAPIClient) CreateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ReportAPI/CreateReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reportAPIClient) UpdateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ReportAPI/UpdateReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reportAPIClient) DeleteReport(ctx context.Context, in *DeleteReportRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.ReportAPI/DeleteReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reportAPIClient) ListReport(ctx context.Context, in *ListReportRequest, opts ...grpc.CallOption) (*ListReportReply, error) { + out := new(ListReportReply) + err := c.cc.Invoke(ctx, "/api.v1.ReportAPI/ListReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReportAPIServer is the server API for ReportAPI service. +type ReportAPIServer interface { + CreateReport(context.Context, *Report) (*emptypb.Empty, error) + UpdateReport(context.Context, *Report) (*emptypb.Empty, error) + DeleteReport(context.Context, *DeleteReportRequest) (*emptypb.Empty, error) + ListReport(context.Context, *ListReportRequest) (*ListReportReply, error) +} + +// UnimplementedReportAPIServer can be embedded to have forward compatible implementations. +type UnimplementedReportAPIServer struct { +} + +func (*UnimplementedReportAPIServer) CreateReport(ctx context.Context, req *Report) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateReport not implemented") +} +func (*UnimplementedReportAPIServer) UpdateReport(ctx context.Context, req *Report) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateReport not implemented") +} +func (*UnimplementedReportAPIServer) DeleteReport(ctx context.Context, req *DeleteReportRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteReport not implemented") +} +func (*UnimplementedReportAPIServer) ListReport(ctx context.Context, req *ListReportRequest) (*ListReportReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListReport not implemented") +} + +func RegisterReportAPIServer(s *grpc.Server, srv ReportAPIServer) { + s.RegisterService(&_ReportAPI_serviceDesc, srv) +} + +func _ReportAPI_CreateReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Report) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportAPIServer).CreateReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ReportAPI/CreateReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportAPIServer).CreateReport(ctx, req.(*Report)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReportAPI_UpdateReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Report) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportAPIServer).UpdateReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ReportAPI/UpdateReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportAPIServer).UpdateReport(ctx, req.(*Report)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReportAPI_DeleteReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportAPIServer).DeleteReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ReportAPI/DeleteReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportAPIServer).DeleteReport(ctx, req.(*DeleteReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReportAPI_ListReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportAPIServer).ListReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.ReportAPI/ListReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportAPIServer).ListReport(ctx, req.(*ListReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReportAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.ReportAPI", + HandlerType: (*ReportAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateReport", + Handler: _ReportAPI_CreateReport_Handler, + }, + { + MethodName: "UpdateReport", + Handler: _ReportAPI_UpdateReport_Handler, + }, + { + MethodName: "DeleteReport", + Handler: _ReportAPI_DeleteReport_Handler, + }, + { + MethodName: "ListReport", + Handler: _ReportAPI_ListReport_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/report.proto", +} + +func (m *Report) 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 *Report) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Report) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintReport(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x52 + } + if len(m.Remark) > 0 { + i -= len(m.Remark) + copy(dAtA[i:], m.Remark) + i = encodeVarintReport(dAtA, i, uint64(len(m.Remark))) + i-- + dAtA[i] = 0x4a + } + if len(m.DocumentTitle) > 0 { + i -= len(m.DocumentTitle) + copy(dAtA[i:], m.DocumentTitle) + i = encodeVarintReport(dAtA, i, uint64(len(m.DocumentTitle))) + i-- + dAtA[i] = 0x42 + } + 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 = encodeVarintReport(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + } + 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 = encodeVarintReport(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + } + if m.Status { + i-- + if m.Status { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Reason != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.Reason)) + i-- + dAtA[i] = 0x20 + } + if m.UserId != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x18 + } + if m.DocumentId != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.DocumentId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeleteReportRequest) 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 *DeleteReportRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteReportRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA4 := make([]byte, len(m.Id)*10) + var j3 int + for _, num1 := range m.Id { + 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 = encodeVarintReport(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListReportRequest) 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 *ListReportRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListReportRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Status) > 0 { + for iNdEx := len(m.Status) - 1; iNdEx >= 0; iNdEx-- { + i-- + if m.Status[iNdEx] { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + } + i = encodeVarintReport(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x32 + } + if len(m.Order) > 0 { + i -= len(m.Order) + copy(dAtA[i:], m.Order) + i = encodeVarintReport(dAtA, i, uint64(len(m.Order))) + i-- + dAtA[i] = 0x2a + } + 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 = encodeVarintReport(dAtA, i, uint64(len(m.Field[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintReport(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListReportReply) 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 *ListReportReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListReportReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Report) > 0 { + for iNdEx := len(m.Report) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Report[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintReport(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintReport(dAtA []byte, offset int, v uint64) int { + offset -= sovReport(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Report) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovReport(uint64(m.Id)) + } + if m.DocumentId != 0 { + n += 1 + sovReport(uint64(m.DocumentId)) + } + if m.UserId != 0 { + n += 1 + sovReport(uint64(m.UserId)) + } + if m.Reason != 0 { + n += 1 + sovReport(uint64(m.Reason)) + } + if m.Status { + n += 2 + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovReport(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovReport(uint64(l)) + } + l = len(m.DocumentTitle) + if l > 0 { + n += 1 + l + sovReport(uint64(l)) + } + l = len(m.Remark) + if l > 0 { + n += 1 + l + sovReport(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovReport(uint64(l)) + } + return n +} + +func (m *DeleteReportRequest) 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 += sovReport(uint64(e)) + } + n += 1 + sovReport(uint64(l)) + l + } + return n +} + +func (m *ListReportRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovReport(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovReport(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovReport(uint64(l)) + } + if len(m.Field) > 0 { + for _, s := range m.Field { + l = len(s) + n += 1 + l + sovReport(uint64(l)) + } + } + l = len(m.Order) + if l > 0 { + n += 1 + l + sovReport(uint64(l)) + } + if len(m.Status) > 0 { + n += 1 + sovReport(uint64(len(m.Status))) + len(m.Status)*1 + } + return n +} + +func (m *ListReportReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovReport(uint64(m.Total)) + } + if len(m.Report) > 0 { + for _, e := range m.Report { + l = e.Size() + n += 1 + l + sovReport(uint64(l)) + } + } + return n +} + +func sovReport(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozReport(x uint64) (n int) { + return sovReport(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Report) 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 ErrIntOverflowReport + } + 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: Report: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Report: 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 ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + m.DocumentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocumentId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + m.Reason = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Reason |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = bool(v != 0) + case 6: + 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 ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReport + } + 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 7: + 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 ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReport + } + 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 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentTitle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentTitle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remark", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Remark = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReport(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteReportRequest) 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 ErrIntOverflowReport + } + 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: DeleteReportRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteReportRequest: 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 ErrIntOverflowReport + } + 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 ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthReport + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + 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 ErrIntOverflowReport + } + 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 := skipReport(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListReportRequest) 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 ErrIntOverflowReport + } + 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: ListReportRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListReportRequest: 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 ErrIntOverflowReport + } + 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 ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = append(m.Field, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + 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 ErrInvalidLengthReport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Order = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, bool(v != 0)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthReport + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen + if elementCount != 0 && len(m.Status) == 0 { + m.Status = make([]bool, 0, elementCount) + } + for iNdEx < postIndex { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, bool(v != 0)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipReport(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListReportReply) 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 ErrIntOverflowReport + } + 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: ListReportReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListReportReply: 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 ErrIntOverflowReport + } + 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 Report", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Report = append(m.Report, &Report{}) + if err := m.Report[len(m.Report)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReport(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipReport(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, ErrIntOverflowReport + } + 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, ErrIntOverflowReport + } + 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, ErrIntOverflowReport + } + 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, ErrInvalidLengthReport + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupReport + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthReport + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthReport = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowReport = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupReport = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/report.pb.gw.go b/api/v1/report.pb.gw.go new file mode 100644 index 0000000..87e78ef --- /dev/null +++ b/api/v1/report.pb.gw.go @@ -0,0 +1,416 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/report.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_ReportAPI_CreateReport_0(ctx context.Context, marshaler runtime.Marshaler, client ReportAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Report + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReportAPI_CreateReport_0(ctx context.Context, marshaler runtime.Marshaler, server ReportAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Report + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateReport(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReportAPI_UpdateReport_0(ctx context.Context, marshaler runtime.Marshaler, client ReportAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Report + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReportAPI_UpdateReport_0(ctx context.Context, marshaler runtime.Marshaler, server ReportAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Report + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateReport(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ReportAPI_DeleteReport_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ReportAPI_DeleteReport_0(ctx context.Context, marshaler runtime.Marshaler, client ReportAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteReportRequest + 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_ReportAPI_DeleteReport_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReportAPI_DeleteReport_0(ctx context.Context, marshaler runtime.Marshaler, server ReportAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteReportRequest + 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_ReportAPI_DeleteReport_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteReport(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ReportAPI_ListReport_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ReportAPI_ListReport_0(ctx context.Context, marshaler runtime.Marshaler, client ReportAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReportRequest + 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_ReportAPI_ListReport_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReportAPI_ListReport_0(ctx context.Context, marshaler runtime.Marshaler, server ReportAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReportRequest + 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_ReportAPI_ListReport_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListReport(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterReportAPIHandlerServer registers the http handlers for service ReportAPI to "mux". +// UnaryRPC :call ReportAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReportAPIHandlerFromEndpoint instead. +func RegisterReportAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReportAPIServer) error { + + mux.Handle("POST", pattern_ReportAPI_CreateReport_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReportAPI_CreateReport_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_CreateReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ReportAPI_UpdateReport_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReportAPI_UpdateReport_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_UpdateReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ReportAPI_DeleteReport_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReportAPI_DeleteReport_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_DeleteReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReportAPI_ListReport_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReportAPI_ListReport_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_ListReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterReportAPIHandlerFromEndpoint is same as RegisterReportAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterReportAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterReportAPIHandler(ctx, mux, conn) +} + +// RegisterReportAPIHandler registers the http handlers for service ReportAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterReportAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterReportAPIHandlerClient(ctx, mux, NewReportAPIClient(conn)) +} + +// RegisterReportAPIHandlerClient registers the http handlers for service ReportAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReportAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReportAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ReportAPIClient" to call the correct interceptors. +func RegisterReportAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReportAPIClient) error { + + mux.Handle("POST", pattern_ReportAPI_CreateReport_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReportAPI_CreateReport_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_CreateReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_ReportAPI_UpdateReport_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReportAPI_UpdateReport_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_UpdateReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ReportAPI_DeleteReport_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReportAPI_DeleteReport_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_DeleteReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReportAPI_ListReport_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReportAPI_ListReport_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReportAPI_ListReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ReportAPI_CreateReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "report"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ReportAPI_UpdateReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "report"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ReportAPI_DeleteReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "report"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_ReportAPI_ListReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "report", "list"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_ReportAPI_CreateReport_0 = runtime.ForwardResponseMessage + + forward_ReportAPI_UpdateReport_0 = runtime.ForwardResponseMessage + + forward_ReportAPI_DeleteReport_0 = runtime.ForwardResponseMessage + + forward_ReportAPI_ListReport_0 = runtime.ForwardResponseMessage +) diff --git a/api/v1/user.pb.go b/api/v1/user.pb.go new file mode 100644 index 0000000..4ff6036 --- /dev/null +++ b/api/v1/user.pb.go @@ -0,0 +1,6917 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/v1/user.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 User struct { + LoginAt *time.Time `protobuf:"bytes,19,opt,name=login_at,json=loginAt,proto3,stdtime" json:"login_at,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,20,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,21,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` + Signature string `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` + LastLoginIp string `protobuf:"bytes,7,opt,name=last_login_ip,json=lastLoginIp,proto3" json:"last_login_ip,omitempty"` + RegisterIp string `protobuf:"bytes,8,opt,name=register_ip,json=registerIp,proto3" json:"register_ip,omitempty"` + DocCount int32 `protobuf:"varint,9,opt,name=doc_count,json=docCount,proto3" json:"doc_count,omitempty"` + FollowCount int32 `protobuf:"varint,10,opt,name=follow_count,json=followCount,proto3" json:"follow_count,omitempty"` + FansCount int32 `protobuf:"varint,11,opt,name=fans_count,json=fansCount,proto3" json:"fans_count,omitempty"` + FavoriteCount int32 `protobuf:"varint,12,opt,name=favorite_count,json=favoriteCount,proto3" json:"favorite_count,omitempty"` + CommentCount int32 `protobuf:"varint,13,opt,name=comment_count,json=commentCount,proto3" json:"comment_count,omitempty"` + Status int32 `protobuf:"varint,14,opt,name=status,proto3" json:"status,omitempty"` + Avatar string `protobuf:"bytes,15,opt,name=avatar,proto3" json:"avatar,omitempty"` + Identity string `protobuf:"bytes,16,opt,name=identity,proto3" json:"identity,omitempty"` + Realname string `protobuf:"bytes,17,opt,name=realname,proto3" json:"realname,omitempty"` + GroupId []int64 `protobuf:"varint,18,rep,packed,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + CreditCount int32 `protobuf:"varint,22,opt,name=credit_count,json=creditCount,proto3" json:"credit_count,omitempty"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{0} +} +func (m *User) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_User.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 *User) XXX_Merge(src proto.Message) { + xxx_messageInfo_User.Merge(m, src) +} +func (m *User) XXX_Size() int { + return m.Size() +} +func (m *User) XXX_DiscardUnknown() { + xxx_messageInfo_User.DiscardUnknown(m) +} + +var xxx_messageInfo_User proto.InternalMessageInfo + +func (m *User) GetLoginAt() *time.Time { + if m != nil { + return m.LoginAt + } + return nil +} + +func (m *User) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *User) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +func (m *User) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *User) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *User) GetMobile() string { + if m != nil { + return m.Mobile + } + return "" +} + +func (m *User) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *User) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *User) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +func (m *User) GetLastLoginIp() string { + if m != nil { + return m.LastLoginIp + } + return "" +} + +func (m *User) GetRegisterIp() string { + if m != nil { + return m.RegisterIp + } + return "" +} + +func (m *User) GetDocCount() int32 { + if m != nil { + return m.DocCount + } + return 0 +} + +func (m *User) GetFollowCount() int32 { + if m != nil { + return m.FollowCount + } + return 0 +} + +func (m *User) GetFansCount() int32 { + if m != nil { + return m.FansCount + } + return 0 +} + +func (m *User) GetFavoriteCount() int32 { + if m != nil { + return m.FavoriteCount + } + return 0 +} + +func (m *User) GetCommentCount() int32 { + if m != nil { + return m.CommentCount + } + return 0 +} + +func (m *User) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *User) GetAvatar() string { + if m != nil { + return m.Avatar + } + return "" +} + +func (m *User) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +func (m *User) GetRealname() string { + if m != nil { + return m.Realname + } + return "" +} + +func (m *User) GetGroupId() []int64 { + if m != nil { + return m.GroupId + } + return nil +} + +func (m *User) GetCreditCount() int32 { + if m != nil { + return m.CreditCount + } + return 0 +} + +type RegisterAndLoginRequest struct { + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" validate:"min=3,max=32"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty" validate:"min=6"` + Captcha string `protobuf:"bytes,3,opt,name=captcha,proto3" json:"captcha,omitempty"` + CaptchaId string `protobuf:"bytes,4,opt,name=captcha_id,json=captchaId,proto3" json:"captcha_id,omitempty"` + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` +} + +func (m *RegisterAndLoginRequest) Reset() { *m = RegisterAndLoginRequest{} } +func (m *RegisterAndLoginRequest) String() string { return proto.CompactTextString(m) } +func (*RegisterAndLoginRequest) ProtoMessage() {} +func (*RegisterAndLoginRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{1} +} +func (m *RegisterAndLoginRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RegisterAndLoginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RegisterAndLoginRequest.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 *RegisterAndLoginRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterAndLoginRequest.Merge(m, src) +} +func (m *RegisterAndLoginRequest) XXX_Size() int { + return m.Size() +} +func (m *RegisterAndLoginRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterAndLoginRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterAndLoginRequest proto.InternalMessageInfo + +func (m *RegisterAndLoginRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *RegisterAndLoginRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *RegisterAndLoginRequest) GetCaptcha() string { + if m != nil { + return m.Captcha + } + return "" +} + +func (m *RegisterAndLoginRequest) GetCaptchaId() string { + if m != nil { + return m.CaptchaId + } + return "" +} + +func (m *RegisterAndLoginRequest) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +type GetUserCaptchaRequest struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` +} + +func (m *GetUserCaptchaRequest) Reset() { *m = GetUserCaptchaRequest{} } +func (m *GetUserCaptchaRequest) String() string { return proto.CompactTextString(m) } +func (*GetUserCaptchaRequest) ProtoMessage() {} +func (*GetUserCaptchaRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{2} +} +func (m *GetUserCaptchaRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetUserCaptchaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetUserCaptchaRequest.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 *GetUserCaptchaRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserCaptchaRequest.Merge(m, src) +} +func (m *GetUserCaptchaRequest) XXX_Size() int { + return m.Size() +} +func (m *GetUserCaptchaRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserCaptchaRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserCaptchaRequest proto.InternalMessageInfo + +func (m *GetUserCaptchaRequest) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +type LoginReply struct { + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` +} + +func (m *LoginReply) Reset() { *m = LoginReply{} } +func (m *LoginReply) String() string { return proto.CompactTextString(m) } +func (*LoginReply) ProtoMessage() {} +func (*LoginReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{3} +} +func (m *LoginReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoginReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoginReply.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 *LoginReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoginReply.Merge(m, src) +} +func (m *LoginReply) XXX_Size() int { + return m.Size() +} +func (m *LoginReply) XXX_DiscardUnknown() { + xxx_messageInfo_LoginReply.DiscardUnknown(m) +} + +var xxx_messageInfo_LoginReply proto.InternalMessageInfo + +func (m *LoginReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *LoginReply) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +type DeleteUserRequest struct { + Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteUserRequest) Reset() { *m = DeleteUserRequest{} } +func (m *DeleteUserRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteUserRequest) ProtoMessage() {} +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{4} +} +func (m *DeleteUserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteUserRequest.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 *DeleteUserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUserRequest.Merge(m, src) +} +func (m *DeleteUserRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteUserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUserRequest proto.InternalMessageInfo + +func (m *DeleteUserRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +type GetUserRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetUserRequest) Reset() { *m = GetUserRequest{} } +func (m *GetUserRequest) String() string { return proto.CompactTextString(m) } +func (*GetUserRequest) ProtoMessage() {} +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{5} +} +func (m *GetUserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetUserRequest.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 *GetUserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserRequest.Merge(m, src) +} +func (m *GetUserRequest) XXX_Size() int { + return m.Size() +} +func (m *GetUserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserRequest proto.InternalMessageInfo + +func (m *GetUserRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type FindPasswordRequest struct { + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty" validate:"min=6"` + Captcha string `protobuf:"bytes,4,opt,name=captcha,proto3" json:"captcha,omitempty"` + CaptchaId string `protobuf:"bytes,5,opt,name=captcha_id,json=captchaId,proto3" json:"captcha_id,omitempty"` +} + +func (m *FindPasswordRequest) Reset() { *m = FindPasswordRequest{} } +func (m *FindPasswordRequest) String() string { return proto.CompactTextString(m) } +func (*FindPasswordRequest) ProtoMessage() {} +func (*FindPasswordRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{6} +} +func (m *FindPasswordRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FindPasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FindPasswordRequest.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 *FindPasswordRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FindPasswordRequest.Merge(m, src) +} +func (m *FindPasswordRequest) XXX_Size() int { + return m.Size() +} +func (m *FindPasswordRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FindPasswordRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FindPasswordRequest proto.InternalMessageInfo + +func (m *FindPasswordRequest) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *FindPasswordRequest) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *FindPasswordRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *FindPasswordRequest) GetCaptcha() string { + if m != nil { + return m.Captcha + } + return "" +} + +func (m *FindPasswordRequest) GetCaptchaId() string { + if m != nil { + return m.CaptchaId + } + return "" +} + +type ListUserRequest 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"` + Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"` + Sort string `protobuf:"bytes,4,opt,name=sort,proto3" json:"sort,omitempty"` + Id []int64 `protobuf:"varint,5,rep,packed,name=id,proto3" json:"id,omitempty"` + GroupId []int64 `protobuf:"varint,6,rep,packed,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Status []int32 `protobuf:"varint,7,rep,packed,name=status,proto3" json:"status,omitempty"` + Limit int64 `protobuf:"varint,8,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *ListUserRequest) Reset() { *m = ListUserRequest{} } +func (m *ListUserRequest) String() string { return proto.CompactTextString(m) } +func (*ListUserRequest) ProtoMessage() {} +func (*ListUserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{7} +} +func (m *ListUserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListUserRequest.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 *ListUserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUserRequest.Merge(m, src) +} +func (m *ListUserRequest) XXX_Size() int { + return m.Size() +} +func (m *ListUserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListUserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListUserRequest proto.InternalMessageInfo + +func (m *ListUserRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListUserRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListUserRequest) GetWd() string { + if m != nil { + return m.Wd + } + return "" +} + +func (m *ListUserRequest) GetSort() string { + if m != nil { + return m.Sort + } + return "" +} + +func (m *ListUserRequest) GetId() []int64 { + if m != nil { + return m.Id + } + return nil +} + +func (m *ListUserRequest) GetGroupId() []int64 { + if m != nil { + return m.GroupId + } + return nil +} + +func (m *ListUserRequest) GetStatus() []int32 { + if m != nil { + return m.Status + } + return nil +} + +func (m *ListUserRequest) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +type ListUserReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` +} + +func (m *ListUserReply) Reset() { *m = ListUserReply{} } +func (m *ListUserReply) String() string { return proto.CompactTextString(m) } +func (*ListUserReply) ProtoMessage() {} +func (*ListUserReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{8} +} +func (m *ListUserReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListUserReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListUserReply.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 *ListUserReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUserReply.Merge(m, src) +} +func (m *ListUserReply) XXX_Size() int { + return m.Size() +} +func (m *ListUserReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListUserReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListUserReply proto.InternalMessageInfo + +func (m *ListUserReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListUserReply) GetUser() []*User { + if m != nil { + return m.User + } + return nil +} + +type GetUserCaptchaReply struct { + Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Captcha string `protobuf:"bytes,3,opt,name=captcha,proto3" json:"captcha,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` +} + +func (m *GetUserCaptchaReply) Reset() { *m = GetUserCaptchaReply{} } +func (m *GetUserCaptchaReply) String() string { return proto.CompactTextString(m) } +func (*GetUserCaptchaReply) ProtoMessage() {} +func (*GetUserCaptchaReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{9} +} +func (m *GetUserCaptchaReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetUserCaptchaReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetUserCaptchaReply.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 *GetUserCaptchaReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserCaptchaReply.Merge(m, src) +} +func (m *GetUserCaptchaReply) XXX_Size() int { + return m.Size() +} +func (m *GetUserCaptchaReply) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserCaptchaReply.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserCaptchaReply proto.InternalMessageInfo + +func (m *GetUserCaptchaReply) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + +func (m *GetUserCaptchaReply) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *GetUserCaptchaReply) GetCaptcha() string { + if m != nil { + return m.Captcha + } + return "" +} + +func (m *GetUserCaptchaReply) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +// 修改用户密码 +type UpdateUserPasswordRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OldPassword string `protobuf:"bytes,2,opt,name=old_password,json=oldPassword,proto3" json:"old_password,omitempty"` + NewPassword string `protobuf:"bytes,3,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty" validate:"min=6"` +} + +func (m *UpdateUserPasswordRequest) Reset() { *m = UpdateUserPasswordRequest{} } +func (m *UpdateUserPasswordRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateUserPasswordRequest) ProtoMessage() {} +func (*UpdateUserPasswordRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{10} +} +func (m *UpdateUserPasswordRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateUserPasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateUserPasswordRequest.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 *UpdateUserPasswordRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserPasswordRequest.Merge(m, src) +} +func (m *UpdateUserPasswordRequest) XXX_Size() int { + return m.Size() +} +func (m *UpdateUserPasswordRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserPasswordRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserPasswordRequest proto.InternalMessageInfo + +func (m *UpdateUserPasswordRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *UpdateUserPasswordRequest) GetOldPassword() string { + if m != nil { + return m.OldPassword + } + return "" +} + +func (m *UpdateUserPasswordRequest) GetNewPassword() string { + if m != nil { + return m.NewPassword + } + return "" +} + +type GetUserPermissionsReply struct { + Permission []*Permission `protobuf:"bytes,1,rep,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *GetUserPermissionsReply) Reset() { *m = GetUserPermissionsReply{} } +func (m *GetUserPermissionsReply) String() string { return proto.CompactTextString(m) } +func (*GetUserPermissionsReply) ProtoMessage() {} +func (*GetUserPermissionsReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{11} +} +func (m *GetUserPermissionsReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetUserPermissionsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetUserPermissionsReply.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 *GetUserPermissionsReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserPermissionsReply.Merge(m, src) +} +func (m *GetUserPermissionsReply) XXX_Size() int { + return m.Size() +} +func (m *GetUserPermissionsReply) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserPermissionsReply.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserPermissionsReply proto.InternalMessageInfo + +func (m *GetUserPermissionsReply) GetPermission() []*Permission { + if m != nil { + return m.Permission + } + return nil +} + +type SetUserRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" validate:"min=3,max=32"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty" validate:"min=6"` + GroupId []int64 `protobuf:"varint,4,rep,packed,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` +} + +func (m *SetUserRequest) Reset() { *m = SetUserRequest{} } +func (m *SetUserRequest) String() string { return proto.CompactTextString(m) } +func (*SetUserRequest) ProtoMessage() {} +func (*SetUserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{12} +} +func (m *SetUserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetUserRequest.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 *SetUserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserRequest.Merge(m, src) +} +func (m *SetUserRequest) XXX_Size() int { + return m.Size() +} +func (m *SetUserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserRequest proto.InternalMessageInfo + +func (m *SetUserRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *SetUserRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *SetUserRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *SetUserRequest) GetGroupId() []int64 { + if m != nil { + return m.GroupId + } + return nil +} + +type Dynamic struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` + Username string `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` + UpdatedAt *time.Time `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"` +} + +func (m *Dynamic) Reset() { *m = Dynamic{} } +func (m *Dynamic) String() string { return proto.CompactTextString(m) } +func (*Dynamic) ProtoMessage() {} +func (*Dynamic) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{13} +} +func (m *Dynamic) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Dynamic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Dynamic.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 *Dynamic) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dynamic.Merge(m, src) +} +func (m *Dynamic) XXX_Size() int { + return m.Size() +} +func (m *Dynamic) XXX_DiscardUnknown() { + xxx_messageInfo_Dynamic.DiscardUnknown(m) +} + +var xxx_messageInfo_Dynamic proto.InternalMessageInfo + +func (m *Dynamic) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Dynamic) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Dynamic) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Dynamic) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Dynamic) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *Dynamic) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Dynamic) GetUpdatedAt() *time.Time { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type ListUserDynamicRequest 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"` + Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ListUserDynamicRequest) Reset() { *m = ListUserDynamicRequest{} } +func (m *ListUserDynamicRequest) String() string { return proto.CompactTextString(m) } +func (*ListUserDynamicRequest) ProtoMessage() {} +func (*ListUserDynamicRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{14} +} +func (m *ListUserDynamicRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListUserDynamicRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListUserDynamicRequest.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 *ListUserDynamicRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUserDynamicRequest.Merge(m, src) +} +func (m *ListUserDynamicRequest) XXX_Size() int { + return m.Size() +} +func (m *ListUserDynamicRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListUserDynamicRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListUserDynamicRequest proto.InternalMessageInfo + +func (m *ListUserDynamicRequest) GetPage() int64 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *ListUserDynamicRequest) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ListUserDynamicRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +type ListUserDynamicReply struct { + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Dynamic []*Dynamic `protobuf:"bytes,2,rep,name=dynamic,proto3" json:"dynamic,omitempty"` +} + +func (m *ListUserDynamicReply) Reset() { *m = ListUserDynamicReply{} } +func (m *ListUserDynamicReply) String() string { return proto.CompactTextString(m) } +func (*ListUserDynamicReply) ProtoMessage() {} +func (*ListUserDynamicReply) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{15} +} +func (m *ListUserDynamicReply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListUserDynamicReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListUserDynamicReply.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 *ListUserDynamicReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUserDynamicReply.Merge(m, src) +} +func (m *ListUserDynamicReply) XXX_Size() int { + return m.Size() +} +func (m *ListUserDynamicReply) XXX_DiscardUnknown() { + xxx_messageInfo_ListUserDynamicReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ListUserDynamicReply proto.InternalMessageInfo + +func (m *ListUserDynamicReply) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *ListUserDynamicReply) GetDynamic() []*Dynamic { + if m != nil { + return m.Dynamic + } + return nil +} + +type Sign struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SignAt int32 `protobuf:"varint,3,opt,name=sign_at,json=signAt,proto3" json:"sign_at,omitempty"` + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` + CreatedAt *time.Time `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"` +} + +func (m *Sign) Reset() { *m = Sign{} } +func (m *Sign) String() string { return proto.CompactTextString(m) } +func (*Sign) ProtoMessage() {} +func (*Sign) Descriptor() ([]byte, []int) { + return fileDescriptor_b74e2e33d57193df, []int{16} +} +func (m *Sign) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sign.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 *Sign) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sign.Merge(m, src) +} +func (m *Sign) XXX_Size() int { + return m.Size() +} +func (m *Sign) XXX_DiscardUnknown() { + xxx_messageInfo_Sign.DiscardUnknown(m) +} + +var xxx_messageInfo_Sign proto.InternalMessageInfo + +func (m *Sign) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Sign) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Sign) GetSignAt() int32 { + if m != nil { + return m.SignAt + } + return 0 +} + +func (m *Sign) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *Sign) GetCreatedAt() *time.Time { + if m != nil { + return m.CreatedAt + } + return nil +} + +func init() { + proto.RegisterType((*User)(nil), "api.v1.User") + proto.RegisterType((*RegisterAndLoginRequest)(nil), "api.v1.RegisterAndLoginRequest") + proto.RegisterType((*GetUserCaptchaRequest)(nil), "api.v1.GetUserCaptchaRequest") + proto.RegisterType((*LoginReply)(nil), "api.v1.LoginReply") + proto.RegisterType((*DeleteUserRequest)(nil), "api.v1.DeleteUserRequest") + proto.RegisterType((*GetUserRequest)(nil), "api.v1.GetUserRequest") + proto.RegisterType((*FindPasswordRequest)(nil), "api.v1.FindPasswordRequest") + proto.RegisterType((*ListUserRequest)(nil), "api.v1.ListUserRequest") + proto.RegisterType((*ListUserReply)(nil), "api.v1.ListUserReply") + proto.RegisterType((*GetUserCaptchaReply)(nil), "api.v1.GetUserCaptchaReply") + proto.RegisterType((*UpdateUserPasswordRequest)(nil), "api.v1.UpdateUserPasswordRequest") + proto.RegisterType((*GetUserPermissionsReply)(nil), "api.v1.GetUserPermissionsReply") + proto.RegisterType((*SetUserRequest)(nil), "api.v1.SetUserRequest") + proto.RegisterType((*Dynamic)(nil), "api.v1.Dynamic") + proto.RegisterType((*ListUserDynamicRequest)(nil), "api.v1.ListUserDynamicRequest") + proto.RegisterType((*ListUserDynamicReply)(nil), "api.v1.ListUserDynamicReply") + proto.RegisterType((*Sign)(nil), "api.v1.Sign") +} + +func init() { proto.RegisterFile("api/v1/user.proto", fileDescriptor_b74e2e33d57193df) } + +var fileDescriptor_b74e2e33d57193df = []byte{ + // 1591 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xcd, 0x6e, 0x1b, 0xc9, + 0x11, 0xf6, 0xf0, 0x9f, 0x45, 0x49, 0x5e, 0xb5, 0x28, 0x92, 0x1a, 0x69, 0x45, 0x6a, 0x16, 0x49, + 0x14, 0x65, 0x21, 0xc6, 0x32, 0x92, 0x05, 0xbc, 0x58, 0x04, 0xfa, 0xd9, 0x18, 0x02, 0x14, 0x44, + 0x19, 0x59, 0x08, 0xe0, 0x1c, 0x84, 0x16, 0xa7, 0xc5, 0x74, 0x3c, 0x33, 0x3d, 0x9e, 0x69, 0x8a, + 0x56, 0x8e, 0xb9, 0xe4, 0x6a, 0x20, 0xa7, 0xbc, 0x40, 0x4e, 0x39, 0xe7, 0x19, 0x72, 0x34, 0xe0, + 0x4b, 0x80, 0x00, 0x4e, 0x60, 0xe7, 0x9a, 0x8b, 0x1f, 0x20, 0x08, 0xfa, 0x6f, 0xc8, 0xa1, 0x3c, + 0x5e, 0x49, 0xbe, 0x4d, 0x55, 0x57, 0x7f, 0xdd, 0x55, 0xf5, 0x55, 0x75, 0x91, 0xb0, 0x88, 0x23, + 0xda, 0xbf, 0x7c, 0xd0, 0x1f, 0x25, 0x24, 0xde, 0x8e, 0x62, 0xc6, 0x19, 0xaa, 0xe0, 0x88, 0x6e, + 0x5f, 0x3e, 0xb0, 0xbb, 0x43, 0xc6, 0x86, 0x3e, 0xe9, 0x4b, 0xed, 0xf9, 0xe8, 0xa2, 0xcf, 0x69, + 0x40, 0x12, 0x8e, 0x83, 0x48, 0x19, 0xda, 0xcd, 0x21, 0x1b, 0x32, 0xf9, 0xd9, 0x17, 0x5f, 0x5a, + 0xbb, 0xa6, 0xb7, 0x09, 0x60, 0x1c, 0x86, 0x8c, 0x63, 0x4e, 0x59, 0x98, 0xe8, 0xd5, 0xd5, 0x59, + 0x50, 0x12, 0x44, 0xfc, 0x4a, 0x2f, 0xb6, 0xf5, 0x65, 0x22, 0x12, 0x07, 0x34, 0x49, 0x28, 0x0b, + 0xd5, 0x82, 0xf3, 0xdf, 0x32, 0x94, 0x4e, 0x13, 0x12, 0xa3, 0xaf, 0xa1, 0xe6, 0xb3, 0x21, 0x0d, + 0xcf, 0x30, 0xef, 0x2c, 0xf5, 0xac, 0xcd, 0xc6, 0x8e, 0xbd, 0xad, 0x10, 0xb7, 0x0d, 0xe2, 0xf6, + 0x13, 0x73, 0xcd, 0xbd, 0xd2, 0xcb, 0x7f, 0x75, 0x2d, 0xb7, 0x2a, 0x77, 0xec, 0x72, 0xf4, 0x33, + 0x80, 0x41, 0x4c, 0x30, 0x27, 0x9e, 0xd8, 0xde, 0xbc, 0xe1, 0xf6, 0xba, 0xde, 0xa3, 0x00, 0x46, + 0x91, 0x67, 0x00, 0x96, 0x6f, 0x0a, 0xa0, 0xf7, 0xec, 0x72, 0xb4, 0x00, 0x05, 0xea, 0x75, 0xac, + 0x9e, 0xb5, 0x59, 0x74, 0x0b, 0xd4, 0x43, 0x36, 0xd4, 0x44, 0xe0, 0x43, 0x1c, 0x90, 0x4e, 0xa1, + 0x67, 0x6d, 0xd6, 0xdd, 0x54, 0x46, 0x2d, 0xa8, 0x04, 0xec, 0x9c, 0xfa, 0xa4, 0x53, 0x94, 0x2b, + 0x5a, 0x42, 0x4d, 0x28, 0x93, 0x00, 0x53, 0xbf, 0x53, 0x92, 0x6a, 0x25, 0xa0, 0x0e, 0x54, 0xb1, + 0xe7, 0xc5, 0x24, 0x49, 0x3a, 0x65, 0xa9, 0x37, 0x22, 0x5a, 0x83, 0x7a, 0x42, 0x87, 0x21, 0xe6, + 0xa3, 0x98, 0x74, 0x2a, 0x72, 0x6d, 0xa2, 0x40, 0x0e, 0xcc, 0xfb, 0x38, 0xe1, 0x67, 0x2a, 0xaa, + 0x34, 0xea, 0x54, 0xa5, 0x45, 0x43, 0x28, 0x8f, 0x84, 0xee, 0x30, 0x42, 0x5d, 0x68, 0xc4, 0x64, + 0x48, 0x13, 0x4e, 0x62, 0x61, 0x51, 0x93, 0x16, 0x60, 0x54, 0x87, 0x11, 0x5a, 0x85, 0xba, 0xc7, + 0x06, 0x67, 0x03, 0x36, 0x0a, 0x79, 0xa7, 0xde, 0xb3, 0x36, 0xcb, 0x6e, 0xcd, 0x63, 0x83, 0x7d, + 0x21, 0xa3, 0x0d, 0x98, 0xbb, 0x60, 0xbe, 0xcf, 0xc6, 0x7a, 0x1d, 0xe4, 0x7a, 0x43, 0xe9, 0x94, + 0xc9, 0xe7, 0x00, 0x17, 0x38, 0x4c, 0xb4, 0x41, 0x43, 0x1a, 0xd4, 0x85, 0x46, 0x2d, 0x7f, 0x0f, + 0x16, 0x2e, 0xf0, 0x25, 0x8b, 0x29, 0x27, 0xda, 0x64, 0x4e, 0x9a, 0xcc, 0x1b, 0xad, 0x32, 0xfb, + 0x02, 0xe6, 0x07, 0x2c, 0x08, 0x48, 0xc8, 0xb5, 0xd5, 0xbc, 0xb4, 0x9a, 0xd3, 0x4a, 0x65, 0xd4, + 0x82, 0x4a, 0xc2, 0x31, 0x1f, 0x25, 0x9d, 0x05, 0xb9, 0xaa, 0x25, 0xa1, 0xc7, 0x97, 0x98, 0xe3, + 0xb8, 0x73, 0x5f, 0x45, 0x5b, 0x49, 0x22, 0x43, 0xd4, 0x23, 0x21, 0xa7, 0xfc, 0xaa, 0xf3, 0x99, + 0xca, 0x90, 0x91, 0xc5, 0x5a, 0x4c, 0xb0, 0x2f, 0xb3, 0xb7, 0xa8, 0xd6, 0x8c, 0x8c, 0x56, 0xa0, + 0x36, 0x8c, 0xd9, 0x28, 0x3a, 0xa3, 0x5e, 0x07, 0xf5, 0x8a, 0x9b, 0x45, 0xb7, 0x2a, 0xe5, 0x43, + 0x4f, 0x04, 0x64, 0x10, 0x13, 0x8f, 0x9a, 0x6b, 0xb6, 0x54, 0x40, 0x94, 0x4e, 0xde, 0xd2, 0x79, + 0x6d, 0x41, 0xdb, 0xd5, 0xf1, 0xdd, 0x0d, 0x3d, 0x99, 0x08, 0x97, 0x3c, 0x1f, 0x91, 0x84, 0xa3, + 0xaf, 0xa6, 0x38, 0x23, 0x98, 0x54, 0xdf, 0x5b, 0x7d, 0xff, 0xa6, 0xdb, 0xbe, 0xc4, 0x3e, 0x15, + 0x34, 0x7b, 0xe4, 0x04, 0x34, 0xfc, 0xe6, 0xe1, 0x97, 0x01, 0x7e, 0xf1, 0xcd, 0xc3, 0x1d, 0x67, + 0x8a, 0x50, 0x3f, 0x86, 0x5a, 0x84, 0x93, 0x64, 0xcc, 0x62, 0x4f, 0x91, 0x6d, 0xaf, 0xf9, 0xfe, + 0x4d, 0xf7, 0xb3, 0xec, 0xc6, 0x9f, 0x3a, 0x6e, 0x6a, 0x25, 0x48, 0x35, 0xc0, 0x11, 0x1f, 0xfc, + 0x16, 0x6b, 0x0e, 0x1a, 0x51, 0x64, 0x4c, 0x7f, 0x0a, 0x07, 0x15, 0x13, 0xeb, 0x5a, 0x73, 0xe8, + 0x4d, 0x38, 0x5a, 0x9e, 0xe2, 0xa8, 0xf3, 0x23, 0x58, 0x7e, 0x4c, 0xb8, 0xa8, 0xe3, 0x7d, 0x65, + 0x69, 0x5c, 0x42, 0x50, 0xe2, 0x57, 0x91, 0x76, 0xc7, 0x95, 0xdf, 0xce, 0x01, 0x80, 0x76, 0x3b, + 0xf2, 0xaf, 0x04, 0x20, 0x67, 0xcf, 0x48, 0xa8, 0x4d, 0x94, 0x80, 0x7a, 0x50, 0x12, 0xde, 0x49, + 0x6f, 0x1a, 0x3b, 0x73, 0xdb, 0xaa, 0x71, 0x6d, 0x8b, 0x13, 0x5c, 0xb9, 0xe2, 0x7c, 0x01, 0x8b, + 0x07, 0xc4, 0x27, 0x9c, 0x48, 0x9d, 0x3e, 0xce, 0x54, 0x61, 0x51, 0x55, 0xa1, 0xd3, 0x83, 0x05, + 0x7d, 0xaf, 0x59, 0x0b, 0x5d, 0xa7, 0xce, 0x5f, 0x2d, 0x58, 0xfa, 0x39, 0x0d, 0xbd, 0x63, 0x1d, + 0x19, 0x63, 0x97, 0xfa, 0x69, 0x4d, 0xd7, 0x62, 0x7a, 0xd9, 0xc2, 0xf4, 0x65, 0xa7, 0xc3, 0x5f, + 0xbc, 0x6d, 0xf8, 0x4b, 0x1f, 0x0b, 0x7f, 0x79, 0x26, 0xfc, 0xce, 0xdf, 0x2c, 0xb8, 0x7f, 0x44, + 0x93, 0x8c, 0x4b, 0x08, 0x4a, 0x11, 0x1e, 0x12, 0xed, 0x94, 0xfc, 0x16, 0xba, 0x84, 0xfe, 0x5e, + 0xb5, 0x9e, 0xa2, 0x2b, 0xbf, 0x85, 0xeb, 0x63, 0x7d, 0x41, 0xb7, 0x30, 0xf6, 0xa4, 0x0d, 0x8b, + 0xb9, 0xbe, 0x81, 0xfc, 0xd6, 0xe1, 0x29, 0x9b, 0x00, 0x66, 0xc8, 0x5e, 0xc9, 0x92, 0x7d, 0x52, + 0x6f, 0xd5, 0x5e, 0x71, 0xaa, 0xde, 0x9a, 0x50, 0xf6, 0x69, 0x40, 0xb9, 0xec, 0x26, 0x45, 0x57, + 0x09, 0xce, 0x63, 0x98, 0x9f, 0xdc, 0x3b, 0xcd, 0x3b, 0xc7, 0xbe, 0xbe, 0xb6, 0x12, 0xa6, 0xf2, + 0x5e, 0xcc, 0xc9, 0xfb, 0x33, 0x58, 0x9a, 0xa5, 0x9a, 0x80, 0x6b, 0x41, 0x85, 0x84, 0xf8, 0xdc, + 0x57, 0x61, 0xa8, 0xb9, 0x5a, 0xd2, 0x0e, 0xa9, 0x74, 0x09, 0x87, 0xf2, 0x89, 0x6f, 0xa8, 0x5a, + 0x9a, 0xa2, 0xea, 0x1f, 0x2d, 0x58, 0x39, 0x95, 0x3d, 0x5e, 0x1c, 0x38, 0xcb, 0x91, 0xd9, 0x9e, + 0xbf, 0x01, 0x73, 0xcc, 0xf7, 0xce, 0xb2, 0xa5, 0xe8, 0x36, 0x98, 0x9f, 0xb2, 0x0b, 0x7d, 0x05, + 0x73, 0x21, 0x19, 0x9f, 0xdd, 0x88, 0x2e, 0x8d, 0x90, 0x8c, 0xcd, 0x46, 0xe7, 0x17, 0xd0, 0xd6, + 0x6e, 0x1f, 0xa7, 0x4f, 0x68, 0xa2, 0x5c, 0xdf, 0x01, 0x98, 0x3c, 0xab, 0x92, 0xfc, 0x8d, 0x1d, + 0x64, 0x22, 0x37, 0xb1, 0x76, 0xa7, 0xac, 0x9c, 0xbf, 0x58, 0xb0, 0x70, 0xf2, 0xd1, 0xca, 0xc8, + 0x74, 0xa3, 0xc2, 0x5d, 0xbb, 0xd1, 0xcd, 0xca, 0x61, 0x9a, 0x65, 0xa5, 0x0c, 0xcb, 0x9c, 0xff, + 0x59, 0x50, 0x3d, 0xb8, 0x0a, 0x71, 0x40, 0x07, 0xd7, 0x6e, 0xd8, 0x86, 0xaa, 0x38, 0xf4, 0x4c, + 0x27, 0xb8, 0xe8, 0x56, 0x84, 0x78, 0xa8, 0x92, 0xcc, 0x42, 0x4e, 0x42, 0x9e, 0x26, 0x59, 0x89, + 0x99, 0x24, 0x97, 0x55, 0x92, 0x33, 0x4f, 0x75, 0x75, 0xe6, 0xa9, 0xce, 0x0e, 0x16, 0xe5, 0x4f, + 0x1d, 0x2c, 0x2a, 0xb7, 0x1e, 0x2c, 0x9c, 0x63, 0x68, 0x99, 0xc2, 0xd1, 0x71, 0xb8, 0x43, 0xdd, + 0x53, 0x95, 0x09, 0xd5, 0xf2, 0x7e, 0x0d, 0xcd, 0x6b, 0x88, 0xf9, 0x15, 0xf9, 0x43, 0xa8, 0x7a, + 0xca, 0x4a, 0x17, 0xe5, 0x7d, 0x43, 0x2d, 0xb3, 0xd9, 0xac, 0x3b, 0x7f, 0xb6, 0xa0, 0x74, 0x42, + 0x87, 0xe1, 0xcd, 0x13, 0xd5, 0x86, 0xaa, 0x18, 0x58, 0x44, 0x68, 0x8a, 0xfa, 0xd1, 0xa6, 0xc3, + 0x50, 0x8f, 0x53, 0x91, 0x2e, 0xc5, 0x02, 0x8d, 0x3e, 0x39, 0x0f, 0x3b, 0xff, 0x9c, 0x87, 0xaa, + 0xf0, 0x78, 0xf7, 0xf8, 0x10, 0x61, 0xa8, 0x99, 0x27, 0x18, 0x75, 0x8d, 0x37, 0x39, 0x8f, 0xb2, + 0x9d, 0x56, 0xd2, 0xe4, 0xcd, 0x72, 0x7a, 0x7f, 0x78, 0xfd, 0x9f, 0x3f, 0x15, 0x6c, 0x67, 0xb9, + 0x3f, 0x35, 0x63, 0xf7, 0xcd, 0xd8, 0xf4, 0xc8, 0xda, 0x42, 0xbf, 0x81, 0xb2, 0xb4, 0xbf, 0x1b, + 0xfe, 0xe7, 0x12, 0xbf, 0xed, 0xa0, 0x0c, 0xbe, 0x1c, 0xe4, 0x04, 0xf8, 0x29, 0x54, 0x8e, 0xd8, + 0x90, 0x8d, 0x38, 0x6a, 0x5d, 0x0b, 0xc1, 0xb7, 0x62, 0xe8, 0xb6, 0x73, 0xf4, 0xce, 0xaa, 0x04, + 0x5e, 0xde, 0x5a, 0x9a, 0x05, 0x16, 0x60, 0xdf, 0x42, 0x55, 0xb7, 0x18, 0xd4, 0x32, 0x97, 0xca, + 0xbe, 0x9e, 0x76, 0xa6, 0x21, 0x3b, 0x4d, 0x89, 0xb6, 0x80, 0xe6, 0xa6, 0xd1, 0xd0, 0x73, 0x40, + 0xd7, 0x5b, 0x26, 0xda, 0x48, 0x77, 0xe6, 0xb5, 0xd3, 0xdc, 0x4b, 0xeb, 0x68, 0xdb, 0xd9, 0x68, + 0x9b, 0xe6, 0x21, 0x02, 0xf2, 0x14, 0x16, 0xa7, 0x60, 0x63, 0x76, 0x21, 0xa6, 0xe9, 0xcc, 0x5d, + 0x73, 0xc1, 0xbb, 0x12, 0x7c, 0xc5, 0x6e, 0x66, 0xc1, 0x15, 0x86, 0x0a, 0x36, 0x4c, 0xe6, 0x0c, + 0xb4, 0x92, 0x92, 0x7f, 0x76, 0xf6, 0xc8, 0x3d, 0x41, 0x47, 0x69, 0x2b, 0x1b, 0x25, 0x17, 0xaa, + 0xbb, 0x9e, 0x97, 0x0d, 0x76, 0xb6, 0x21, 0xe7, 0x02, 0xb6, 0x25, 0xe0, 0xa2, 0x93, 0x01, 0x14, + 0x57, 0x75, 0xa1, 0x7a, 0x32, 0x9b, 0xc0, 0xdb, 0x61, 0xda, 0xd7, 0x30, 0x4f, 0xa1, 0x66, 0x9a, + 0x05, 0x6a, 0xa7, 0x54, 0xcd, 0x4e, 0x20, 0xf6, 0xf2, 0xf5, 0x05, 0x41, 0xe3, 0x15, 0x09, 0xba, + 0x84, 0x16, 0xb3, 0x6c, 0xa3, 0x09, 0x47, 0xbf, 0x4b, 0x07, 0xb3, 0x7d, 0x33, 0xf8, 0xcc, 0x50, + 0x2e, 0x3b, 0x48, 0xda, 0xab, 0x79, 0xcb, 0xe2, 0xa0, 0x35, 0x79, 0x50, 0x0b, 0x65, 0x93, 0x68, + 0x1e, 0xf6, 0x10, 0xd0, 0xf5, 0xa7, 0x33, 0xb7, 0x74, 0xba, 0x33, 0x07, 0xcd, 0x3e, 0xb7, 0x86, + 0x31, 0xa8, 0x9d, 0x65, 0x4c, 0x6a, 0x86, 0x02, 0x40, 0xfb, 0x38, 0x3c, 0x3c, 0x8d, 0x7c, 0x86, + 0xbd, 0x03, 0x36, 0x18, 0x89, 0xdf, 0x28, 0xb7, 0x2e, 0xd5, 0x1f, 0xc8, 0x63, 0x36, 0x50, 0x77, + 0xc6, 0xa7, 0x90, 0x8e, 0x24, 0xb0, 0x67, 0x80, 0x83, 0xc9, 0x44, 0x68, 0x1e, 0xca, 0xf5, 0xd9, + 0x7c, 0x64, 0x5f, 0x0e, 0x7b, 0x2d, 0x77, 0x3d, 0x3f, 0x9a, 0xba, 0xc9, 0xa3, 0x23, 0xa8, 0x8b, + 0x1e, 0xff, 0x84, 0x79, 0xf8, 0x2a, 0xd7, 0xa9, 0xb4, 0xf6, 0x84, 0xa9, 0xe1, 0x81, 0x9d, 0xe5, + 0x81, 0xe8, 0xf4, 0xe8, 0x57, 0x92, 0x07, 0xc2, 0x8a, 0x78, 0x77, 0x80, 0x44, 0x1f, 0x80, 0x7c, + 0x91, 0x1d, 0xe8, 0x4f, 0x38, 0x89, 0x7e, 0x19, 0x12, 0x94, 0x12, 0xe8, 0x03, 0xd3, 0x7e, 0x6e, + 0x12, 0xbe, 0x94, 0xc7, 0x7c, 0xdf, 0xd9, 0xc8, 0x1c, 0x73, 0x41, 0x43, 0xcf, 0xb4, 0x9f, 0x7e, + 0xc2, 0x49, 0xc4, 0x42, 0xd9, 0x2a, 0x3e, 0x70, 0xf2, 0x93, 0x31, 0xfb, 0xa4, 0x93, 0xed, 0xef, + 0x38, 0x99, 0x8f, 0xd9, 0x23, 0x6b, 0x6b, 0xef, 0x27, 0x7f, 0x7f, 0xbb, 0x6e, 0xbd, 0x7a, 0xbb, + 0x6e, 0xfd, 0xfb, 0xed, 0xba, 0xf5, 0xf2, 0xdd, 0xfa, 0xbd, 0x57, 0xef, 0xd6, 0xef, 0xfd, 0xe3, + 0xdd, 0xfa, 0x3d, 0xd0, 0x7f, 0xf9, 0x1c, 0x5b, 0x4f, 0x17, 0x03, 0x16, 0x13, 0x8f, 0x0d, 0x34, + 0xe0, 0xd7, 0x97, 0x0f, 0xce, 0x2b, 0xf2, 0xd0, 0x87, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x52, + 0xfe, 0x43, 0xaf, 0x2b, 0x12, 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 + +// UserAPIClient is the client API for UserAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type UserAPIClient interface { + // 用户注册 + Register(ctx context.Context, in *RegisterAndLoginRequest, opts ...grpc.CallOption) (*LoginReply, error) + // 用户登录 + Login(ctx context.Context, in *RegisterAndLoginRequest, opts ...grpc.CallOption) (*LoginReply, error) + // 退出登录 + Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) + // 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + // 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + UpdateUserPassword(ctx context.Context, in *UpdateUserPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + // 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + UpdateUserProfile(ctx context.Context, in *User, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除用户。需要验证用户权限 + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 新增用户 + AddUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 设置用户 + SetUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 查询用户列表。对于非管理员,返回相应用户的公开信息; + // 对于管理员,返回相应用户的绝大部分信息 + ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserReply, error) + // GetUserCaptcha 获取用户验证码 + GetUserCaptcha(ctx context.Context, in *GetUserCaptchaRequest, opts ...grpc.CallOption) (*GetUserCaptchaReply, error) + // GetUserCaptcha 获取用户验证码 + GetUserPermissions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetUserPermissionsReply, error) + // 用户是否可以上传文档 + CanIUploadDocument(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 获取用户动态,包括获取关注的用户的动态 + ListUserDynamic(ctx context.Context, in *ListUserDynamicRequest, opts ...grpc.CallOption) (*ListUserDynamicReply, error) + // 每日签到 + SignToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error) + // 获取今日已签到记录 + GetSignedToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error) + FindPasswordStepOne(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + FindPasswordStepTwo(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type userAPIClient struct { + cc *grpc.ClientConn +} + +func NewUserAPIClient(cc *grpc.ClientConn) UserAPIClient { + return &userAPIClient{cc} +} + +func (c *userAPIClient) Register(ctx context.Context, in *RegisterAndLoginRequest, opts ...grpc.CallOption) (*LoginReply, error) { + out := new(LoginReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) Login(ctx context.Context, in *RegisterAndLoginRequest, opts ...grpc.CallOption) (*LoginReply, error) { + out := new(LoginReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/Logout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/GetUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) UpdateUserPassword(ctx context.Context, in *UpdateUserPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/UpdateUserPassword", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) UpdateUserProfile(ctx context.Context, in *User, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/UpdateUserProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/DeleteUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) AddUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/AddUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) SetUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/SetUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserReply, error) { + out := new(ListUserReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/ListUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) GetUserCaptcha(ctx context.Context, in *GetUserCaptchaRequest, opts ...grpc.CallOption) (*GetUserCaptchaReply, error) { + out := new(GetUserCaptchaReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/GetUserCaptcha", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) GetUserPermissions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetUserPermissionsReply, error) { + out := new(GetUserPermissionsReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/GetUserPermissions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) CanIUploadDocument(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/CanIUploadDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) ListUserDynamic(ctx context.Context, in *ListUserDynamicRequest, opts ...grpc.CallOption) (*ListUserDynamicReply, error) { + out := new(ListUserDynamicReply) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/ListUserDynamic", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) SignToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error) { + out := new(Sign) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/SignToday", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) GetSignedToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error) { + out := new(Sign) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/GetSignedToday", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) FindPasswordStepOne(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/FindPasswordStepOne", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userAPIClient) FindPasswordStepTwo(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.v1.UserAPI/FindPasswordStepTwo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserAPIServer is the server API for UserAPI service. +type UserAPIServer interface { + // 用户注册 + Register(context.Context, *RegisterAndLoginRequest) (*LoginReply, error) + // 用户登录 + Login(context.Context, *RegisterAndLoginRequest) (*LoginReply, error) + // 退出登录 + Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + // 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 + GetUser(context.Context, *GetUserRequest) (*User, error) + // 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + // 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + UpdateUserPassword(context.Context, *UpdateUserPasswordRequest) (*emptypb.Empty, error) + // 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + // 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + UpdateUserProfile(context.Context, *User) (*emptypb.Empty, error) + // 删除用户。需要验证用户权限 + DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) + // 新增用户 + AddUser(context.Context, *SetUserRequest) (*emptypb.Empty, error) + // 设置用户 + SetUser(context.Context, *SetUserRequest) (*emptypb.Empty, error) + // 查询用户列表。对于非管理员,返回相应用户的公开信息; + // 对于管理员,返回相应用户的绝大部分信息 + ListUser(context.Context, *ListUserRequest) (*ListUserReply, error) + // GetUserCaptcha 获取用户验证码 + GetUserCaptcha(context.Context, *GetUserCaptchaRequest) (*GetUserCaptchaReply, error) + // GetUserCaptcha 获取用户验证码 + GetUserPermissions(context.Context, *emptypb.Empty) (*GetUserPermissionsReply, error) + // 用户是否可以上传文档 + CanIUploadDocument(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + // 获取用户动态,包括获取关注的用户的动态 + ListUserDynamic(context.Context, *ListUserDynamicRequest) (*ListUserDynamicReply, error) + // 每日签到 + SignToday(context.Context, *emptypb.Empty) (*Sign, error) + // 获取今日已签到记录 + GetSignedToday(context.Context, *emptypb.Empty) (*Sign, error) + FindPasswordStepOne(context.Context, *FindPasswordRequest) (*emptypb.Empty, error) + FindPasswordStepTwo(context.Context, *FindPasswordRequest) (*emptypb.Empty, error) +} + +// UnimplementedUserAPIServer can be embedded to have forward compatible implementations. +type UnimplementedUserAPIServer struct { +} + +func (*UnimplementedUserAPIServer) Register(ctx context.Context, req *RegisterAndLoginRequest) (*LoginReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (*UnimplementedUserAPIServer) Login(ctx context.Context, req *RegisterAndLoginRequest) (*LoginReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (*UnimplementedUserAPIServer) Logout(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} +func (*UnimplementedUserAPIServer) GetUser(ctx context.Context, req *GetUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (*UnimplementedUserAPIServer) UpdateUserPassword(ctx context.Context, req *UpdateUserPasswordRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPassword not implemented") +} +func (*UnimplementedUserAPIServer) UpdateUserProfile(ctx context.Context, req *User) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserProfile not implemented") +} +func (*UnimplementedUserAPIServer) DeleteUser(ctx context.Context, req *DeleteUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (*UnimplementedUserAPIServer) AddUser(ctx context.Context, req *SetUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddUser not implemented") +} +func (*UnimplementedUserAPIServer) SetUser(ctx context.Context, req *SetUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetUser not implemented") +} +func (*UnimplementedUserAPIServer) ListUser(ctx context.Context, req *ListUserRequest) (*ListUserReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (*UnimplementedUserAPIServer) GetUserCaptcha(ctx context.Context, req *GetUserCaptchaRequest) (*GetUserCaptchaReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserCaptcha not implemented") +} +func (*UnimplementedUserAPIServer) GetUserPermissions(ctx context.Context, req *emptypb.Empty) (*GetUserPermissionsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserPermissions not implemented") +} +func (*UnimplementedUserAPIServer) CanIUploadDocument(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CanIUploadDocument not implemented") +} +func (*UnimplementedUserAPIServer) ListUserDynamic(ctx context.Context, req *ListUserDynamicRequest) (*ListUserDynamicReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUserDynamic not implemented") +} +func (*UnimplementedUserAPIServer) SignToday(ctx context.Context, req *emptypb.Empty) (*Sign, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignToday not implemented") +} +func (*UnimplementedUserAPIServer) GetSignedToday(ctx context.Context, req *emptypb.Empty) (*Sign, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSignedToday not implemented") +} +func (*UnimplementedUserAPIServer) FindPasswordStepOne(ctx context.Context, req *FindPasswordRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindPasswordStepOne not implemented") +} +func (*UnimplementedUserAPIServer) FindPasswordStepTwo(ctx context.Context, req *FindPasswordRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindPasswordStepTwo not implemented") +} + +func RegisterUserAPIServer(s *grpc.Server, srv UserAPIServer) { + s.RegisterService(&_UserAPI_serviceDesc, srv) +} + +func _UserAPI_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterAndLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).Register(ctx, req.(*RegisterAndLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterAndLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).Login(ctx, req.(*RegisterAndLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/Logout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).Logout(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/GetUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_UpdateUserPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).UpdateUserPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/UpdateUserPassword", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).UpdateUserPassword(ctx, req.(*UpdateUserPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_UpdateUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(User) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).UpdateUserProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/UpdateUserProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).UpdateUserProfile(ctx, req.(*User)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/DeleteUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_AddUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).AddUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/AddUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).AddUser(ctx, req.(*SetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_SetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).SetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/SetUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).SetUser(ctx, req.(*SetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/ListUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).ListUser(ctx, req.(*ListUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_GetUserCaptcha_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserCaptchaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).GetUserCaptcha(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/GetUserCaptcha", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).GetUserCaptcha(ctx, req.(*GetUserCaptchaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_GetUserPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).GetUserPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/GetUserPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).GetUserPermissions(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_CanIUploadDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).CanIUploadDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/CanIUploadDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).CanIUploadDocument(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_ListUserDynamic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUserDynamicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).ListUserDynamic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/ListUserDynamic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).ListUserDynamic(ctx, req.(*ListUserDynamicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_SignToday_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).SignToday(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/SignToday", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).SignToday(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_GetSignedToday_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).GetSignedToday(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/GetSignedToday", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).GetSignedToday(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_FindPasswordStepOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).FindPasswordStepOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/FindPasswordStepOne", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).FindPasswordStepOne(ctx, req.(*FindPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserAPI_FindPasswordStepTwo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserAPIServer).FindPasswordStepTwo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.UserAPI/FindPasswordStepTwo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserAPIServer).FindPasswordStepTwo(ctx, req.(*FindPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _UserAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.UserAPI", + HandlerType: (*UserAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Register", + Handler: _UserAPI_Register_Handler, + }, + { + MethodName: "Login", + Handler: _UserAPI_Login_Handler, + }, + { + MethodName: "Logout", + Handler: _UserAPI_Logout_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserAPI_GetUser_Handler, + }, + { + MethodName: "UpdateUserPassword", + Handler: _UserAPI_UpdateUserPassword_Handler, + }, + { + MethodName: "UpdateUserProfile", + Handler: _UserAPI_UpdateUserProfile_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserAPI_DeleteUser_Handler, + }, + { + MethodName: "AddUser", + Handler: _UserAPI_AddUser_Handler, + }, + { + MethodName: "SetUser", + Handler: _UserAPI_SetUser_Handler, + }, + { + MethodName: "ListUser", + Handler: _UserAPI_ListUser_Handler, + }, + { + MethodName: "GetUserCaptcha", + Handler: _UserAPI_GetUserCaptcha_Handler, + }, + { + MethodName: "GetUserPermissions", + Handler: _UserAPI_GetUserPermissions_Handler, + }, + { + MethodName: "CanIUploadDocument", + Handler: _UserAPI_CanIUploadDocument_Handler, + }, + { + MethodName: "ListUserDynamic", + Handler: _UserAPI_ListUserDynamic_Handler, + }, + { + MethodName: "SignToday", + Handler: _UserAPI_SignToday_Handler, + }, + { + MethodName: "GetSignedToday", + Handler: _UserAPI_GetSignedToday_Handler, + }, + { + MethodName: "FindPasswordStepOne", + Handler: _UserAPI_FindPasswordStepOne_Handler, + }, + { + MethodName: "FindPasswordStepTwo", + Handler: _UserAPI_FindPasswordStepTwo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/user.proto", +} + +func (m *User) 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 *User) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreditCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.CreditCount)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } + 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 = encodeVarintUser(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + 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 = encodeVarintUser(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.LoginAt != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.LoginAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.LoginAt):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintUser(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if len(m.GroupId) > 0 { + dAtA5 := make([]byte, len(m.GroupId)*10) + var j4 int + for _, num1 := range m.GroupId { + num := uint64(num1) + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintUser(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.Realname) > 0 { + i -= len(m.Realname) + copy(dAtA[i:], m.Realname) + i = encodeVarintUser(dAtA, i, uint64(len(m.Realname))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintUser(dAtA, i, uint64(len(m.Identity))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Avatar) > 0 { + i -= len(m.Avatar) + copy(dAtA[i:], m.Avatar) + i = encodeVarintUser(dAtA, i, uint64(len(m.Avatar))) + i-- + dAtA[i] = 0x7a + } + if m.Status != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x70 + } + if m.CommentCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.CommentCount)) + i-- + dAtA[i] = 0x68 + } + if m.FavoriteCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.FavoriteCount)) + i-- + dAtA[i] = 0x60 + } + if m.FansCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.FansCount)) + i-- + dAtA[i] = 0x58 + } + if m.FollowCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.FollowCount)) + i-- + dAtA[i] = 0x50 + } + if m.DocCount != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.DocCount)) + i-- + dAtA[i] = 0x48 + } + if len(m.RegisterIp) > 0 { + i -= len(m.RegisterIp) + copy(dAtA[i:], m.RegisterIp) + i = encodeVarintUser(dAtA, i, uint64(len(m.RegisterIp))) + i-- + dAtA[i] = 0x42 + } + if len(m.LastLoginIp) > 0 { + i -= len(m.LastLoginIp) + copy(dAtA[i:], m.LastLoginIp) + i = encodeVarintUser(dAtA, i, uint64(len(m.LastLoginIp))) + i-- + dAtA[i] = 0x3a + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintUser(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x32 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintUser(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x2a + } + if len(m.Email) > 0 { + i -= len(m.Email) + copy(dAtA[i:], m.Email) + i = encodeVarintUser(dAtA, i, uint64(len(m.Email))) + i-- + dAtA[i] = 0x22 + } + if len(m.Mobile) > 0 { + i -= len(m.Mobile) + copy(dAtA[i:], m.Mobile) + i = encodeVarintUser(dAtA, i, uint64(len(m.Mobile))) + i-- + dAtA[i] = 0x1a + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintUser(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RegisterAndLoginRequest) 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 *RegisterAndLoginRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterAndLoginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Email) > 0 { + i -= len(m.Email) + copy(dAtA[i:], m.Email) + i = encodeVarintUser(dAtA, i, uint64(len(m.Email))) + i-- + dAtA[i] = 0x2a + } + if len(m.CaptchaId) > 0 { + i -= len(m.CaptchaId) + copy(dAtA[i:], m.CaptchaId) + i = encodeVarintUser(dAtA, i, uint64(len(m.CaptchaId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Captcha) > 0 { + i -= len(m.Captcha) + copy(dAtA[i:], m.Captcha) + i = encodeVarintUser(dAtA, i, uint64(len(m.Captcha))) + i-- + dAtA[i] = 0x1a + } + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintUser(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x12 + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintUser(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetUserCaptchaRequest) 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 *GetUserCaptchaRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUserCaptchaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintUser(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LoginReply) 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 *LoginReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoginReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.User != nil { + { + size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUser(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintUser(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteUserRequest) 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 *DeleteUserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA8 := make([]byte, len(m.Id)*10) + var j7 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j7++ + } + dAtA8[j7] = uint8(num) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintUser(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetUserRequest) 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 *GetUserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FindPasswordRequest) 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 *FindPasswordRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindPasswordRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CaptchaId) > 0 { + i -= len(m.CaptchaId) + copy(dAtA[i:], m.CaptchaId) + i = encodeVarintUser(dAtA, i, uint64(len(m.CaptchaId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Captcha) > 0 { + i -= len(m.Captcha) + copy(dAtA[i:], m.Captcha) + i = encodeVarintUser(dAtA, i, uint64(len(m.Captcha))) + i-- + dAtA[i] = 0x22 + } + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintUser(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x1a + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintUser(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if len(m.Email) > 0 { + i -= len(m.Email) + copy(dAtA[i:], m.Email) + i = encodeVarintUser(dAtA, i, uint64(len(m.Email))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListUserRequest) 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 *ListUserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x40 + } + if len(m.Status) > 0 { + dAtA10 := make([]byte, len(m.Status)*10) + var j9 int + for _, num1 := range m.Status { + num := uint64(num1) + for num >= 1<<7 { + dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j9++ + } + dAtA10[j9] = uint8(num) + j9++ + } + i -= j9 + copy(dAtA[i:], dAtA10[:j9]) + i = encodeVarintUser(dAtA, i, uint64(j9)) + i-- + dAtA[i] = 0x3a + } + if len(m.GroupId) > 0 { + dAtA12 := make([]byte, len(m.GroupId)*10) + var j11 int + for _, num1 := range m.GroupId { + num := uint64(num1) + for num >= 1<<7 { + dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j11++ + } + dAtA12[j11] = uint8(num) + j11++ + } + i -= j11 + copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintUser(dAtA, i, uint64(j11)) + i-- + dAtA[i] = 0x32 + } + if len(m.Id) > 0 { + dAtA14 := make([]byte, len(m.Id)*10) + var j13 int + for _, num1 := range m.Id { + num := uint64(num1) + for num >= 1<<7 { + dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j13++ + } + dAtA14[j13] = uint8(num) + j13++ + } + i -= j13 + copy(dAtA[i:], dAtA14[:j13]) + i = encodeVarintUser(dAtA, i, uint64(j13)) + i-- + dAtA[i] = 0x2a + } + if len(m.Sort) > 0 { + i -= len(m.Sort) + copy(dAtA[i:], m.Sort) + i = encodeVarintUser(dAtA, i, uint64(len(m.Sort))) + i-- + dAtA[i] = 0x22 + } + if len(m.Wd) > 0 { + i -= len(m.Wd) + copy(dAtA[i:], m.Wd) + i = encodeVarintUser(dAtA, i, uint64(len(m.Wd))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListUserReply) 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 *ListUserReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListUserReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.User) > 0 { + for iNdEx := len(m.User) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.User[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUser(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetUserCaptchaReply) 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 *GetUserCaptchaReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUserCaptchaReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintUser(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + } + if len(m.Captcha) > 0 { + i -= len(m.Captcha) + copy(dAtA[i:], m.Captcha) + i = encodeVarintUser(dAtA, i, uint64(len(m.Captcha))) + i-- + dAtA[i] = 0x1a + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUser(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Enable { + i-- + if m.Enable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateUserPasswordRequest) 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 *UpdateUserPasswordRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateUserPasswordRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewPassword) > 0 { + i -= len(m.NewPassword) + copy(dAtA[i:], m.NewPassword) + i = encodeVarintUser(dAtA, i, uint64(len(m.NewPassword))) + i-- + dAtA[i] = 0x1a + } + if len(m.OldPassword) > 0 { + i -= len(m.OldPassword) + copy(dAtA[i:], m.OldPassword) + i = encodeVarintUser(dAtA, i, uint64(len(m.OldPassword))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetUserPermissionsReply) 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 *GetUserPermissionsReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUserPermissionsReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permission) > 0 { + for iNdEx := len(m.Permission) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Permission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUser(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SetUserRequest) 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 *SetUserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GroupId) > 0 { + dAtA16 := make([]byte, len(m.GroupId)*10) + var j15 int + for _, num1 := range m.GroupId { + num := uint64(num1) + for num >= 1<<7 { + dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j15++ + } + dAtA16[j15] = uint8(num) + j15++ + } + i -= j15 + copy(dAtA[i:], dAtA16[:j15]) + i = encodeVarintUser(dAtA, i, uint64(j15)) + i-- + dAtA[i] = 0x22 + } + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintUser(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x1a + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintUser(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Dynamic) 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 *Dynamic) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dynamic) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintUser(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x3a + } + if m.UpdatedAt != nil { + n17, err17 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):]) + if err17 != nil { + return 0, err17 + } + i -= n17 + i = encodeVarintUser(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x32 + } + if m.CreatedAt != nil { + n18, err18 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintUser(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x2a + } + if m.Type != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintUser(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if m.UserId != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListUserDynamicRequest) 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 *ListUserDynamicRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListUserDynamicRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if m.Size_ != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x10 + } + if m.Page != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Page)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListUserDynamicReply) 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 *ListUserDynamicReply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListUserDynamicReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Dynamic) > 0 { + for iNdEx := len(m.Dynamic) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dynamic[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUser(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Total != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Sign) 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 *Sign) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sign) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreatedAt != nil { + n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintUser(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x2a + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintUser(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x22 + } + if m.SignAt != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.SignAt)) + i-- + dAtA[i] = 0x18 + } + if m.UserId != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.UserId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintUser(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintUser(dAtA []byte, offset int, v uint64) int { + offset -= sovUser(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *User) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Mobile) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Email) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.LastLoginIp) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.RegisterIp) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if m.DocCount != 0 { + n += 1 + sovUser(uint64(m.DocCount)) + } + if m.FollowCount != 0 { + n += 1 + sovUser(uint64(m.FollowCount)) + } + if m.FansCount != 0 { + n += 1 + sovUser(uint64(m.FansCount)) + } + if m.FavoriteCount != 0 { + n += 1 + sovUser(uint64(m.FavoriteCount)) + } + if m.CommentCount != 0 { + n += 1 + sovUser(uint64(m.CommentCount)) + } + if m.Status != 0 { + n += 1 + sovUser(uint64(m.Status)) + } + l = len(m.Avatar) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Identity) + if l > 0 { + n += 2 + l + sovUser(uint64(l)) + } + l = len(m.Realname) + if l > 0 { + n += 2 + l + sovUser(uint64(l)) + } + if len(m.GroupId) > 0 { + l = 0 + for _, e := range m.GroupId { + l += sovUser(uint64(e)) + } + n += 2 + sovUser(uint64(l)) + l + } + if m.LoginAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.LoginAt) + n += 2 + l + sovUser(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 2 + l + sovUser(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 2 + l + sovUser(uint64(l)) + } + if m.CreditCount != 0 { + n += 2 + sovUser(uint64(m.CreditCount)) + } + return n +} + +func (m *RegisterAndLoginRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Username) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Password) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Captcha) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.CaptchaId) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Email) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *GetUserCaptchaRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *LoginReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Token) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if m.User != nil { + l = m.User.Size() + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *DeleteUserRequest) 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 += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + return n +} + +func (m *GetUserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + return n +} + +func (m *FindPasswordRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Email) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Password) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Captcha) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.CaptchaId) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *ListUserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovUser(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovUser(uint64(m.Size_)) + } + l = len(m.Wd) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Sort) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if len(m.Id) > 0 { + l = 0 + for _, e := range m.Id { + l += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + if len(m.GroupId) > 0 { + l = 0 + for _, e := range m.GroupId { + l += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + if len(m.Status) > 0 { + l = 0 + for _, e := range m.Status { + l += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + if m.Limit != 0 { + n += 1 + sovUser(uint64(m.Limit)) + } + return n +} + +func (m *ListUserReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovUser(uint64(m.Total)) + } + if len(m.User) > 0 { + for _, e := range m.User { + l = e.Size() + n += 1 + l + sovUser(uint64(l)) + } + } + return n +} + +func (m *GetUserCaptchaReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enable { + n += 2 + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Captcha) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *UpdateUserPasswordRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + l = len(m.OldPassword) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.NewPassword) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *GetUserPermissionsReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Permission) > 0 { + for _, e := range m.Permission { + l = e.Size() + n += 1 + l + sovUser(uint64(l)) + } + } + return n +} + +func (m *SetUserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Password) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if len(m.GroupId) > 0 { + l = 0 + for _, e := range m.GroupId { + l += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + return n +} + +func (m *Dynamic) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + if m.UserId != 0 { + n += 1 + sovUser(uint64(m.UserId)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovUser(uint64(m.Type)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovUser(uint64(l)) + } + if m.UpdatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt) + n += 1 + l + sovUser(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func (m *ListUserDynamicRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Page != 0 { + n += 1 + sovUser(uint64(m.Page)) + } + if m.Size_ != 0 { + n += 1 + sovUser(uint64(m.Size_)) + } + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + return n +} + +func (m *ListUserDynamicReply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovUser(uint64(m.Total)) + } + if len(m.Dynamic) > 0 { + for _, e := range m.Dynamic { + l = e.Size() + n += 1 + l + sovUser(uint64(l)) + } + } + return n +} + +func (m *Sign) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUser(uint64(m.Id)) + } + if m.UserId != 0 { + n += 1 + sovUser(uint64(m.UserId)) + } + if m.SignAt != 0 { + n += 1 + sovUser(uint64(m.SignAt)) + } + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovUser(uint64(l)) + } + if m.CreatedAt != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt) + n += 1 + l + sovUser(uint64(l)) + } + return n +} + +func sovUser(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozUser(x uint64) (n int) { + return sovUser(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *User) 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 ErrIntOverflowUser + } + 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: User: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: User: 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mobile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mobile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Email = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastLoginIp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastLoginIp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterIp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisterIp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DocCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FollowCount", wireType) + } + m.FollowCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FollowCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FansCount", wireType) + } + m.FansCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FansCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FavoriteCount", wireType) + } + m.FavoriteCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FavoriteCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommentCount", wireType) + } + m.CommentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommentCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Avatar", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Avatar = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Realname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Realname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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.GroupId) == 0 { + m.GroupId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoginAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LoginAt == nil { + m.LoginAt = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.LoginAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 21: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditCount", wireType) + } + m.CreditCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreditCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisterAndLoginRequest) 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 ErrIntOverflowUser + } + 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: RegisterAndLoginRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterAndLoginRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Captcha", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Captcha = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CaptchaId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CaptchaId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Email = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetUserCaptchaRequest) 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 ErrIntOverflowUser + } + 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: GetUserCaptchaRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetUserCaptchaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoginReply) 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 ErrIntOverflowUser + } + 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: LoginReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LoginReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteUserRequest) 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 ErrIntOverflowUser + } + 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: DeleteUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteUserRequest: 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 ErrIntOverflowUser + } + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 ErrIntOverflowUser + } + 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 := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetUserRequest) 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 ErrIntOverflowUser + } + 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: GetUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetUserRequest: 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 ErrIntOverflowUser + } + 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 := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FindPasswordRequest) 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 ErrIntOverflowUser + } + 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: FindPasswordRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FindPasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Email = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Captcha", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Captcha = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CaptchaId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CaptchaId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListUserRequest) 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 ErrIntOverflowUser + } + 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: ListUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListUserRequest: 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 ErrIntOverflowUser + } + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Wd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 ErrIntOverflowUser + } + 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) + } + case 6: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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.GroupId) == 0 { + m.GroupId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + case 7: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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.Status) == 0 { + m.Status = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = append(m.Status, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListUserReply) 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 ErrIntOverflowUser + } + 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: ListUserReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListUserReply: 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 ErrIntOverflowUser + } + 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 User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = append(m.User, &User{}) + if err := m.User[len(m.User)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetUserCaptchaReply) 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 ErrIntOverflowUser + } + 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: GetUserCaptchaReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetUserCaptchaReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowUser + } + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Captcha", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Captcha = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateUserPasswordRequest) 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 ErrIntOverflowUser + } + 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: UpdateUserPasswordRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateUserPasswordRequest: 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldPassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OldPassword = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewPassword = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetUserPermissionsReply) 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 ErrIntOverflowUser + } + 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: GetUserPermissionsReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetUserPermissionsReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = append(m.Permission, &Permission{}) + if err := m.Permission[len(m.Permission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SetUserRequest) 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 ErrIntOverflowUser + } + 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: SetUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetUserRequest: 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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.GroupId) == 0 { + m.GroupId = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GroupId = append(m.GroupId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Dynamic) 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 ErrIntOverflowUser + } + 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: Dynamic: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Dynamic: 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 6: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListUserDynamicRequest) 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 ErrIntOverflowUser + } + 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: ListUserDynamicRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListUserDynamicRequest: 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 ErrIntOverflowUser + } + 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 ErrIntOverflowUser + } + 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 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListUserDynamicReply) 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 ErrIntOverflowUser + } + 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: ListUserDynamicReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListUserDynamicReply: 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 ErrIntOverflowUser + } + 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 Dynamic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dynamic = append(m.Dynamic, &Dynamic{}) + if err := m.Dynamic[len(m.Dynamic)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sign) 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 ErrIntOverflowUser + } + 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: Sign: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sign: 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SignAt", wireType) + } + m.SignAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SignAt |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + 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 ErrInvalidLengthUser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUser + } + 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 + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipUser(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, ErrIntOverflowUser + } + 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, ErrIntOverflowUser + } + 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, ErrIntOverflowUser + } + 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, ErrInvalidLengthUser + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupUser + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthUser + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUser = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupUser = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/v1/user.pb.gw.go b/api/v1/user.pb.gw.go new file mode 100644 index 0000000..99a4661 --- /dev/null +++ b/api/v1/user.pb.gw.go @@ -0,0 +1,1477 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v1/user.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_UserAPI_Register_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterAndLoginRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Register(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_Register_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterAndLoginRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Register(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_Login_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterAndLoginRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).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_UserAPI_Login_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterAndLoginRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).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_UserAPI_Logout_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.Logout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_Logout_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.Logout(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserAPI_GetUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserAPI_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserRequest + 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_UserAPI_GetUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserRequest + 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_UserAPI_GetUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_UpdateUserPassword_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_UpdateUserPassword_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserPassword(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_UpdateUserProfile_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq User + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_UpdateUserProfile_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq User + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserProfile(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserAPI_DeleteUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserAPI_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteUserRequest + 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_UserAPI_DeleteUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteUserRequest + 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_UserAPI_DeleteUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_AddUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_AddUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_SetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_SetUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SetUser(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserAPI_ListUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserAPI_ListUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUserRequest + 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_UserAPI_ListUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_ListUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUserRequest + 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_UserAPI_ListUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUser(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserAPI_GetUserCaptcha_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserAPI_GetUserCaptcha_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserCaptchaRequest + 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_UserAPI_GetUserCaptcha_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUserCaptcha(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_GetUserCaptcha_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserCaptchaRequest + 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_UserAPI_GetUserCaptcha_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUserCaptcha(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_GetUserPermissions_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetUserPermissions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_GetUserPermissions_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.GetUserPermissions(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_CanIUploadDocument_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.CanIUploadDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_CanIUploadDocument_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.CanIUploadDocument(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserAPI_ListUserDynamic_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserAPI_ListUserDynamic_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUserDynamicRequest + 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_UserAPI_ListUserDynamic_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUserDynamic(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_ListUserDynamic_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUserDynamicRequest + 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_UserAPI_ListUserDynamic_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUserDynamic(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_SignToday_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.SignToday(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_SignToday_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.SignToday(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_GetSignedToday_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetSignedToday(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_GetSignedToday_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.GetSignedToday(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_FindPasswordStepOne_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FindPasswordStepOne(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_FindPasswordStepOne_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FindPasswordStepOne(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserAPI_FindPasswordStepTwo_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FindPasswordStepTwo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserAPI_FindPasswordStepTwo_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindPasswordRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FindPasswordStepTwo(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterUserAPIHandlerServer registers the http handlers for service UserAPI to "mux". +// UnaryRPC :call UserAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserAPIHandlerFromEndpoint instead. +func RegisterUserAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserAPIServer) error { + + mux.Handle("POST", pattern_UserAPI_Register_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_Register_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_Login_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserAPI_Logout_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_Logout_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUser_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_GetUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_UpdateUserPassword_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_UpdateUserPassword_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_UpdateUserPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_UpdateUserProfile_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_UpdateUserProfile_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_UpdateUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserAPI_DeleteUser_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_DeleteUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_DeleteUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_AddUser_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_AddUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_AddUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_SetUser_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_SetUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_SetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_ListUser_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_ListUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_ListUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUserCaptcha_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_GetUserCaptcha_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUserCaptcha_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUserPermissions_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_GetUserPermissions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUserPermissions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_CanIUploadDocument_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_CanIUploadDocument_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_CanIUploadDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_ListUserDynamic_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_ListUserDynamic_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_ListUserDynamic_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_SignToday_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_SignToday_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_SignToday_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetSignedToday_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_GetSignedToday_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetSignedToday_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_FindPasswordStepOne_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_FindPasswordStepOne_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_FindPasswordStepOne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_FindPasswordStepTwo_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserAPI_FindPasswordStepTwo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_FindPasswordStepTwo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterUserAPIHandlerFromEndpoint is same as RegisterUserAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUserAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterUserAPIHandler(ctx, mux, conn) +} + +// RegisterUserAPIHandler registers the http handlers for service UserAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUserAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUserAPIHandlerClient(ctx, mux, NewUserAPIClient(conn)) +} + +// RegisterUserAPIHandlerClient registers the http handlers for service UserAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UserAPIClient" to call the correct interceptors. +func RegisterUserAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserAPIClient) error { + + mux.Handle("POST", pattern_UserAPI_Register_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_Register_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_Login_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserAPI_Logout_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_Logout_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUser_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_GetUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_UpdateUserPassword_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_UpdateUserPassword_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_UpdateUserPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_UpdateUserProfile_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_UpdateUserProfile_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_UpdateUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserAPI_DeleteUser_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_DeleteUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_DeleteUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_AddUser_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_AddUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_AddUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_SetUser_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_SetUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_SetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_ListUser_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_ListUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_ListUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUserCaptcha_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_GetUserCaptcha_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUserCaptcha_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetUserPermissions_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_GetUserPermissions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetUserPermissions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_CanIUploadDocument_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_CanIUploadDocument_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_CanIUploadDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_ListUserDynamic_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_ListUserDynamic_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_ListUserDynamic_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_SignToday_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_SignToday_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_SignToday_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserAPI_GetSignedToday_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_GetSignedToday_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_GetSignedToday_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserAPI_FindPasswordStepOne_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_FindPasswordStepOne_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_FindPasswordStepOne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_UserAPI_FindPasswordStepTwo_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserAPI_FindPasswordStepTwo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserAPI_FindPasswordStepTwo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_UserAPI_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "register"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "login"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "logout"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "user"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_UpdateUserPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "password"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_UpdateUserProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "profile"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "user"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_AddUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "user"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_SetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "user"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_ListUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "list"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_GetUserCaptcha_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "captcha"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_GetUserPermissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "permission"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_CanIUploadDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "caniuploaddocument"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_ListUserDynamic_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "dynamic"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_SignToday_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "sign"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_GetSignedToday_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "sign"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_FindPasswordStepOne_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "user", "findpassword", "stepone"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_UserAPI_FindPasswordStepTwo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "user", "findpassword", "steptwo"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_UserAPI_Register_0 = runtime.ForwardResponseMessage + + forward_UserAPI_Login_0 = runtime.ForwardResponseMessage + + forward_UserAPI_Logout_0 = runtime.ForwardResponseMessage + + forward_UserAPI_GetUser_0 = runtime.ForwardResponseMessage + + forward_UserAPI_UpdateUserPassword_0 = runtime.ForwardResponseMessage + + forward_UserAPI_UpdateUserProfile_0 = runtime.ForwardResponseMessage + + forward_UserAPI_DeleteUser_0 = runtime.ForwardResponseMessage + + forward_UserAPI_AddUser_0 = runtime.ForwardResponseMessage + + forward_UserAPI_SetUser_0 = runtime.ForwardResponseMessage + + forward_UserAPI_ListUser_0 = runtime.ForwardResponseMessage + + forward_UserAPI_GetUserCaptcha_0 = runtime.ForwardResponseMessage + + forward_UserAPI_GetUserPermissions_0 = runtime.ForwardResponseMessage + + forward_UserAPI_CanIUploadDocument_0 = runtime.ForwardResponseMessage + + forward_UserAPI_ListUserDynamic_0 = runtime.ForwardResponseMessage + + forward_UserAPI_SignToday_0 = runtime.ForwardResponseMessage + + forward_UserAPI_GetSignedToday_0 = runtime.ForwardResponseMessage + + forward_UserAPI_FindPasswordStepOne_0 = runtime.ForwardResponseMessage + + forward_UserAPI_FindPasswordStepTwo_0 = runtime.ForwardResponseMessage +)