From cdadfc2d5e44af0f96a430287db93fbad1a7ad7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=A2=A2=E7=90=A6?= <13436010+shizuizaodezaoan@user.noreply.gitee.com> Date: Thu, 4 Apr 2024 17:45:48 +0800 Subject: [PATCH] =?UTF-8?q?x=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discover.go | 4 +- discover.proto | 47 +- discover/discover.pb.go | 481 +++++++++++++------ discover/discover_grpc.pb.go | 37 ++ discoverclient/discover.go | 8 + go.mod | 10 +- internal/logic/createdetaillogic.go | 10 +- internal/logic/createfavoritecontentlogic.go | 12 +- internal/logic/creategoodsdiscoverlogic.go | 12 +- internal/logic/searchdetaillogic.go | 49 ++ internal/logic/searchfavoritecontentlogic.go | 1 + internal/logic/searchgoodsdiscoverlogic.go | 1 + internal/server/discoverserver.go | 13 +- model/detail.go | 12 +- model/favoritecontent.go | 1 + model/goodsdiscover.go | 33 +- 16 files changed, 530 insertions(+), 201 deletions(-) create mode 100644 internal/logic/searchdetaillogic.go diff --git a/discover.go b/discover.go index 100fc77..a84e579 100644 --- a/discover.go +++ b/discover.go @@ -21,8 +21,6 @@ import ( "gitee.com/A1001574000/discover-rpc/mysql" ) -var configFile = flag.String("f", "etc/discover.yaml", "the config file") - func main() { flag.Parse() @@ -38,7 +36,7 @@ func main() { viper.GetString("Nacos.group"), viper.GetString("Nacos.namespaceId"), viper.GetString("Nacos.host"), - viper.GetInt("Nacos.port"), "mysql") + viper.GetInt("Nacos.port"), "mysql", "es") if err != nil { log.Println(err) return diff --git a/discover.proto b/discover.proto index 2cd96c8..6b61379 100644 --- a/discover.proto +++ b/discover.proto @@ -4,26 +4,29 @@ package discover; option go_package="./discover"; message GoodsDiscover{ - int64 ID = 1; - string Content = 2; - string Images = 3; - string Viewers = 4; - int64 Favorites = 5; + int64 ID = 1; + int64 UserID = 2; + string Content = 3; + string Images = 4; + string Viewers = 5; + int64 Favorites = 6; } message Detail{ - int64 ID = 1; - int64 GoodsDiscoverID = 2; - string DetailName = 3; - string DetailSubstance = 4; + int64 ID = 1; + int64 UserID = 2; + int64 GoodsDiscoverID = 3; + string DetailName = 4; + string DetailSubstance = 5; } message FavoriteContent{ - int64 ID = 1; - int64 DetailID = 2; - string FavoriteContentName = 3; - string FavoriteContentImages = 4; - string FavoriteContentCont = 5; + int64 ID = 1; + int64 UserID = 2; + int64 DetailID = 3; + string FavoriteContentName = 4; + string FavoriteContentImages = 5; + string FavoriteContentCont = 6; } message CreateGoodsDiscoverRequest { @@ -50,6 +53,14 @@ message CreateFavoriteContentResponse { FavoriteContent favoriteContent = 1; } +message SearchDetailRequest{ + int64 GoodsDiscoverID = 1; +} + +message SearchDetailResponse{ + Detail detail = 1; +} + message SearchGoodsDiscoverRequest { int64 Offset = 1; int64 Limit = 2; @@ -57,7 +68,7 @@ message SearchGoodsDiscoverRequest { message SearchGoodsDiscoverResponse { repeated GoodsDiscover Infos = 1; - int64 Total = 2; + int64 Total = 2; } message SearchFavoriteContentRequest { @@ -67,9 +78,11 @@ message SearchFavoriteContentRequest { message SearchFavoriteContentResponse { repeated FavoriteContent Infos = 1; - int64 Total = 2; + int64 Total = 2; } + + service Discover { rpc CreateGoodsDiscover(CreateGoodsDiscoverRequest) returns(CreateGoodsDiscoverResponse); @@ -77,6 +90,8 @@ service Discover { rpc CreateFavoriteContent(CreateFavoriteContentRequest) returns(CreateFavoriteContentResponse); + rpc SearchDetail(SearchDetailRequest) returns(SearchDetailResponse); + rpc SearchGoodsDiscover(SearchGoodsDiscoverRequest) returns(SearchGoodsDiscoverResponse); rpc SearchFavoriteContent(SearchFavoriteContentRequest) returns(SearchFavoriteContentResponse); diff --git a/discover/discover.pb.go b/discover/discover.pb.go index f6044a9..adb3d1a 100644 --- a/discover/discover.pb.go +++ b/discover/discover.pb.go @@ -26,10 +26,11 @@ type GoodsDiscover struct { unknownFields protoimpl.UnknownFields ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - Content string `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` - Images string `protobuf:"bytes,3,opt,name=Images,proto3" json:"Images,omitempty"` - Viewers string `protobuf:"bytes,4,opt,name=Viewers,proto3" json:"Viewers,omitempty"` - Favorites int64 `protobuf:"varint,5,opt,name=Favorites,proto3" json:"Favorites,omitempty"` + UserID int64 `protobuf:"varint,2,opt,name=UserID,proto3" json:"UserID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` + Images string `protobuf:"bytes,4,opt,name=Images,proto3" json:"Images,omitempty"` + Viewers string `protobuf:"bytes,5,opt,name=Viewers,proto3" json:"Viewers,omitempty"` + Favorites int64 `protobuf:"varint,6,opt,name=Favorites,proto3" json:"Favorites,omitempty"` } func (x *GoodsDiscover) Reset() { @@ -71,6 +72,13 @@ func (x *GoodsDiscover) GetID() int64 { return 0 } +func (x *GoodsDiscover) GetUserID() int64 { + if x != nil { + return x.UserID + } + return 0 +} + func (x *GoodsDiscover) GetContent() string { if x != nil { return x.Content @@ -105,9 +113,10 @@ type Detail struct { unknownFields protoimpl.UnknownFields ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - GoodsDiscoverID int64 `protobuf:"varint,2,opt,name=GoodsDiscoverID,proto3" json:"GoodsDiscoverID,omitempty"` - DetailName string `protobuf:"bytes,3,opt,name=DetailName,proto3" json:"DetailName,omitempty"` - DetailSubstance string `protobuf:"bytes,4,opt,name=DetailSubstance,proto3" json:"DetailSubstance,omitempty"` + UserID int64 `protobuf:"varint,2,opt,name=UserID,proto3" json:"UserID,omitempty"` + GoodsDiscoverID int64 `protobuf:"varint,3,opt,name=GoodsDiscoverID,proto3" json:"GoodsDiscoverID,omitempty"` + DetailName string `protobuf:"bytes,4,opt,name=DetailName,proto3" json:"DetailName,omitempty"` + DetailSubstance string `protobuf:"bytes,5,opt,name=DetailSubstance,proto3" json:"DetailSubstance,omitempty"` } func (x *Detail) Reset() { @@ -149,6 +158,13 @@ func (x *Detail) GetID() int64 { return 0 } +func (x *Detail) GetUserID() int64 { + if x != nil { + return x.UserID + } + return 0 +} + func (x *Detail) GetGoodsDiscoverID() int64 { if x != nil { return x.GoodsDiscoverID @@ -176,10 +192,11 @@ type FavoriteContent struct { unknownFields protoimpl.UnknownFields ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - DetailID int64 `protobuf:"varint,2,opt,name=DetailID,proto3" json:"DetailID,omitempty"` - FavoriteContentName string `protobuf:"bytes,3,opt,name=FavoriteContentName,proto3" json:"FavoriteContentName,omitempty"` - FavoriteContentImages string `protobuf:"bytes,4,opt,name=FavoriteContentImages,proto3" json:"FavoriteContentImages,omitempty"` - FavoriteContentCont string `protobuf:"bytes,5,opt,name=FavoriteContentCont,proto3" json:"FavoriteContentCont,omitempty"` + UserID int64 `protobuf:"varint,2,opt,name=UserID,proto3" json:"UserID,omitempty"` + DetailID int64 `protobuf:"varint,3,opt,name=DetailID,proto3" json:"DetailID,omitempty"` + FavoriteContentName string `protobuf:"bytes,4,opt,name=FavoriteContentName,proto3" json:"FavoriteContentName,omitempty"` + FavoriteContentImages string `protobuf:"bytes,5,opt,name=FavoriteContentImages,proto3" json:"FavoriteContentImages,omitempty"` + FavoriteContentCont string `protobuf:"bytes,6,opt,name=FavoriteContentCont,proto3" json:"FavoriteContentCont,omitempty"` } func (x *FavoriteContent) Reset() { @@ -221,6 +238,13 @@ func (x *FavoriteContent) GetID() int64 { return 0 } +func (x *FavoriteContent) GetUserID() int64 { + if x != nil { + return x.UserID + } + return 0 +} + func (x *FavoriteContent) GetDetailID() int64 { if x != nil { return x.DetailID @@ -531,6 +555,100 @@ func (x *CreateFavoriteContentResponse) GetFavoriteContent() *FavoriteContent { return nil } +type SearchDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GoodsDiscoverID int64 `protobuf:"varint,1,opt,name=GoodsDiscoverID,proto3" json:"GoodsDiscoverID,omitempty"` +} + +func (x *SearchDetailRequest) Reset() { + *x = SearchDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_discover_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchDetailRequest) ProtoMessage() {} + +func (x *SearchDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_discover_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchDetailRequest.ProtoReflect.Descriptor instead. +func (*SearchDetailRequest) Descriptor() ([]byte, []int) { + return file_discover_proto_rawDescGZIP(), []int{9} +} + +func (x *SearchDetailRequest) GetGoodsDiscoverID() int64 { + if x != nil { + return x.GoodsDiscoverID + } + return 0 +} + +type SearchDetailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Detail *Detail `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *SearchDetailResponse) Reset() { + *x = SearchDetailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_discover_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchDetailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchDetailResponse) ProtoMessage() {} + +func (x *SearchDetailResponse) ProtoReflect() protoreflect.Message { + mi := &file_discover_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchDetailResponse.ProtoReflect.Descriptor instead. +func (*SearchDetailResponse) Descriptor() ([]byte, []int) { + return file_discover_proto_rawDescGZIP(), []int{10} +} + +func (x *SearchDetailResponse) GetDetail() *Detail { + if x != nil { + return x.Detail + } + return nil +} + type SearchGoodsDiscoverRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -543,7 +661,7 @@ type SearchGoodsDiscoverRequest struct { func (x *SearchGoodsDiscoverRequest) Reset() { *x = SearchGoodsDiscoverRequest{} if protoimpl.UnsafeEnabled { - mi := &file_discover_proto_msgTypes[9] + mi := &file_discover_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -556,7 +674,7 @@ func (x *SearchGoodsDiscoverRequest) String() string { func (*SearchGoodsDiscoverRequest) ProtoMessage() {} func (x *SearchGoodsDiscoverRequest) ProtoReflect() protoreflect.Message { - mi := &file_discover_proto_msgTypes[9] + mi := &file_discover_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -569,7 +687,7 @@ func (x *SearchGoodsDiscoverRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchGoodsDiscoverRequest.ProtoReflect.Descriptor instead. func (*SearchGoodsDiscoverRequest) Descriptor() ([]byte, []int) { - return file_discover_proto_rawDescGZIP(), []int{9} + return file_discover_proto_rawDescGZIP(), []int{11} } func (x *SearchGoodsDiscoverRequest) GetOffset() int64 { @@ -598,7 +716,7 @@ type SearchGoodsDiscoverResponse struct { func (x *SearchGoodsDiscoverResponse) Reset() { *x = SearchGoodsDiscoverResponse{} if protoimpl.UnsafeEnabled { - mi := &file_discover_proto_msgTypes[10] + mi := &file_discover_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -611,7 +729,7 @@ func (x *SearchGoodsDiscoverResponse) String() string { func (*SearchGoodsDiscoverResponse) ProtoMessage() {} func (x *SearchGoodsDiscoverResponse) ProtoReflect() protoreflect.Message { - mi := &file_discover_proto_msgTypes[10] + mi := &file_discover_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -624,7 +742,7 @@ func (x *SearchGoodsDiscoverResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchGoodsDiscoverResponse.ProtoReflect.Descriptor instead. func (*SearchGoodsDiscoverResponse) Descriptor() ([]byte, []int) { - return file_discover_proto_rawDescGZIP(), []int{10} + return file_discover_proto_rawDescGZIP(), []int{12} } func (x *SearchGoodsDiscoverResponse) GetInfos() []*GoodsDiscover { @@ -653,7 +771,7 @@ type SearchFavoriteContentRequest struct { func (x *SearchFavoriteContentRequest) Reset() { *x = SearchFavoriteContentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_discover_proto_msgTypes[11] + mi := &file_discover_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -666,7 +784,7 @@ func (x *SearchFavoriteContentRequest) String() string { func (*SearchFavoriteContentRequest) ProtoMessage() {} func (x *SearchFavoriteContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_discover_proto_msgTypes[11] + mi := &file_discover_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -679,7 +797,7 @@ func (x *SearchFavoriteContentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchFavoriteContentRequest.ProtoReflect.Descriptor instead. func (*SearchFavoriteContentRequest) Descriptor() ([]byte, []int) { - return file_discover_proto_rawDescGZIP(), []int{11} + return file_discover_proto_rawDescGZIP(), []int{13} } func (x *SearchFavoriteContentRequest) GetOffset() int64 { @@ -708,7 +826,7 @@ type SearchFavoriteContentResponse struct { func (x *SearchFavoriteContentResponse) Reset() { *x = SearchFavoriteContentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_discover_proto_msgTypes[12] + mi := &file_discover_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -721,7 +839,7 @@ func (x *SearchFavoriteContentResponse) String() string { func (*SearchFavoriteContentResponse) ProtoMessage() {} func (x *SearchFavoriteContentResponse) ProtoReflect() protoreflect.Message { - mi := &file_discover_proto_msgTypes[12] + mi := &file_discover_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -734,7 +852,7 @@ func (x *SearchFavoriteContentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchFavoriteContentResponse.ProtoReflect.Descriptor instead. func (*SearchFavoriteContentResponse) Descriptor() ([]byte, []int) { - return file_discover_proto_rawDescGZIP(), []int{12} + return file_discover_proto_rawDescGZIP(), []int{14} } func (x *SearchFavoriteContentResponse) GetInfos() []*FavoriteContent { @@ -755,126 +873,144 @@ var File_discover_proto protoreflect.FileDescriptor var file_discover_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x47, + 0x12, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x56, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x56, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x46, 0x61, 0x76, 0x6f, - 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x46, 0x61, 0x76, - 0x6f, 0x72, 0x69, 0x74, 0x65, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x69, 0x65, 0x77, 0x65, 0x72, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x73, 0x22, 0xa4, + 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x47, 0x6f, 0x6f, 0x64, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x75, 0x62, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x75, 0x62, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x75, 0x62, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xd7, 0x01, 0x0a, 0x0f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xef, 0x01, 0x0a, 0x0f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x49, 0x44, 0x12, 0x30, 0x0a, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x15, 0x46, 0x61, 0x76, 0x6f, 0x72, - 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x0a, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x44, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x44, 0x12, 0x30, 0x0a, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x46, 0x61, 0x76, 0x6f, - 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x22, - 0x5b, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, - 0x0d, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, - 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x0d, 0x67, - 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x5c, 0x0a, 0x1b, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x67, - 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x6f, - 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x0d, 0x67, 0x6f, 0x6f, - 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x3f, 0x0a, 0x13, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x14, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x63, 0x0a, - 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, - 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, - 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x4a, 0x0a, 0x1a, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x22, 0x62, 0x0a, 0x1b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x46, 0x61, 0x76, 0x6f, + 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x34, 0x0a, 0x15, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, + 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x22, 0x5b, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x0d, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x22, 0x5c, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x6f, - 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x05, 0x49, 0x6e, 0x66, - 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x4c, 0x0a, 0x1c, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x66, 0x0a, 0x1d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x52, 0x0d, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x22, 0x3f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x63, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, + 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, + 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x1d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x32, 0xf5, - 0x03, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x13, 0x43, + 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x22, 0x3f, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x49, + 0x44, 0x22, 0x40, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x22, 0x4a, 0x0a, 0x1a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, + 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x62, 0x0a, 0x1b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, + 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x22, 0x4c, 0x0a, 0x1c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x61, 0x76, + 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x66, 0x0a, 0x1d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, + 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x46, 0x61, 0x76, + 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x49, 0x6e, + 0x66, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x32, 0xc4, 0x04, 0x0a, 0x08, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x24, 0x2e, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, + 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x12, 0x24, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4d, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, - 0x1d, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, - 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, - 0x24, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x61, 0x76, 0x6f, + 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x62, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, + 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x15, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, - 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x26, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -889,7 +1025,7 @@ func file_discover_proto_rawDescGZIP() []byte { return file_discover_proto_rawDescData } -var file_discover_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_discover_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_discover_proto_goTypes = []interface{}{ (*GoodsDiscover)(nil), // 0: discover.GoodsDiscover (*Detail)(nil), // 1: discover.Detail @@ -900,10 +1036,12 @@ var file_discover_proto_goTypes = []interface{}{ (*CreateDetailResponse)(nil), // 6: discover.CreateDetailResponse (*CreateFavoriteContentRequest)(nil), // 7: discover.CreateFavoriteContentRequest (*CreateFavoriteContentResponse)(nil), // 8: discover.CreateFavoriteContentResponse - (*SearchGoodsDiscoverRequest)(nil), // 9: discover.SearchGoodsDiscoverRequest - (*SearchGoodsDiscoverResponse)(nil), // 10: discover.SearchGoodsDiscoverResponse - (*SearchFavoriteContentRequest)(nil), // 11: discover.SearchFavoriteContentRequest - (*SearchFavoriteContentResponse)(nil), // 12: discover.SearchFavoriteContentResponse + (*SearchDetailRequest)(nil), // 9: discover.SearchDetailRequest + (*SearchDetailResponse)(nil), // 10: discover.SearchDetailResponse + (*SearchGoodsDiscoverRequest)(nil), // 11: discover.SearchGoodsDiscoverRequest + (*SearchGoodsDiscoverResponse)(nil), // 12: discover.SearchGoodsDiscoverResponse + (*SearchFavoriteContentRequest)(nil), // 13: discover.SearchFavoriteContentRequest + (*SearchFavoriteContentResponse)(nil), // 14: discover.SearchFavoriteContentResponse } var file_discover_proto_depIdxs = []int32{ 0, // 0: discover.CreateGoodsDiscoverRequest.goodsDiscover:type_name -> discover.GoodsDiscover @@ -912,23 +1050,26 @@ var file_discover_proto_depIdxs = []int32{ 1, // 3: discover.CreateDetailResponse.detail:type_name -> discover.Detail 2, // 4: discover.CreateFavoriteContentRequest.favoriteContent:type_name -> discover.FavoriteContent 2, // 5: discover.CreateFavoriteContentResponse.favoriteContent:type_name -> discover.FavoriteContent - 0, // 6: discover.SearchGoodsDiscoverResponse.Infos:type_name -> discover.GoodsDiscover - 2, // 7: discover.SearchFavoriteContentResponse.Infos:type_name -> discover.FavoriteContent - 3, // 8: discover.Discover.CreateGoodsDiscover:input_type -> discover.CreateGoodsDiscoverRequest - 5, // 9: discover.Discover.CreateDetail:input_type -> discover.CreateDetailRequest - 7, // 10: discover.Discover.CreateFavoriteContent:input_type -> discover.CreateFavoriteContentRequest - 9, // 11: discover.Discover.SearchGoodsDiscover:input_type -> discover.SearchGoodsDiscoverRequest - 11, // 12: discover.Discover.SearchFavoriteContent:input_type -> discover.SearchFavoriteContentRequest - 4, // 13: discover.Discover.CreateGoodsDiscover:output_type -> discover.CreateGoodsDiscoverResponse - 6, // 14: discover.Discover.CreateDetail:output_type -> discover.CreateDetailResponse - 8, // 15: discover.Discover.CreateFavoriteContent:output_type -> discover.CreateFavoriteContentResponse - 10, // 16: discover.Discover.SearchGoodsDiscover:output_type -> discover.SearchGoodsDiscoverResponse - 12, // 17: discover.Discover.SearchFavoriteContent:output_type -> discover.SearchFavoriteContentResponse - 13, // [13:18] is the sub-list for method output_type - 8, // [8:13] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 1, // 6: discover.SearchDetailResponse.detail:type_name -> discover.Detail + 0, // 7: discover.SearchGoodsDiscoverResponse.Infos:type_name -> discover.GoodsDiscover + 2, // 8: discover.SearchFavoriteContentResponse.Infos:type_name -> discover.FavoriteContent + 3, // 9: discover.Discover.CreateGoodsDiscover:input_type -> discover.CreateGoodsDiscoverRequest + 5, // 10: discover.Discover.CreateDetail:input_type -> discover.CreateDetailRequest + 7, // 11: discover.Discover.CreateFavoriteContent:input_type -> discover.CreateFavoriteContentRequest + 9, // 12: discover.Discover.SearchDetail:input_type -> discover.SearchDetailRequest + 11, // 13: discover.Discover.SearchGoodsDiscover:input_type -> discover.SearchGoodsDiscoverRequest + 13, // 14: discover.Discover.SearchFavoriteContent:input_type -> discover.SearchFavoriteContentRequest + 4, // 15: discover.Discover.CreateGoodsDiscover:output_type -> discover.CreateGoodsDiscoverResponse + 6, // 16: discover.Discover.CreateDetail:output_type -> discover.CreateDetailResponse + 8, // 17: discover.Discover.CreateFavoriteContent:output_type -> discover.CreateFavoriteContentResponse + 10, // 18: discover.Discover.SearchDetail:output_type -> discover.SearchDetailResponse + 12, // 19: discover.Discover.SearchGoodsDiscover:output_type -> discover.SearchGoodsDiscoverResponse + 14, // 20: discover.Discover.SearchFavoriteContent:output_type -> discover.SearchFavoriteContentResponse + 15, // [15:21] is the sub-list for method output_type + 9, // [9:15] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_discover_proto_init() } @@ -1046,7 +1187,7 @@ func file_discover_proto_init() { } } file_discover_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchGoodsDiscoverRequest); i { + switch v := v.(*SearchDetailRequest); i { case 0: return &v.state case 1: @@ -1058,7 +1199,7 @@ func file_discover_proto_init() { } } file_discover_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchGoodsDiscoverResponse); i { + switch v := v.(*SearchDetailResponse); i { case 0: return &v.state case 1: @@ -1070,7 +1211,7 @@ func file_discover_proto_init() { } } file_discover_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchFavoriteContentRequest); i { + switch v := v.(*SearchGoodsDiscoverRequest); i { case 0: return &v.state case 1: @@ -1082,6 +1223,30 @@ func file_discover_proto_init() { } } file_discover_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchGoodsDiscoverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discover_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchFavoriteContentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discover_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchFavoriteContentResponse); i { case 0: return &v.state @@ -1100,7 +1265,7 @@ func file_discover_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_discover_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/discover/discover_grpc.pb.go b/discover/discover_grpc.pb.go index bdf9b50..2e42d45 100644 --- a/discover/discover_grpc.pb.go +++ b/discover/discover_grpc.pb.go @@ -22,6 +22,7 @@ const ( Discover_CreateGoodsDiscover_FullMethodName = "/discover.Discover/CreateGoodsDiscover" Discover_CreateDetail_FullMethodName = "/discover.Discover/CreateDetail" Discover_CreateFavoriteContent_FullMethodName = "/discover.Discover/CreateFavoriteContent" + Discover_SearchDetail_FullMethodName = "/discover.Discover/SearchDetail" Discover_SearchGoodsDiscover_FullMethodName = "/discover.Discover/SearchGoodsDiscover" Discover_SearchFavoriteContent_FullMethodName = "/discover.Discover/SearchFavoriteContent" ) @@ -33,6 +34,7 @@ type DiscoverClient interface { CreateGoodsDiscover(ctx context.Context, in *CreateGoodsDiscoverRequest, opts ...grpc.CallOption) (*CreateGoodsDiscoverResponse, error) CreateDetail(ctx context.Context, in *CreateDetailRequest, opts ...grpc.CallOption) (*CreateDetailResponse, error) CreateFavoriteContent(ctx context.Context, in *CreateFavoriteContentRequest, opts ...grpc.CallOption) (*CreateFavoriteContentResponse, error) + SearchDetail(ctx context.Context, in *SearchDetailRequest, opts ...grpc.CallOption) (*SearchDetailResponse, error) SearchGoodsDiscover(ctx context.Context, in *SearchGoodsDiscoverRequest, opts ...grpc.CallOption) (*SearchGoodsDiscoverResponse, error) SearchFavoriteContent(ctx context.Context, in *SearchFavoriteContentRequest, opts ...grpc.CallOption) (*SearchFavoriteContentResponse, error) } @@ -72,6 +74,15 @@ func (c *discoverClient) CreateFavoriteContent(ctx context.Context, in *CreateFa return out, nil } +func (c *discoverClient) SearchDetail(ctx context.Context, in *SearchDetailRequest, opts ...grpc.CallOption) (*SearchDetailResponse, error) { + out := new(SearchDetailResponse) + err := c.cc.Invoke(ctx, Discover_SearchDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *discoverClient) SearchGoodsDiscover(ctx context.Context, in *SearchGoodsDiscoverRequest, opts ...grpc.CallOption) (*SearchGoodsDiscoverResponse, error) { out := new(SearchGoodsDiscoverResponse) err := c.cc.Invoke(ctx, Discover_SearchGoodsDiscover_FullMethodName, in, out, opts...) @@ -97,6 +108,7 @@ type DiscoverServer interface { CreateGoodsDiscover(context.Context, *CreateGoodsDiscoverRequest) (*CreateGoodsDiscoverResponse, error) CreateDetail(context.Context, *CreateDetailRequest) (*CreateDetailResponse, error) CreateFavoriteContent(context.Context, *CreateFavoriteContentRequest) (*CreateFavoriteContentResponse, error) + SearchDetail(context.Context, *SearchDetailRequest) (*SearchDetailResponse, error) SearchGoodsDiscover(context.Context, *SearchGoodsDiscoverRequest) (*SearchGoodsDiscoverResponse, error) SearchFavoriteContent(context.Context, *SearchFavoriteContentRequest) (*SearchFavoriteContentResponse, error) mustEmbedUnimplementedDiscoverServer() @@ -115,6 +127,9 @@ func (UnimplementedDiscoverServer) CreateDetail(context.Context, *CreateDetailRe func (UnimplementedDiscoverServer) CreateFavoriteContent(context.Context, *CreateFavoriteContentRequest) (*CreateFavoriteContentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateFavoriteContent not implemented") } +func (UnimplementedDiscoverServer) SearchDetail(context.Context, *SearchDetailRequest) (*SearchDetailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchDetail not implemented") +} func (UnimplementedDiscoverServer) SearchGoodsDiscover(context.Context, *SearchGoodsDiscoverRequest) (*SearchGoodsDiscoverResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchGoodsDiscover not implemented") } @@ -188,6 +203,24 @@ func _Discover_CreateFavoriteContent_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Discover_SearchDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiscoverServer).SearchDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Discover_SearchDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiscoverServer).SearchDetail(ctx, req.(*SearchDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Discover_SearchGoodsDiscover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SearchGoodsDiscoverRequest) if err := dec(in); err != nil { @@ -243,6 +276,10 @@ var Discover_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateFavoriteContent", Handler: _Discover_CreateFavoriteContent_Handler, }, + { + MethodName: "SearchDetail", + Handler: _Discover_SearchDetail_Handler, + }, { MethodName: "SearchGoodsDiscover", Handler: _Discover_SearchGoodsDiscover_Handler, diff --git a/discoverclient/discover.go b/discoverclient/discover.go index 33489b3..088cd73 100644 --- a/discoverclient/discover.go +++ b/discoverclient/discover.go @@ -22,6 +22,8 @@ type ( Detail = discover.Detail FavoriteContent = discover.FavoriteContent GoodsDiscover = discover.GoodsDiscover + SearchDetailRequest = discover.SearchDetailRequest + SearchDetailResponse = discover.SearchDetailResponse SearchFavoriteContentRequest = discover.SearchFavoriteContentRequest SearchFavoriteContentResponse = discover.SearchFavoriteContentResponse SearchGoodsDiscoverRequest = discover.SearchGoodsDiscoverRequest @@ -31,6 +33,7 @@ type ( CreateGoodsDiscover(ctx context.Context, in *CreateGoodsDiscoverRequest, opts ...grpc.CallOption) (*CreateGoodsDiscoverResponse, error) CreateDetail(ctx context.Context, in *CreateDetailRequest, opts ...grpc.CallOption) (*CreateDetailResponse, error) CreateFavoriteContent(ctx context.Context, in *CreateFavoriteContentRequest, opts ...grpc.CallOption) (*CreateFavoriteContentResponse, error) + SearchDetail(ctx context.Context, in *SearchDetailRequest, opts ...grpc.CallOption) (*SearchDetailResponse, error) SearchGoodsDiscover(ctx context.Context, in *SearchGoodsDiscoverRequest, opts ...grpc.CallOption) (*SearchGoodsDiscoverResponse, error) SearchFavoriteContent(ctx context.Context, in *SearchFavoriteContentRequest, opts ...grpc.CallOption) (*SearchFavoriteContentResponse, error) } @@ -61,6 +64,11 @@ func (m *defaultDiscover) CreateFavoriteContent(ctx context.Context, in *CreateF return client.CreateFavoriteContent(ctx, in, opts...) } +func (m *defaultDiscover) SearchDetail(ctx context.Context, in *SearchDetailRequest, opts ...grpc.CallOption) (*SearchDetailResponse, error) { + client := discover.NewDiscoverClient(m.cli.Conn()) + return client.SearchDetail(ctx, in, opts...) +} + func (m *defaultDiscover) SearchGoodsDiscover(ctx context.Context, in *SearchGoodsDiscoverRequest, opts ...grpc.CallOption) (*SearchGoodsDiscoverResponse, error) { client := discover.NewDiscoverClient(m.cli.Conn()) return client.SearchGoodsDiscover(ctx, in, opts...) diff --git a/go.mod b/go.mod index 3a9df86..d9211cf 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,8 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/elastic/elastic-transport-go/v8 v8.5.0 // indirect + github.com/elastic/go-elasticsearch/v8 v8.13.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/fatih/color v1.16.0 // indirect github.com/go-logr/logr v1.3.0 // indirect @@ -85,16 +87,16 @@ require ( go.etcd.io/etcd/api/v3 v3.5.12 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect go.etcd.io/etcd/client/v3 v3.5.12 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.19.0 // indirect go.opentelemetry.io/otel/exporters/zipkin v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/sdk v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect diff --git a/internal/logic/createdetaillogic.go b/internal/logic/createdetaillogic.go index 75d48a4..76e080c 100644 --- a/internal/logic/createdetaillogic.go +++ b/internal/logic/createdetaillogic.go @@ -28,6 +28,7 @@ func NewCreateDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Crea func (l *CreateDetailLogic) CreateDetail(in *discover.CreateDetailRequest) (*discover.CreateDetailResponse, error) { arr := model.Detail{ + UserID: int(in.Detail.UserID), GoodsDiscoverID: int(in.Detail.GoodsDiscoverID), DetailName: in.Detail.DetailName, DetailSubstance: in.Detail.DetailSubstance, @@ -40,10 +41,11 @@ func (l *CreateDetailLogic) CreateDetail(in *discover.CreateDetailRequest) (*dis return &discover.CreateDetailResponse{ Detail: &discover.Detail{ - ID: int64(arr.ID), - GoodsDiscoverID: int64(arr.GoodsDiscoverID), - DetailName: arr.DetailName, - DetailSubstance: arr.DetailSubstance, + ID: int64(res.ID), + UserID: int64(res.UserID), + GoodsDiscoverID: int64(res.GoodsDiscoverID), + DetailName: res.DetailName, + DetailSubstance: res.DetailSubstance, }, }, nil } diff --git a/internal/logic/createfavoritecontentlogic.go b/internal/logic/createfavoritecontentlogic.go index 7efba4d..b76a668 100644 --- a/internal/logic/createfavoritecontentlogic.go +++ b/internal/logic/createfavoritecontentlogic.go @@ -29,6 +29,7 @@ func NewCreateFavoriteContentLogic(ctx context.Context, svcCtx *svc.ServiceConte func (l *CreateFavoriteContentLogic) CreateFavoriteContent(in *discover.CreateFavoriteContentRequest) (*discover.CreateFavoriteContentResponse, error) { arr := model.FavoriteContent{ + UserID: int(in.FavoriteContent.UserID), DetailID: int(in.FavoriteContent.DetailID), FavoriteContentName: in.FavoriteContent.FavoriteContentName, FavoriteContentImages: in.FavoriteContent.FavoriteContentImages, @@ -42,11 +43,12 @@ func (l *CreateFavoriteContentLogic) CreateFavoriteContent(in *discover.CreateFa return &discover.CreateFavoriteContentResponse{ FavoriteContent: &discover.FavoriteContent{ - ID: int64(arr.ID), - DetailID: int64(arr.DetailID), - FavoriteContentName: arr.FavoriteContentName, - FavoriteContentImages: arr.FavoriteContentImages, - FavoriteContentCont: arr.FavoriteContentCont, + ID: int64(res.ID), + UserID: int64(res.UserID), + DetailID: int64(res.DetailID), + FavoriteContentName: res.FavoriteContentName, + FavoriteContentImages: res.FavoriteContentImages, + FavoriteContentCont: res.FavoriteContentCont, }, }, nil } diff --git a/internal/logic/creategoodsdiscoverlogic.go b/internal/logic/creategoodsdiscoverlogic.go index b1fcd30..1548f16 100644 --- a/internal/logic/creategoodsdiscoverlogic.go +++ b/internal/logic/creategoodsdiscoverlogic.go @@ -29,6 +29,7 @@ func NewCreateGoodsDiscoverLogic(ctx context.Context, svcCtx *svc.ServiceContext func (l *CreateGoodsDiscoverLogic) CreateGoodsDiscover(in *discover.CreateGoodsDiscoverRequest) (*discover.CreateGoodsDiscoverResponse, error) { arr := model.GoodsDiscover{ + UserID: int(in.GoodsDiscover.UserID), Content: in.GoodsDiscover.Content, Images: in.GoodsDiscover.Images, Viewers: in.GoodsDiscover.Viewers, @@ -42,11 +43,12 @@ func (l *CreateGoodsDiscoverLogic) CreateGoodsDiscover(in *discover.CreateGoodsD return &discover.CreateGoodsDiscoverResponse{ GoodsDiscover: &discover.GoodsDiscover{ - ID: int64(arr.ID), - Content: arr.Content, - Images: arr.Images, - Viewers: arr.Viewers, - Favorites: int64(arr.Favorites), + ID: int64(res.ID), + UserID: int64(res.UserID), + Content: res.Content, + Images: res.Images, + Viewers: res.Viewers, + Favorites: int64(res.Favorites), }, }, nil } diff --git a/internal/logic/searchdetaillogic.go b/internal/logic/searchdetaillogic.go new file mode 100644 index 0000000..4df09da --- /dev/null +++ b/internal/logic/searchdetaillogic.go @@ -0,0 +1,49 @@ +package logic + +import ( + "context" + "net/http" + + "google.golang.org/grpc/status" + + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/model" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SearchDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSearchDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SearchDetailLogic { + return &SearchDetailLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *SearchDetailLogic) SearchDetail(in *discover.SearchDetailRequest) (*discover.SearchDetailResponse, error) { + arr := model.Detail{ + GoodsDiscoverID: int(in.GoodsDiscoverID), + } + + res := model.SearchDetail(arr) + if res.GoodsDiscoverID == 0 { + return nil, status.Errorf(http.StatusInternalServerError, "没有此类ID", nil) + } + + return &discover.SearchDetailResponse{ + Detail: &discover.Detail{ + ID: int64(res.ID), + UserID: int64(res.UserID), + GoodsDiscoverID: int64(res.GoodsDiscoverID), + DetailName: res.DetailName, + DetailSubstance: res.DetailSubstance, + }, + }, nil +} diff --git a/internal/logic/searchfavoritecontentlogic.go b/internal/logic/searchfavoritecontentlogic.go index e716dbf..be84997 100644 --- a/internal/logic/searchfavoritecontentlogic.go +++ b/internal/logic/searchfavoritecontentlogic.go @@ -32,6 +32,7 @@ func (l *SearchFavoriteContentLogic) SearchFavoriteContent(in *discover.SearchFa for _, v := range offset { info = append(info, &discover.FavoriteContent{ ID: int64(v.ID), + UserID: int64(v.UserID), DetailID: int64(v.DetailID), FavoriteContentName: v.FavoriteContentName, FavoriteContentImages: v.FavoriteContentImages, diff --git a/internal/logic/searchgoodsdiscoverlogic.go b/internal/logic/searchgoodsdiscoverlogic.go index 32ca6b7..f223f9e 100644 --- a/internal/logic/searchgoodsdiscoverlogic.go +++ b/internal/logic/searchgoodsdiscoverlogic.go @@ -32,6 +32,7 @@ func (l *SearchGoodsDiscoverLogic) SearchGoodsDiscover(in *discover.SearchGoodsD for _, v := range offset { info = append(info, &discover.GoodsDiscover{ ID: int64(v.ID), + UserID: int64(v.UserID), Content: v.Content, Images: v.Images, Viewers: v.Viewers, diff --git a/internal/server/discoverserver.go b/internal/server/discoverserver.go index d974d3e..d9c1a4e 100644 --- a/internal/server/discoverserver.go +++ b/internal/server/discoverserver.go @@ -26,7 +26,7 @@ func NewDiscoverServer(svcCtx *svc.ServiceContext) *DiscoverServer { } func (s *DiscoverServer) CreateGoodsDiscover(ctx context.Context, in *discover.CreateGoodsDiscoverRequest) (*discover.CreateGoodsDiscoverResponse, error) { - if in.GoodsDiscover.Content == "" || in.GoodsDiscover.Images == "" || in.GoodsDiscover.Favorites <= 0 || in.GoodsDiscover.Viewers== "" { + if in.GoodsDiscover.UserID <=0 || in.GoodsDiscover.Favorites <= 0 || in.GoodsDiscover.Viewers == "" || in.GoodsDiscover.Images == "" || in.GoodsDiscover.Content == ""{ return nil, status.Errorf(http.StatusBadRequest, "请求参数不完整", nil) } @@ -44,7 +44,7 @@ func (s *DiscoverServer) CreateDetail(ctx context.Context, in *discover.CreateDe } func (s *DiscoverServer) CreateFavoriteContent(ctx context.Context, in *discover.CreateFavoriteContentRequest) (*discover.CreateFavoriteContentResponse, error) { - if in.FavoriteContent.DetailID <= 0 || in.FavoriteContent.FavoriteContentName == "" || in.FavoriteContent.FavoriteContentImages == "" || in.FavoriteContent.FavoriteContentCont == ""{ + if in.FavoriteContent.UserID <=0 || in.FavoriteContent.DetailID <= 0 || in.FavoriteContent.FavoriteContentName == "" || in.FavoriteContent.FavoriteContentImages == "" || in.FavoriteContent.FavoriteContentCont == ""{ return nil, status.Errorf(http.StatusBadRequest, "请求参数不完整", nil) } @@ -52,6 +52,15 @@ func (s *DiscoverServer) CreateFavoriteContent(ctx context.Context, in *discover return l.CreateFavoriteContent(in) } +func (s *DiscoverServer) SearchDetail(ctx context.Context, in *discover.SearchDetailRequest) (*discover.SearchDetailResponse, error) { + if in == nil { + return nil, status.Errorf(http.StatusInternalServerError, "参数必填", nil) + } + + l := logic.NewSearchDetailLogic(ctx, s.svcCtx) + return l.SearchDetail(in) +} + func (s *DiscoverServer) SearchGoodsDiscover(ctx context.Context, in *discover.SearchGoodsDiscoverRequest) (*discover.SearchGoodsDiscoverResponse, error) { if in == nil { return nil, status.Errorf(http.StatusInternalServerError, "参数必填", nil) diff --git a/model/detail.go b/model/detail.go index 322b48c..833e6d0 100644 --- a/model/detail.go +++ b/model/detail.go @@ -8,12 +8,18 @@ import ( // Detail 商品详情表 type Detail struct { gorm.Model - GoodsDiscoverID int `json:"int(11);comment:商品内容ID"` - DetailName string `json:"varchar(25);comment:详情名称"` - DetailSubstance string `json:"varchar(50);comment:详情内容"` + UserID int `gorm:"int(11);comment:用户ID"` + GoodsDiscoverID int `gorm:"int(11);comment:商品内容ID"` + DetailName string `gorm:"varchar(25);comment:详情名称"` + DetailSubstance string `gorm:"varchar(50);comment:详情内容"` } func CreateDetail(d Detail) Detail { mysql.DB.Create(&d) return d } + +func SearchDetail(d Detail) Detail { + mysql.DB.Where("goods_discover_id = ?", d.GoodsDiscoverID).First(&d) + return d +} diff --git a/model/favoritecontent.go b/model/favoritecontent.go index e8c731a..ba0e502 100644 --- a/model/favoritecontent.go +++ b/model/favoritecontent.go @@ -8,6 +8,7 @@ import ( // FavoriteContent 喜欢内容表 type FavoriteContent struct { gorm.Model + UserID int `gorm:"int(11);comment:用户ID"` DetailID int `gorm:"int(11);comment:商品详情ID"` FavoriteContentName string `gorm:"varchar(30);comment:喜欢内容名称"` FavoriteContentImages string `gorm:"test;comment:喜欢内容图片"` diff --git a/model/goodsdiscover.go b/model/goodsdiscover.go index 290f779..70790ba 100644 --- a/model/goodsdiscover.go +++ b/model/goodsdiscover.go @@ -1,13 +1,18 @@ package model import ( + "log" + "strconv" + "github.com/BarnabyCharles/frame/databases/mysql" + "github.com/BarnabyCharles/frame/es" "gorm.io/gorm" ) // GoodsDiscover 商品内容表 type GoodsDiscover struct { gorm.Model + UserID int `gorm:"int(11);comment:用户ID"` Content string `json:"varchar(30);comment:内容名称"` Images string `json:"text;comment:内容图片"` Viewers string `json:"varchar(20);comment:查看人数"` @@ -15,7 +20,33 @@ type GoodsDiscover struct { } func CreateGoodsDiscover(p GoodsDiscover) GoodsDiscover { - mysql.DB.Create(&p) + tx := mysql.DB.Begin() + + err := tx.Create(&p).Error + if err != nil { + tx.Rollback() + log.Println("添加数据库失败", err) + } + + err = es.InsertDataToEs("goods_discovers", strconv.Itoa(int(p.ID)), map[string]interface{}{ + "GoodsDiscover": GoodsDiscover{ + Model: gorm.Model{ + ID: p.ID, + }, + UserID: p.UserID, + Content: p.Content, + Images: p.Images, + Viewers: p.Viewers, + Favorites: p.Favorites, + }, + }) + if err != nil { + tx.Rollback() + log.Println("添加ES失败", err) + } + + tx.Commit() + return p } -- Gitee