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

2965 lines
74 KiB

// 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")
)