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

594 lines
18 KiB

2 years ago
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.18.1
// source: test.proto
package proto
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
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 OrderStatus int32
const (
OrderStatus_FIRST_VAL OrderStatus = 0 //The first enum value must be zero in proto3.
OrderStatus_SECOND_VAL OrderStatus = 1
)
// Enum value maps for OrderStatus.
var (
OrderStatus_name = map[int32]string{
0: "FIRST_VAL",
1: "SECOND_VAL",
}
OrderStatus_value = map[string]int32{
"FIRST_VAL": 0,
"SECOND_VAL": 1,
}
)
func (x OrderStatus) Enum() *OrderStatus {
p := new(OrderStatus)
*p = x
return p
}
func (x OrderStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OrderStatus) Descriptor() protoreflect.EnumDescriptor {
return file_test_proto_enumTypes[0].Descriptor()
}
func (OrderStatus) Type() protoreflect.EnumType {
return &file_test_proto_enumTypes[0]
}
func (x OrderStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OrderStatus.Descriptor instead.
func (OrderStatus) EnumDescriptor() ([]byte, []int) {
return file_test_proto_rawDescGZIP(), []int{0}
}
// 结构体
type Order struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
No string `protobuf:"bytes,2,opt,name=no,proto3" json:"no,omitempty"`
Tel string `protobuf:"bytes,3,opt,name=tel,proto3" json:"tel,omitempty"`
Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
AddTime string `protobuf:"bytes,5,opt,name=addTime,proto3" json:"addTime,omitempty"`
Status OrderStatus `protobuf:"varint,6,opt,name=status,proto3,enum=proto.OrderStatus" json:"status,omitempty"`
Producets *Order_Producets `protobuf:"bytes,7,opt,name=producets,proto3" json:"producets,omitempty"`
}
func (x *Order) Reset() {
*x = Order{}
if protoimpl.UnsafeEnabled {
mi := &file_test_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Order) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Order) ProtoMessage() {}
func (x *Order) ProtoReflect() protoreflect.Message {
mi := &file_test_proto_msgTypes[0]
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 Order.ProtoReflect.Descriptor instead.
func (*Order) Descriptor() ([]byte, []int) {
return file_test_proto_rawDescGZIP(), []int{0}
}
func (x *Order) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *Order) GetNo() string {
if x != nil {
return x.No
}
return ""
}
func (x *Order) GetTel() string {
if x != nil {
return x.Tel
}
return ""
}
func (x *Order) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *Order) GetAddTime() string {
if x != nil {
return x.AddTime
}
return ""
}
func (x *Order) GetStatus() OrderStatus {
if x != nil {
return x.Status
}
return OrderStatus_FIRST_VAL
}
func (x *Order) GetProducets() *Order_Producets {
if x != nil {
return x.Producets
}
return nil
}
// 也可写这里
//
// message Producets {
// int64 id = 1;
// string title = 2;
// double price =3;
// int32 num = 4;
// }
//
// 请求 request struct
type OrderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ActivityType int32 `protobuf:"varint,1,opt,name=activityType,proto3" json:"activityType,omitempty"`
}
func (x *OrderRequest) Reset() {
*x = OrderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_test_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderRequest) ProtoMessage() {}
func (x *OrderRequest) ProtoReflect() protoreflect.Message {
mi := &file_test_proto_msgTypes[1]
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 OrderRequest.ProtoReflect.Descriptor instead.
func (*OrderRequest) Descriptor() ([]byte, []int) {
return file_test_proto_rawDescGZIP(), []int{1}
}
func (x *OrderRequest) GetActivityType() int32 {
if x != nil {
return x.ActivityType
}
return 0
}
// 响应 resp struct
type OrderResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DiscountAmount int32 `protobuf:"varint,1,opt,name=discountAmount,proto3" json:"discountAmount,omitempty"`
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
}
func (x *OrderResp) Reset() {
*x = OrderResp{}
if protoimpl.UnsafeEnabled {
mi := &file_test_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderResp) ProtoMessage() {}
func (x *OrderResp) ProtoReflect() protoreflect.Message {
mi := &file_test_proto_msgTypes[2]
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 OrderResp.ProtoReflect.Descriptor instead.
func (*OrderResp) Descriptor() ([]byte, []int) {
return file_test_proto_rawDescGZIP(), []int{2}
}
func (x *OrderResp) GetDiscountAmount() int32 {
if x != nil {
return x.DiscountAmount
}
return 0
}
func (x *OrderResp) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *OrderResp) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
type Order_Producets struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Price float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"`
Num int32 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"`
}
func (x *Order_Producets) Reset() {
*x = Order_Producets{}
if protoimpl.UnsafeEnabled {
mi := &file_test_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Order_Producets) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Order_Producets) ProtoMessage() {}
func (x *Order_Producets) ProtoReflect() protoreflect.Message {
mi := &file_test_proto_msgTypes[3]
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 Order_Producets.ProtoReflect.Descriptor instead.
func (*Order_Producets) Descriptor() ([]byte, []int) {
return file_test_proto_rawDescGZIP(), []int{0, 0}
}
func (x *Order_Producets) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *Order_Producets) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *Order_Producets) GetPrice() float64 {
if x != nil {
return x.Price
}
return 0
}
func (x *Order_Producets) GetNum() int32 {
if x != nil {
return x.Num
}
return 0
}
var File_test_proto protoreflect.FileDescriptor
var file_test_proto_rawDesc = []byte{
0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x02, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a,
0x02, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6e, 0x6f, 0x12, 0x10, 0x0a,
0x03, 0x74, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x65, 0x6c, 0x12,
0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64,
0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x54,
0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
0x34, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x74, 0x73, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x65, 0x74, 0x73, 0x1a, 0x59, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65,
0x74, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x10,
0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d,
0x22, 0x32, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x22, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
0x54, 0x79, 0x70, 0x65, 0x22, 0x59, 0x0a, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x12, 0x26, 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6d, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x2a,
0x2c, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d,
0x0a, 0x09, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0e, 0x0a,
0x0a, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x10, 0x01, 0x32, 0x47, 0x0a,
0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36,
0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x13, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_test_proto_rawDescOnce sync.Once
file_test_proto_rawDescData = file_test_proto_rawDesc
)
func file_test_proto_rawDescGZIP() []byte {
file_test_proto_rawDescOnce.Do(func() {
file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
})
return file_test_proto_rawDescData
}
var file_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_test_proto_goTypes = []interface{}{
(OrderStatus)(0), // 0: proto.OrderStatus
(*Order)(nil), // 1: proto.Order
(*OrderRequest)(nil), // 2: proto.OrderRequest
(*OrderResp)(nil), // 3: proto.OrderResp
(*Order_Producets)(nil), // 4: proto.Order.Producets
}
var file_test_proto_depIdxs = []int32{
0, // 0: proto.Order.status:type_name -> proto.OrderStatus
4, // 1: proto.Order.producets:type_name -> proto.Order.Producets
2, // 2: proto.SearchService.SearchOrder:input_type -> proto.OrderRequest
3, // 3: proto.SearchService.SearchOrder:output_type -> proto.OrderResp
3, // [3:4] is the sub-list for method output_type
2, // [2:3] 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_test_proto_init() }
func file_test_proto_init() {
if File_test_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Order); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Order_Producets); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_test_proto_rawDesc,
NumEnums: 1,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_test_proto_goTypes,
DependencyIndexes: file_test_proto_depIdxs,
EnumInfos: file_test_proto_enumTypes,
MessageInfos: file_test_proto_msgTypes,
}.Build()
File_test_proto = out.File
file_test_proto_rawDesc = nil
file_test_proto_goTypes = nil
file_test_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// SearchServiceClient is the client API for SearchService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SearchServiceClient interface {
// rpc 服务
SearchOrder(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderResp, error)
}
type searchServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSearchServiceClient(cc grpc.ClientConnInterface) SearchServiceClient {
return &searchServiceClient{cc}
}
func (c *searchServiceClient) SearchOrder(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderResp, error) {
out := new(OrderResp)
err := c.cc.Invoke(ctx, "/proto.SearchService/SearchOrder", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SearchServiceServer is the server API for SearchService service.
type SearchServiceServer interface {
// rpc 服务
SearchOrder(context.Context, *OrderRequest) (*OrderResp, error)
}
// UnimplementedSearchServiceServer can be embedded to have forward compatible implementations.
type UnimplementedSearchServiceServer struct {
}
func (*UnimplementedSearchServiceServer) SearchOrder(context.Context, *OrderRequest) (*OrderResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SearchOrder not implemented")
}
func RegisterSearchServiceServer(s *grpc.Server, srv SearchServiceServer) {
s.RegisterService(&_SearchService_serviceDesc, srv)
}
func _SearchService_SearchOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SearchServiceServer).SearchOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.SearchService/SearchOrder",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SearchServiceServer).SearchOrder(ctx, req.(*OrderRequest))
}
return interceptor(ctx, in, info, handler)
}
var _SearchService_serviceDesc = grpc.ServiceDesc{
ServiceName: "proto.SearchService",
HandlerType: (*SearchServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SearchOrder",
Handler: _SearchService_SearchOrder_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "test.proto",
}