dev
This commit is contained in:
408
pb/blocks.pb.go
Normal file
408
pb/blocks.pb.go
Normal file
@@ -0,0 +1,408 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v6.30.1
|
||||
// source: blocks.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type FetchRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PageNo int64 `protobuf:"varint,1,opt,name=page_no,json=pageNo,proto3" json:"page_no,omitempty"` // 页数
|
||||
PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 每页记录数
|
||||
Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 条件参数,key=val,eg key:category_id=?,vlaue=11
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *FetchRequest) Reset() {
|
||||
*x = FetchRequest{}
|
||||
mi := &file_blocks_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *FetchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FetchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *FetchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*FetchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *FetchRequest) GetPageNo() int64 {
|
||||
if x != nil {
|
||||
return x.PageNo
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *FetchRequest) GetPageSize() int64 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *FetchRequest) GetParams() map[string]string {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type IdentRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 唯一ID
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一码
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *IdentRequest) Reset() {
|
||||
*x = IdentRequest{}
|
||||
mi := &file_blocks_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *IdentRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IdentRequest) ProtoMessage() {}
|
||||
|
||||
func (x *IdentRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IdentRequest.ProtoReflect.Descriptor instead.
|
||||
func (*IdentRequest) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *IdentRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *IdentRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type VersionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // 时序版本号
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *VersionRequest) Reset() {
|
||||
*x = VersionRequest{}
|
||||
mi := &file_blocks_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *VersionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VersionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *VersionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*VersionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *VersionRequest) GetVersion() int64 {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SearchRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` //关键词
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SearchRequest) Reset() {
|
||||
*x = SearchRequest{}
|
||||
mi := &file_blocks_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SearchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SearchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SearchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SearchRequest) GetKeyword() string {
|
||||
if x != nil {
|
||||
return x.Keyword
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type StatusReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // 状态码
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 标识码
|
||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` //状态说明
|
||||
Timeseq int64 `protobuf:"varint,4,opt,name=timeseq,proto3" json:"timeseq,omitempty"` // 响应时间序列
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatusReply) Reset() {
|
||||
*x = StatusReply{}
|
||||
mi := &file_blocks_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatusReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusReply) ProtoMessage() {}
|
||||
|
||||
func (x *StatusReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
|
||||
func (*StatusReply) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *StatusReply) GetStatus() int64 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StatusReply) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StatusReply) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StatusReply) GetTimeseq() int64 {
|
||||
if x != nil {
|
||||
return x.Timeseq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Empty struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Empty) Reset() {
|
||||
*x = Empty{}
|
||||
mi := &file_blocks_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Empty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Empty) ProtoMessage() {}
|
||||
|
||||
func (x *Empty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_blocks_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
|
||||
func (*Empty) Descriptor() ([]byte, []int) {
|
||||
return file_blocks_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_blocks_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_blocks_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\fblocks.proto\x12\acontent\"\xba\x01\n" +
|
||||
"\fFetchRequest\x12\x17\n" +
|
||||
"\apage_no\x18\x01 \x01(\x03R\x06pageNo\x12\x1b\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\bpageSize\x129\n" +
|
||||
"\x06params\x18\x03 \x03(\v2!.content.FetchRequest.ParamsEntryR\x06params\x1a9\n" +
|
||||
"\vParamsEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\":\n" +
|
||||
"\fIdentRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
"\bidentity\x18\x02 \x01(\tR\bidentity\"*\n" +
|
||||
"\x0eVersionRequest\x12\x18\n" +
|
||||
"\aversion\x18\x01 \x01(\x03R\aversion\")\n" +
|
||||
"\rSearchRequest\x12\x18\n" +
|
||||
"\akeyword\x18\x01 \x01(\tR\akeyword\"u\n" +
|
||||
"\vStatusReply\x12\x16\n" +
|
||||
"\x06status\x18\x01 \x01(\x03R\x06status\x12\x1a\n" +
|
||||
"\bidentity\x18\x02 \x01(\tR\bidentity\x12\x18\n" +
|
||||
"\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" +
|
||||
"\atimeseq\x18\x04 \x01(\x03R\atimeseq\"\a\n" +
|
||||
"\x05EmptyB\fZ\n" +
|
||||
"./;contentb\x06proto3"
|
||||
|
||||
var (
|
||||
file_blocks_proto_rawDescOnce sync.Once
|
||||
file_blocks_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_blocks_proto_rawDescGZIP() []byte {
|
||||
file_blocks_proto_rawDescOnce.Do(func() {
|
||||
file_blocks_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)))
|
||||
})
|
||||
return file_blocks_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_blocks_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_blocks_proto_goTypes = []any{
|
||||
(*FetchRequest)(nil), // 0: content.FetchRequest
|
||||
(*IdentRequest)(nil), // 1: content.IdentRequest
|
||||
(*VersionRequest)(nil), // 2: content.VersionRequest
|
||||
(*SearchRequest)(nil), // 3: content.SearchRequest
|
||||
(*StatusReply)(nil), // 4: content.StatusReply
|
||||
(*Empty)(nil), // 5: content.Empty
|
||||
nil, // 6: content.FetchRequest.ParamsEntry
|
||||
}
|
||||
var file_blocks_proto_depIdxs = []int32{
|
||||
6, // 0: content.FetchRequest.params:type_name -> content.FetchRequest.ParamsEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_blocks_proto_init() }
|
||||
func file_blocks_proto_init() {
|
||||
if File_blocks_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_blocks_proto_goTypes,
|
||||
DependencyIndexes: file_blocks_proto_depIdxs,
|
||||
MessageInfos: file_blocks_proto_msgTypes,
|
||||
}.Build()
|
||||
File_blocks_proto = out.File
|
||||
file_blocks_proto_goTypes = nil
|
||||
file_blocks_proto_depIdxs = nil
|
||||
}
|
||||
585
pb/category.pb.go
Normal file
585
pb/category.pb.go
Normal file
@@ -0,0 +1,585 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v6.30.1
|
||||
// source: category.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 无限极分类
|
||||
type CategoryItem struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
ParentIdentity string `protobuf:"bytes,2,opt,name=parent_identity,json=parentIdentity,proto3" json:"parent_identity,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
CoverPath string `protobuf:"bytes,4,opt,name=cover_path,json=coverPath,proto3" json:"cover_path,omitempty"`
|
||||
Intro string `protobuf:"bytes,5,opt,name=intro,proto3" json:"intro,omitempty"`
|
||||
CreatedAt string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt string `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Data []*CategoryItem `protobuf:"bytes,8,rep,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CategoryItem) Reset() {
|
||||
*x = CategoryItem{}
|
||||
mi := &file_category_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CategoryItem) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CategoryItem) ProtoMessage() {}
|
||||
|
||||
func (x *CategoryItem) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CategoryItem.ProtoReflect.Descriptor instead.
|
||||
func (*CategoryItem) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetParentIdentity() string {
|
||||
if x != nil {
|
||||
return x.ParentIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetCoverPath() string {
|
||||
if x != nil {
|
||||
return x.CoverPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetIntro() string {
|
||||
if x != nil {
|
||||
return x.Intro
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetCreatedAt() string {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetUpdatedAt() string {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CategoryItem) GetData() []*CategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CategoryListReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Data []*CategoryItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CategoryListReply) Reset() {
|
||||
*x = CategoryListReply{}
|
||||
mi := &file_category_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CategoryListReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CategoryListReply) ProtoMessage() {}
|
||||
|
||||
func (x *CategoryListReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CategoryListReply.ProtoReflect.Descriptor instead.
|
||||
func (*CategoryListReply) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CategoryListReply) GetData() []*CategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CategoryListReply) GetCount() int64 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type AddCategoryResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // 新增数据的唯一码
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddCategoryResponse) Reset() {
|
||||
*x = AddCategoryResponse{}
|
||||
mi := &file_category_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AddCategoryResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AddCategoryResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AddCategoryResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AddCategoryResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AddCategoryResponse) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AddCategoryResponse) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type AddCategoryRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` //
|
||||
ParentIdentity string `protobuf:"bytes,2,opt,name=parent_identity,json=parentIdentity,proto3" json:"parent_identity,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
CoverPath string `protobuf:"bytes,4,opt,name=cover_path,json=coverPath,proto3" json:"cover_path,omitempty"`
|
||||
Intro string `protobuf:"bytes,5,opt,name=intro,proto3" json:"intro,omitempty"`
|
||||
CreatedAt string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt string `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Data []*CategoryItem `protobuf:"bytes,8,rep,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) Reset() {
|
||||
*x = AddCategoryRequest{}
|
||||
mi := &file_category_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AddCategoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AddCategoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AddCategoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AddCategoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetParentIdentity() string {
|
||||
if x != nil {
|
||||
return x.ParentIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetCoverPath() string {
|
||||
if x != nil {
|
||||
return x.CoverPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetIntro() string {
|
||||
if x != nil {
|
||||
return x.Intro
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetCreatedAt() string {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetUpdatedAt() string {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetData() []*CategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ModifyCategoryRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` //
|
||||
ParentIdentity string `protobuf:"bytes,2,opt,name=parent_identity,json=parentIdentity,proto3" json:"parent_identity,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
CoverPath string `protobuf:"bytes,4,opt,name=cover_path,json=coverPath,proto3" json:"cover_path,omitempty"`
|
||||
Intro string `protobuf:"bytes,5,opt,name=intro,proto3" json:"intro,omitempty"`
|
||||
CreatedAt string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt string `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Data []*CategoryItem `protobuf:"bytes,8,rep,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) Reset() {
|
||||
*x = ModifyCategoryRequest{}
|
||||
mi := &file_category_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModifyCategoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ModifyCategoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ModifyCategoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ModifyCategoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetParentIdentity() string {
|
||||
if x != nil {
|
||||
return x.ParentIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetCoverPath() string {
|
||||
if x != nil {
|
||||
return x.CoverPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetIntro() string {
|
||||
if x != nil {
|
||||
return x.Intro
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetCreatedAt() string {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetUpdatedAt() string {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetData() []*CategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeleteCategoryRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` //
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteCategoryRequest) Reset() {
|
||||
*x = DeleteCategoryRequest{}
|
||||
mi := &file_category_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteCategoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteCategoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteCategoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_category_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteCategoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteCategoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_category_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *DeleteCategoryRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_category_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_category_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x0ecategory.proto\x12\acontent\x1a\fblocks.proto\"\x87\x02\n" +
|
||||
"\fCategoryItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12'\n" +
|
||||
"\x0fparent_identity\x18\x02 \x01(\tR\x0eparentIdentity\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12\x1d\n" +
|
||||
"\n" +
|
||||
"cover_path\x18\x04 \x01(\tR\tcoverPath\x12\x14\n" +
|
||||
"\x05intro\x18\x05 \x01(\tR\x05intro\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\tR\tcreatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\tR\tupdatedAt\x12)\n" +
|
||||
"\x04data\x18\b \x03(\v2\x15.content.CategoryItemR\x04data\"T\n" +
|
||||
"\x11CategoryListReply\x12)\n" +
|
||||
"\x04data\x18\x01 \x03(\v2\x15.content.CategoryItemR\x04data\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count\"1\n" +
|
||||
"\x13AddCategoryResponse\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\"\x8d\x02\n" +
|
||||
"\x12AddCategoryRequest\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12'\n" +
|
||||
"\x0fparent_identity\x18\x02 \x01(\tR\x0eparentIdentity\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12\x1d\n" +
|
||||
"\n" +
|
||||
"cover_path\x18\x04 \x01(\tR\tcoverPath\x12\x14\n" +
|
||||
"\x05intro\x18\x05 \x01(\tR\x05intro\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\tR\tcreatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\tR\tupdatedAt\x12)\n" +
|
||||
"\x04data\x18\b \x03(\v2\x15.content.CategoryItemR\x04data\"\x90\x02\n" +
|
||||
"\x15ModifyCategoryRequest\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12'\n" +
|
||||
"\x0fparent_identity\x18\x02 \x01(\tR\x0eparentIdentity\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12\x1d\n" +
|
||||
"\n" +
|
||||
"cover_path\x18\x04 \x01(\tR\tcoverPath\x12\x14\n" +
|
||||
"\x05intro\x18\x05 \x01(\tR\x05intro\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\tR\tcreatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\tR\tupdatedAt\x12)\n" +
|
||||
"\x04data\x18\b \x03(\v2\x15.content.CategoryItemR\x04data\"3\n" +
|
||||
"\x15DeleteCategoryRequest\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity2\x9c\x02\n" +
|
||||
"\bCategory\x12<\n" +
|
||||
"\fCategoryList\x12\x0e.content.Empty\x1a\x1a.content.CategoryListReply\"\x00\x12J\n" +
|
||||
"\vAddCategory\x12\x1b.content.AddCategoryRequest\x1a\x1c.content.AddCategoryResponse\"\x00\x12B\n" +
|
||||
"\x0eModifyCategory\x12\x1e.content.ModifyCategoryRequest\x1a\x0e.content.Empty\"\x00\x12B\n" +
|
||||
"\x0eDeleteCategory\x12\x1e.content.DeleteCategoryRequest\x1a\x0e.content.Empty\"\x00B\fZ\n" +
|
||||
"./;contentb\x06proto3"
|
||||
|
||||
var (
|
||||
file_category_proto_rawDescOnce sync.Once
|
||||
file_category_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_category_proto_rawDescGZIP() []byte {
|
||||
file_category_proto_rawDescOnce.Do(func() {
|
||||
file_category_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_category_proto_rawDesc), len(file_category_proto_rawDesc)))
|
||||
})
|
||||
return file_category_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_category_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_category_proto_goTypes = []any{
|
||||
(*CategoryItem)(nil), // 0: content.CategoryItem
|
||||
(*CategoryListReply)(nil), // 1: content.CategoryListReply
|
||||
(*AddCategoryResponse)(nil), // 2: content.AddCategoryResponse
|
||||
(*AddCategoryRequest)(nil), // 3: content.AddCategoryRequest
|
||||
(*ModifyCategoryRequest)(nil), // 4: content.ModifyCategoryRequest
|
||||
(*DeleteCategoryRequest)(nil), // 5: content.DeleteCategoryRequest
|
||||
(*Empty)(nil), // 6: content.Empty
|
||||
}
|
||||
var file_category_proto_depIdxs = []int32{
|
||||
0, // 0: content.CategoryItem.data:type_name -> content.CategoryItem
|
||||
0, // 1: content.CategoryListReply.data:type_name -> content.CategoryItem
|
||||
0, // 2: content.AddCategoryRequest.data:type_name -> content.CategoryItem
|
||||
0, // 3: content.ModifyCategoryRequest.data:type_name -> content.CategoryItem
|
||||
6, // 4: content.Category.CategoryList:input_type -> content.Empty
|
||||
3, // 5: content.Category.AddCategory:input_type -> content.AddCategoryRequest
|
||||
4, // 6: content.Category.ModifyCategory:input_type -> content.ModifyCategoryRequest
|
||||
5, // 7: content.Category.DeleteCategory:input_type -> content.DeleteCategoryRequest
|
||||
1, // 8: content.Category.CategoryList:output_type -> content.CategoryListReply
|
||||
2, // 9: content.Category.AddCategory:output_type -> content.AddCategoryResponse
|
||||
6, // 10: content.Category.ModifyCategory:output_type -> content.Empty
|
||||
6, // 11: content.Category.DeleteCategory:output_type -> content.Empty
|
||||
8, // [8:12] is the sub-list for method output_type
|
||||
4, // [4:8] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_category_proto_init() }
|
||||
func file_category_proto_init() {
|
||||
if File_category_proto != nil {
|
||||
return
|
||||
}
|
||||
file_blocks_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_category_proto_rawDesc), len(file_category_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_category_proto_goTypes,
|
||||
DependencyIndexes: file_category_proto_depIdxs,
|
||||
MessageInfos: file_category_proto_msgTypes,
|
||||
}.Build()
|
||||
File_category_proto = out.File
|
||||
file_category_proto_goTypes = nil
|
||||
file_category_proto_depIdxs = nil
|
||||
}
|
||||
241
pb/category_grpc.pb.go
Normal file
241
pb/category_grpc.pb.go
Normal file
@@ -0,0 +1,241 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.30.1
|
||||
// source: category.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Category_CategoryList_FullMethodName = "/content.Category/CategoryList"
|
||||
Category_AddCategory_FullMethodName = "/content.Category/AddCategory"
|
||||
Category_ModifyCategory_FullMethodName = "/content.Category/ModifyCategory"
|
||||
Category_DeleteCategory_FullMethodName = "/content.Category/DeleteCategory"
|
||||
)
|
||||
|
||||
// CategoryClient is the client API for Category service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// 系统分类
|
||||
type CategoryClient interface {
|
||||
// 分类列表
|
||||
CategoryList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CategoryListReply, error)
|
||||
AddCategory(ctx context.Context, in *AddCategoryRequest, opts ...grpc.CallOption) (*AddCategoryResponse, error)
|
||||
ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
}
|
||||
|
||||
type categoryClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCategoryClient(cc grpc.ClientConnInterface) CategoryClient {
|
||||
return &categoryClient{cc}
|
||||
}
|
||||
|
||||
func (c *categoryClient) CategoryList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CategoryListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CategoryListReply)
|
||||
err := c.cc.Invoke(ctx, Category_CategoryList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) AddCategory(ctx context.Context, in *AddCategoryRequest, opts ...grpc.CallOption) (*AddCategoryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddCategoryResponse)
|
||||
err := c.cc.Invoke(ctx, Category_AddCategory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Category_ModifyCategory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Category_DeleteCategory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// CategoryServer is the server API for Category service.
|
||||
// All implementations must embed UnimplementedCategoryServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 系统分类
|
||||
type CategoryServer interface {
|
||||
// 分类列表
|
||||
CategoryList(context.Context, *Empty) (*CategoryListReply, error)
|
||||
AddCategory(context.Context, *AddCategoryRequest) (*AddCategoryResponse, error)
|
||||
ModifyCategory(context.Context, *ModifyCategoryRequest) (*Empty, error)
|
||||
DeleteCategory(context.Context, *DeleteCategoryRequest) (*Empty, error)
|
||||
mustEmbedUnimplementedCategoryServer()
|
||||
}
|
||||
|
||||
// UnimplementedCategoryServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCategoryServer struct{}
|
||||
|
||||
func (UnimplementedCategoryServer) CategoryList(context.Context, *Empty) (*CategoryListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CategoryList not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) AddCategory(context.Context, *AddCategoryRequest) (*AddCategoryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddCategory not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) ModifyCategory(context.Context, *ModifyCategoryRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ModifyCategory not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) DeleteCategory(context.Context, *DeleteCategoryRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) mustEmbedUnimplementedCategoryServer() {}
|
||||
func (UnimplementedCategoryServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCategoryServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CategoryServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCategoryServer interface {
|
||||
mustEmbedUnimplementedCategoryServer()
|
||||
}
|
||||
|
||||
func RegisterCategoryServer(s grpc.ServiceRegistrar, srv CategoryServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCategoryServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Category_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Category_CategoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CategoryServer).CategoryList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Category_CategoryList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).CategoryList(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Category_AddCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddCategoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CategoryServer).AddCategory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Category_AddCategory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).AddCategory(ctx, req.(*AddCategoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Category_ModifyCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModifyCategoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CategoryServer).ModifyCategory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Category_ModifyCategory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).ModifyCategory(ctx, req.(*ModifyCategoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Category_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.(CategoryServer).DeleteCategory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Category_DeleteCategory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).DeleteCategory(ctx, req.(*DeleteCategoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Category_ServiceDesc is the grpc.ServiceDesc for Category service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Category_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "content.Category",
|
||||
HandlerType: (*CategoryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CategoryList",
|
||||
Handler: _Category_CategoryList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddCategory",
|
||||
Handler: _Category_AddCategory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ModifyCategory",
|
||||
Handler: _Category_ModifyCategory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteCategory",
|
||||
Handler: _Category_DeleteCategory_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "category.proto",
|
||||
}
|
||||
1018
pb/post.pb.go
Normal file
1018
pb/post.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
759
pb/post_grpc.pb.go
Normal file
759
pb/post_grpc.pb.go
Normal file
@@ -0,0 +1,759 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.30.1
|
||||
// source: post.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Post_PostList_FullMethodName = "/content.Post/PostList"
|
||||
Post_GetPost_FullMethodName = "/content.Post/GetPost"
|
||||
Post_AddPost_FullMethodName = "/content.Post/AddPost"
|
||||
Post_ModifyPost_FullMethodName = "/content.Post/ModifyPost"
|
||||
Post_DeletePost_FullMethodName = "/content.Post/DeletePost"
|
||||
Post_IncrPostLike_FullMethodName = "/content.Post/IncrPostLike"
|
||||
Post_DescPostLike_FullMethodName = "/content.Post/DescPostLike"
|
||||
Post_IncrPostUnlike_FullMethodName = "/content.Post/IncrPostUnlike"
|
||||
Post_DescPostUnlike_FullMethodName = "/content.Post/DescPostUnlike"
|
||||
Post_CommentList_FullMethodName = "/content.Post/CommentList"
|
||||
Post_AddComment_FullMethodName = "/content.Post/AddComment"
|
||||
Post_ModifyComment_FullMethodName = "/content.Post/ModifyComment"
|
||||
Post_DeleteComment_FullMethodName = "/content.Post/DeleteComment"
|
||||
Post_IncrCommentLike_FullMethodName = "/content.Post/IncrCommentLike"
|
||||
Post_DescCommentLike_FullMethodName = "/content.Post/DescCommentLike"
|
||||
Post_IncrCommentUnlike_FullMethodName = "/content.Post/IncrCommentUnlike"
|
||||
Post_DescCommentUnlike_FullMethodName = "/content.Post/DescCommentUnlike"
|
||||
)
|
||||
|
||||
// PostClient is the client API for Post service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// 正文
|
||||
type PostClient interface {
|
||||
// 文章列表
|
||||
PostList(ctx context.Context, in *PostListRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
// 获取文章详情
|
||||
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*PostItem, error)
|
||||
// 发布文章
|
||||
AddPost(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改文章
|
||||
ModifyPost(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除文章
|
||||
DeletePost(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点赞处理
|
||||
IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点踩处理
|
||||
IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论列表
|
||||
CommentList(ctx context.Context, in *CommentListRequest, opts ...grpc.CallOption) (*CommentListResponse, error)
|
||||
// 发布评论
|
||||
AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改评论
|
||||
ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除评论
|
||||
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点赞处理
|
||||
IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点踩处理
|
||||
IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type postClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPostClient(cc grpc.ClientConnInterface) PostClient {
|
||||
return &postClient{cc}
|
||||
}
|
||||
|
||||
func (c *postClient) PostList(ctx context.Context, in *PostListRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
err := c.cc.Invoke(ctx, Post_PostList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*PostItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostItem)
|
||||
err := c.cc.Invoke(ctx, Post_GetPost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) AddPost(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_AddPost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) ModifyPost(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_ModifyPost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DeletePost(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DeletePost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrPostLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescPostLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrPostUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescPostUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) CommentList(ctx context.Context, in *CommentListRequest, opts ...grpc.CallOption) (*CommentListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommentListResponse)
|
||||
err := c.cc.Invoke(ctx, Post_CommentList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_AddComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_ModifyComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DeleteComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrCommentLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescCommentLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrCommentUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescCommentUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PostServer is the server API for Post service.
|
||||
// All implementations must embed UnimplementedPostServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 正文
|
||||
type PostServer interface {
|
||||
// 文章列表
|
||||
PostList(context.Context, *PostListRequest) (*PostListReply, error)
|
||||
// 获取文章详情
|
||||
GetPost(context.Context, *GetPostRequest) (*PostItem, error)
|
||||
// 发布文章
|
||||
AddPost(context.Context, *PostItem) (*StatusReply, error)
|
||||
// 修改文章
|
||||
ModifyPost(context.Context, *PostItem) (*StatusReply, error)
|
||||
// 删除文章
|
||||
DeletePost(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 文章点赞处理
|
||||
IncrPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
DescPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 文章点踩处理
|
||||
IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
DescPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论列表
|
||||
CommentList(context.Context, *CommentListRequest) (*CommentListResponse, error)
|
||||
// 发布评论
|
||||
AddComment(context.Context, *CommentItem) (*StatusReply, error)
|
||||
// 修改评论
|
||||
ModifyComment(context.Context, *CommentItem) (*StatusReply, error)
|
||||
// 删除评论
|
||||
DeleteComment(context.Context, *DeleteCommentRequest) (*StatusReply, error)
|
||||
// 评论点赞处理
|
||||
IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
DescCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论点踩处理
|
||||
IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedPostServer()
|
||||
}
|
||||
|
||||
// UnimplementedPostServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPostServer struct{}
|
||||
|
||||
func (UnimplementedPostServer) PostList(context.Context, *PostListRequest) (*PostListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PostList not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) GetPost(context.Context, *GetPostRequest) (*PostItem, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) AddPost(context.Context, *PostItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddPost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) ModifyPost(context.Context, *PostItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ModifyPost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DeletePost(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeletePost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IncrPostLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DescPostLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IncrPostUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DescPostUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) CommentList(context.Context, *CommentListRequest) (*CommentListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CommentList not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) AddComment(context.Context, *CommentItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) ModifyComment(context.Context, *CommentItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ModifyComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DeleteComment(context.Context, *DeleteCommentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IncrCommentLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DescCommentLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IncrCommentUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DescCommentUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) mustEmbedUnimplementedPostServer() {}
|
||||
func (UnimplementedPostServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePostServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PostServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePostServer interface {
|
||||
mustEmbedUnimplementedPostServer()
|
||||
}
|
||||
|
||||
func RegisterPostServer(s grpc.ServiceRegistrar, srv PostServer) {
|
||||
// If the following call pancis, it indicates UnimplementedPostServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Post_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Post_PostList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).PostList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_PostList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).PostList(ctx, req.(*PostListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_GetPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).GetPost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_GetPost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).GetPost(ctx, req.(*GetPostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_AddPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).AddPost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_AddPost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).AddPost(ctx, req.(*PostItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_ModifyPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).ModifyPost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_ModifyPost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).ModifyPost(ctx, req.(*PostItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).DeletePost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DeletePost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DeletePost(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_IncrPostLike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).IncrPostLike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_IncrPostLike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).IncrPostLike(ctx, req.(*PostOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_DescPostLike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).DescPostLike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DescPostLike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DescPostLike(ctx, req.(*PostOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_IncrPostUnlike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).IncrPostUnlike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_IncrPostUnlike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).IncrPostUnlike(ctx, req.(*PostOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_DescPostUnlike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PostOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).DescPostUnlike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DescPostUnlike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DescPostUnlike(ctx, req.(*PostOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_CommentList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).CommentList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_CommentList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).CommentList(ctx, req.(*CommentListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_AddComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).AddComment(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_AddComment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).AddComment(ctx, req.(*CommentItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_ModifyComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).ModifyComment(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_ModifyComment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).ModifyComment(ctx, req.(*CommentItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_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.(PostServer).DeleteComment(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DeleteComment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DeleteComment(ctx, req.(*DeleteCommentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_IncrCommentLike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).IncrCommentLike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_IncrCommentLike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).IncrCommentLike(ctx, req.(*CommentOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_DescCommentLike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).DescCommentLike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DescCommentLike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DescCommentLike(ctx, req.(*CommentOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_IncrCommentUnlike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).IncrCommentUnlike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_IncrCommentUnlike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).IncrCommentUnlike(ctx, req.(*CommentOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Post_DescCommentUnlike_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommentOpIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServer).DescCommentUnlike(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Post_DescCommentUnlike_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).DescCommentUnlike(ctx, req.(*CommentOpIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Post_ServiceDesc is the grpc.ServiceDesc for Post service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Post_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "content.Post",
|
||||
HandlerType: (*PostServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "PostList",
|
||||
Handler: _Post_PostList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPost",
|
||||
Handler: _Post_GetPost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddPost",
|
||||
Handler: _Post_AddPost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ModifyPost",
|
||||
Handler: _Post_ModifyPost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeletePost",
|
||||
Handler: _Post_DeletePost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IncrPostLike",
|
||||
Handler: _Post_IncrPostLike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DescPostLike",
|
||||
Handler: _Post_DescPostLike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IncrPostUnlike",
|
||||
Handler: _Post_IncrPostUnlike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DescPostUnlike",
|
||||
Handler: _Post_DescPostUnlike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CommentList",
|
||||
Handler: _Post_CommentList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddComment",
|
||||
Handler: _Post_AddComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ModifyComment",
|
||||
Handler: _Post_ModifyComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteComment",
|
||||
Handler: _Post_DeleteComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IncrCommentLike",
|
||||
Handler: _Post_IncrCommentLike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DescCommentLike",
|
||||
Handler: _Post_DescCommentLike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IncrCommentUnlike",
|
||||
Handler: _Post_IncrCommentUnlike_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DescCommentUnlike",
|
||||
Handler: _Post_DescCommentUnlike_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "post.proto",
|
||||
}
|
||||
247
pb/tags.pb.go
Normal file
247
pb/tags.pb.go
Normal file
@@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v6.30.1
|
||||
// source: tags.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 无限极标签
|
||||
type TagsItem struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
ParentIdentity string `protobuf:"bytes,2,opt,name=parent_identity,json=parentIdentity,proto3" json:"parent_identity,omitempty"` // 为空表示顶级主题
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
CoverPath string `protobuf:"bytes,4,opt,name=cover_path,json=coverPath,proto3" json:"cover_path,omitempty"`
|
||||
Intro string `protobuf:"bytes,5,opt,name=intro,proto3" json:"intro,omitempty"`
|
||||
List []*TagsItem `protobuf:"bytes,9,rep,name=list,proto3" json:"list,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TagsItem) Reset() {
|
||||
*x = TagsItem{}
|
||||
mi := &file_tags_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TagsItem) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TagsItem) ProtoMessage() {}
|
||||
|
||||
func (x *TagsItem) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_tags_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TagsItem.ProtoReflect.Descriptor instead.
|
||||
func (*TagsItem) Descriptor() ([]byte, []int) {
|
||||
return file_tags_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetParentIdentity() string {
|
||||
if x != nil {
|
||||
return x.ParentIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetCoverPath() string {
|
||||
if x != nil {
|
||||
return x.CoverPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetIntro() string {
|
||||
if x != nil {
|
||||
return x.Intro
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagsItem) GetList() []*TagsItem {
|
||||
if x != nil {
|
||||
return x.List
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TagsListReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
List []*TagsItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TagsListReply) Reset() {
|
||||
*x = TagsListReply{}
|
||||
mi := &file_tags_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TagsListReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TagsListReply) ProtoMessage() {}
|
||||
|
||||
func (x *TagsListReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_tags_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TagsListReply.ProtoReflect.Descriptor instead.
|
||||
func (*TagsListReply) Descriptor() ([]byte, []int) {
|
||||
return file_tags_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *TagsListReply) GetList() []*TagsItem {
|
||||
if x != nil {
|
||||
return x.List
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TagsListReply) GetCount() int64 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_tags_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_tags_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"tags.proto\x12\acontent\x1a\fblocks.proto\"\xc1\x01\n" +
|
||||
"\bTagsItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12'\n" +
|
||||
"\x0fparent_identity\x18\x02 \x01(\tR\x0eparentIdentity\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12\x1d\n" +
|
||||
"\n" +
|
||||
"cover_path\x18\x04 \x01(\tR\tcoverPath\x12\x14\n" +
|
||||
"\x05intro\x18\x05 \x01(\tR\x05intro\x12%\n" +
|
||||
"\x04list\x18\t \x03(\v2\x11.content.TagsItemR\x04list\"L\n" +
|
||||
"\rTagsListReply\x12%\n" +
|
||||
"\x04list\x18\x01 \x03(\v2\x11.content.TagsItemR\x04list\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count2\xef\x01\n" +
|
||||
"\x04Tags\x12;\n" +
|
||||
"\bTagsList\x12\x15.content.IdentRequest\x1a\x16.content.TagsListReply\"\x00\x124\n" +
|
||||
"\aAddTags\x12\x11.content.TagsItem\x1a\x14.content.StatusReply\"\x00\x127\n" +
|
||||
"\n" +
|
||||
"ModifyTags\x12\x11.content.TagsItem\x1a\x14.content.StatusReply\"\x00\x12;\n" +
|
||||
"\n" +
|
||||
"DeleteTags\x12\x15.content.IdentRequest\x1a\x14.content.StatusReply\"\x00B\fZ\n" +
|
||||
"./;contentb\x06proto3"
|
||||
|
||||
var (
|
||||
file_tags_proto_rawDescOnce sync.Once
|
||||
file_tags_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_tags_proto_rawDescGZIP() []byte {
|
||||
file_tags_proto_rawDescOnce.Do(func() {
|
||||
file_tags_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tags_proto_rawDesc), len(file_tags_proto_rawDesc)))
|
||||
})
|
||||
return file_tags_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_tags_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_tags_proto_goTypes = []any{
|
||||
(*TagsItem)(nil), // 0: content.TagsItem
|
||||
(*TagsListReply)(nil), // 1: content.TagsListReply
|
||||
(*IdentRequest)(nil), // 2: content.IdentRequest
|
||||
(*StatusReply)(nil), // 3: content.StatusReply
|
||||
}
|
||||
var file_tags_proto_depIdxs = []int32{
|
||||
0, // 0: content.TagsItem.list:type_name -> content.TagsItem
|
||||
0, // 1: content.TagsListReply.list:type_name -> content.TagsItem
|
||||
2, // 2: content.Tags.TagsList:input_type -> content.IdentRequest
|
||||
0, // 3: content.Tags.AddTags:input_type -> content.TagsItem
|
||||
0, // 4: content.Tags.ModifyTags:input_type -> content.TagsItem
|
||||
2, // 5: content.Tags.DeleteTags:input_type -> content.IdentRequest
|
||||
1, // 6: content.Tags.TagsList:output_type -> content.TagsListReply
|
||||
3, // 7: content.Tags.AddTags:output_type -> content.StatusReply
|
||||
3, // 8: content.Tags.ModifyTags:output_type -> content.StatusReply
|
||||
3, // 9: content.Tags.DeleteTags:output_type -> content.StatusReply
|
||||
6, // [6:10] is the sub-list for method output_type
|
||||
2, // [2:6] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_tags_proto_init() }
|
||||
func file_tags_proto_init() {
|
||||
if File_tags_proto != nil {
|
||||
return
|
||||
}
|
||||
file_blocks_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_tags_proto_rawDesc), len(file_tags_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_tags_proto_goTypes,
|
||||
DependencyIndexes: file_tags_proto_depIdxs,
|
||||
MessageInfos: file_tags_proto_msgTypes,
|
||||
}.Build()
|
||||
File_tags_proto = out.File
|
||||
file_tags_proto_goTypes = nil
|
||||
file_tags_proto_depIdxs = nil
|
||||
}
|
||||
247
pb/tags_grpc.pb.go
Normal file
247
pb/tags_grpc.pb.go
Normal file
@@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.30.1
|
||||
// source: tags.proto
|
||||
|
||||
package content
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Tags_TagsList_FullMethodName = "/content.Tags/TagsList"
|
||||
Tags_AddTags_FullMethodName = "/content.Tags/AddTags"
|
||||
Tags_ModifyTags_FullMethodName = "/content.Tags/ModifyTags"
|
||||
Tags_DeleteTags_FullMethodName = "/content.Tags/DeleteTags"
|
||||
)
|
||||
|
||||
// TagsClient is the client API for Tags service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// 标签
|
||||
type TagsClient interface {
|
||||
// 标签列表
|
||||
TagsList(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error)
|
||||
// 创建标签
|
||||
AddTags(ctx context.Context, in *TagsItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改标签
|
||||
ModifyTags(ctx context.Context, in *TagsItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除标签
|
||||
DeleteTags(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type tagsClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTagsClient(cc grpc.ClientConnInterface) TagsClient {
|
||||
return &tagsClient{cc}
|
||||
}
|
||||
|
||||
func (c *tagsClient) TagsList(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TagsListReply)
|
||||
err := c.cc.Invoke(ctx, Tags_TagsList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) AddTags(ctx context.Context, in *TagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_AddTags_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) ModifyTags(ctx context.Context, in *TagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_ModifyTags_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) DeleteTags(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_DeleteTags_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TagsServer is the server API for Tags service.
|
||||
// All implementations must embed UnimplementedTagsServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 标签
|
||||
type TagsServer interface {
|
||||
// 标签列表
|
||||
TagsList(context.Context, *IdentRequest) (*TagsListReply, error)
|
||||
// 创建标签
|
||||
AddTags(context.Context, *TagsItem) (*StatusReply, error)
|
||||
// 修改标签
|
||||
ModifyTags(context.Context, *TagsItem) (*StatusReply, error)
|
||||
// 删除标签
|
||||
DeleteTags(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedTagsServer()
|
||||
}
|
||||
|
||||
// UnimplementedTagsServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedTagsServer struct{}
|
||||
|
||||
func (UnimplementedTagsServer) TagsList(context.Context, *IdentRequest) (*TagsListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method TagsList not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) AddTags(context.Context, *TagsItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddTags not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) ModifyTags(context.Context, *TagsItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ModifyTags not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) DeleteTags(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteTags not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) mustEmbedUnimplementedTagsServer() {}
|
||||
func (UnimplementedTagsServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTagsServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TagsServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTagsServer interface {
|
||||
mustEmbedUnimplementedTagsServer()
|
||||
}
|
||||
|
||||
func RegisterTagsServer(s grpc.ServiceRegistrar, srv TagsServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTagsServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Tags_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Tags_TagsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TagsServer).TagsList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Tags_TagsList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).TagsList(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_AddTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TagsItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TagsServer).AddTags(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Tags_AddTags_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).AddTags(ctx, req.(*TagsItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_ModifyTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TagsItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TagsServer).ModifyTags(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Tags_ModifyTags_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).ModifyTags(ctx, req.(*TagsItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_DeleteTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TagsServer).DeleteTags(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Tags_DeleteTags_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).DeleteTags(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Tags_ServiceDesc is the grpc.ServiceDesc for Tags service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Tags_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "content.Tags",
|
||||
HandlerType: (*TagsServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "TagsList",
|
||||
Handler: _Tags_TagsList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddTags",
|
||||
Handler: _Tags_AddTags_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ModifyTags",
|
||||
Handler: _Tags_ModifyTags_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteTags",
|
||||
Handler: _Tags_DeleteTags_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "tags.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user