search_business

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package search_business is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	RetCode_name = map[int32]string{
		0:     "SUCCESS",
		500:   "ERROR",
		50001: "USER_NOT_EXIST",
		50002: "USER_EXIST",
		50003: "MERCHANT_NOT_EXIST",
		50004: "MERCHANT_EXIST",
		50005: "SHOP_NOT_EXIST",
		50006: "SHOP_EXIST",
		50007: "SKU_NOT_EXIST",
		50008: "SKU_EXIST",
	}
	RetCode_value = map[string]int32{
		"SUCCESS":            0,
		"ERROR":              500,
		"USER_NOT_EXIST":     50001,
		"USER_EXIST":         50002,
		"MERCHANT_NOT_EXIST": 50003,
		"MERCHANT_EXIST":     50004,
		"SHOP_NOT_EXIST":     50005,
		"SHOP_EXIST":         50006,
		"SKU_NOT_EXIST":      50007,
		"SKU_EXIST":          50008,
	}
)

Enum value maps for RetCode.

View Source
var (
	OperationType_name = map[int32]string{
		0: "CREATE",
		1: "UPDATE",
		2: "DELETE",
		3: "AUDIT",
		4: "PUT_AWAY",
	}
	OperationType_value = map[string]int32{
		"CREATE":   0,
		"UPDATE":   1,
		"DELETE":   2,
		"AUDIT":    3,
		"PUT_AWAY": 4,
	}
)

Enum value maps for OperationType.

View Source
var File_proto_micro_mall_search_proto_search_business_search_proto protoreflect.FileDescriptor

Functions

func RegisterSearchBusinessServiceHandler

func RegisterSearchBusinessServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSearchBusinessServiceHandler registers the http handlers for service SearchBusinessService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSearchBusinessServiceHandlerClient

func RegisterSearchBusinessServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SearchBusinessServiceClient) error

RegisterSearchBusinessServiceHandlerClient registers the http handlers for service SearchBusinessService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SearchBusinessServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SearchBusinessServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SearchBusinessServiceClient" to call the correct interceptors.

func RegisterSearchBusinessServiceHandlerFromEndpoint

func RegisterSearchBusinessServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSearchBusinessServiceHandlerFromEndpoint is same as RegisterSearchBusinessServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSearchBusinessServiceHandlerServer

func RegisterSearchBusinessServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SearchBusinessServiceServer) error

RegisterSearchBusinessServiceHandlerServer registers the http handlers for service SearchBusinessService to "mux". UnaryRPC :call SearchBusinessServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterSearchBusinessServiceHandlerFromEndpoint instead.

func RegisterSearchBusinessServiceServer

func RegisterSearchBusinessServiceServer(s *grpc.Server, srv SearchBusinessServiceServer)

Types

type CommonResponse

type CommonResponse struct {
	Code RetCode `protobuf:"varint,1,opt,name=code,proto3,enum=search_business.RetCode" json:"code,omitempty"`
	Msg  string  `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonResponse) Descriptor deprecated

func (*CommonResponse) Descriptor() ([]byte, []int)

Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead.

func (*CommonResponse) GetCode

func (x *CommonResponse) GetCode() RetCode

func (*CommonResponse) GetMsg

func (x *CommonResponse) GetMsg() string

func (*CommonResponse) ProtoMessage

func (*CommonResponse) ProtoMessage()

func (*CommonResponse) ProtoReflect

func (x *CommonResponse) ProtoReflect() protoreflect.Message

func (*CommonResponse) Reset

func (x *CommonResponse) Reset()

func (*CommonResponse) String

func (x *CommonResponse) String() string

type OperationType

type OperationType int32
const (
	OperationType_CREATE   OperationType = 0
	OperationType_UPDATE   OperationType = 1
	OperationType_DELETE   OperationType = 2
	OperationType_AUDIT    OperationType = 3
	OperationType_PUT_AWAY OperationType = 4
)

func (OperationType) Descriptor

func (OperationType) Enum

func (x OperationType) Enum() *OperationType

func (OperationType) EnumDescriptor deprecated

func (OperationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use OperationType.Descriptor instead.

func (OperationType) Number

func (OperationType) String

func (x OperationType) String() string

func (OperationType) Type

type RetCode

type RetCode int32
const (
	RetCode_SUCCESS            RetCode = 0
	RetCode_ERROR              RetCode = 500
	RetCode_USER_NOT_EXIST     RetCode = 50001
	RetCode_USER_EXIST         RetCode = 50002
	RetCode_MERCHANT_NOT_EXIST RetCode = 50003
	RetCode_MERCHANT_EXIST     RetCode = 50004
	RetCode_SHOP_NOT_EXIST     RetCode = 50005
	RetCode_SHOP_EXIST         RetCode = 50006
	RetCode_SKU_NOT_EXIST      RetCode = 50007
	RetCode_SKU_EXIST          RetCode = 50008
)

func (RetCode) Descriptor

func (RetCode) Descriptor() protoreflect.EnumDescriptor

func (RetCode) Enum

func (x RetCode) Enum() *RetCode

func (RetCode) EnumDescriptor deprecated

func (RetCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use RetCode.Descriptor instead.

func (RetCode) Number

func (x RetCode) Number() protoreflect.EnumNumber

func (RetCode) String

func (x RetCode) String() string

func (RetCode) Type

func (RetCode) Type() protoreflect.EnumType

type SearchBusinessServiceClient

type SearchBusinessServiceClient interface {
	// 商品库存搜索
	SkuInventorySearch(ctx context.Context, in *SkuInventorySearchRequest, opts ...grpc.CallOption) (*SkuInventorySearchResponse, error)
	// 店铺搜索
	ShopSearch(ctx context.Context, in *ShopSearchRequest, opts ...grpc.CallOption) (*ShopSearchResponse, error)
}

SearchBusinessServiceClient is the client API for SearchBusinessService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type SearchBusinessServiceServer

type SearchBusinessServiceServer interface {
	// 商品库存搜索
	SkuInventorySearch(context.Context, *SkuInventorySearchRequest) (*SkuInventorySearchResponse, error)
	// 店铺搜索
	ShopSearch(context.Context, *ShopSearchRequest) (*ShopSearchResponse, error)
}

SearchBusinessServiceServer is the server API for SearchBusinessService service.

type ShopSearchEntry

type ShopSearchEntry struct {
	ShopId   string  `protobuf:"bytes,1,opt,name=shop_id,json=shopId,proto3" json:"shop_id,omitempty"`
	ShopName string  `protobuf:"bytes,2,opt,name=shop_name,json=shopName,proto3" json:"shop_name,omitempty"`
	Score    float64 `protobuf:"fixed64,399,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*ShopSearchEntry) Descriptor deprecated

func (*ShopSearchEntry) Descriptor() ([]byte, []int)

Deprecated: Use ShopSearchEntry.ProtoReflect.Descriptor instead.

func (*ShopSearchEntry) GetScore

func (x *ShopSearchEntry) GetScore() float64

func (*ShopSearchEntry) GetShopId

func (x *ShopSearchEntry) GetShopId() string

func (*ShopSearchEntry) GetShopName

func (x *ShopSearchEntry) GetShopName() string

func (*ShopSearchEntry) ProtoMessage

func (*ShopSearchEntry) ProtoMessage()

func (*ShopSearchEntry) ProtoReflect

func (x *ShopSearchEntry) ProtoReflect() protoreflect.Message

func (*ShopSearchEntry) Reset

func (x *ShopSearchEntry) Reset()

func (*ShopSearchEntry) String

func (x *ShopSearchEntry) String() string

type ShopSearchRequest

type ShopSearchRequest struct {
	ShopKey string `protobuf:"bytes,1,opt,name=shop_key,json=shopKey,proto3" json:"shop_key,omitempty"`
	// contains filtered or unexported fields
}

func (*ShopSearchRequest) Descriptor deprecated

func (*ShopSearchRequest) Descriptor() ([]byte, []int)

Deprecated: Use ShopSearchRequest.ProtoReflect.Descriptor instead.

func (*ShopSearchRequest) GetShopKey

func (x *ShopSearchRequest) GetShopKey() string

func (*ShopSearchRequest) ProtoMessage

func (*ShopSearchRequest) ProtoMessage()

func (*ShopSearchRequest) ProtoReflect

func (x *ShopSearchRequest) ProtoReflect() protoreflect.Message

func (*ShopSearchRequest) Reset

func (x *ShopSearchRequest) Reset()

func (*ShopSearchRequest) String

func (x *ShopSearchRequest) String() string

type ShopSearchResponse

type ShopSearchResponse struct {
	Common *CommonResponse    `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"`
	List   []*ShopSearchEntry `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*ShopSearchResponse) Descriptor deprecated

func (*ShopSearchResponse) Descriptor() ([]byte, []int)

Deprecated: Use ShopSearchResponse.ProtoReflect.Descriptor instead.

func (*ShopSearchResponse) GetCommon

func (x *ShopSearchResponse) GetCommon() *CommonResponse

func (*ShopSearchResponse) GetList

func (x *ShopSearchResponse) GetList() []*ShopSearchEntry

func (*ShopSearchResponse) ProtoMessage

func (*ShopSearchResponse) ProtoMessage()

func (*ShopSearchResponse) ProtoReflect

func (x *ShopSearchResponse) ProtoReflect() protoreflect.Message

func (*ShopSearchResponse) Reset

func (x *ShopSearchResponse) Reset()

func (*ShopSearchResponse) String

func (x *ShopSearchResponse) String() string

type SkuInventoryEntry

type SkuInventoryEntry struct {
	ShopId  string  `protobuf:"bytes,1,opt,name=shop_id,json=shopId,proto3" json:"shop_id,omitempty"`
	SkuCode string  `protobuf:"bytes,2,opt,name=sku_code,json=skuCode,proto3" json:"sku_code,omitempty"`
	SkuName string  `protobuf:"bytes,3,opt,name=sku_name,json=skuName,proto3" json:"sku_name,omitempty"`
	Score   float64 `protobuf:"fixed64,399,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*SkuInventoryEntry) Descriptor deprecated

func (*SkuInventoryEntry) Descriptor() ([]byte, []int)

Deprecated: Use SkuInventoryEntry.ProtoReflect.Descriptor instead.

func (*SkuInventoryEntry) GetScore

func (x *SkuInventoryEntry) GetScore() float64

func (*SkuInventoryEntry) GetShopId

func (x *SkuInventoryEntry) GetShopId() string

func (*SkuInventoryEntry) GetSkuCode

func (x *SkuInventoryEntry) GetSkuCode() string

func (*SkuInventoryEntry) GetSkuName

func (x *SkuInventoryEntry) GetSkuName() string

func (*SkuInventoryEntry) ProtoMessage

func (*SkuInventoryEntry) ProtoMessage()

func (*SkuInventoryEntry) ProtoReflect

func (x *SkuInventoryEntry) ProtoReflect() protoreflect.Message

func (*SkuInventoryEntry) Reset

func (x *SkuInventoryEntry) Reset()

func (*SkuInventoryEntry) String

func (x *SkuInventoryEntry) String() string

type SkuInventorySearchRequest

type SkuInventorySearchRequest struct {
	SkuKey string `protobuf:"bytes,1,opt,name=sku_key,json=skuKey,proto3" json:"sku_key,omitempty"`
	// contains filtered or unexported fields
}

func (*SkuInventorySearchRequest) Descriptor deprecated

func (*SkuInventorySearchRequest) Descriptor() ([]byte, []int)

Deprecated: Use SkuInventorySearchRequest.ProtoReflect.Descriptor instead.

func (*SkuInventorySearchRequest) GetSkuKey

func (x *SkuInventorySearchRequest) GetSkuKey() string

func (*SkuInventorySearchRequest) ProtoMessage

func (*SkuInventorySearchRequest) ProtoMessage()

func (*SkuInventorySearchRequest) ProtoReflect

func (*SkuInventorySearchRequest) Reset

func (x *SkuInventorySearchRequest) Reset()

func (*SkuInventorySearchRequest) String

func (x *SkuInventorySearchRequest) String() string

type SkuInventorySearchResponse

type SkuInventorySearchResponse struct {
	Common *CommonResponse      `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"`
	List   []*SkuInventoryEntry `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*SkuInventorySearchResponse) Descriptor deprecated

func (*SkuInventorySearchResponse) Descriptor() ([]byte, []int)

Deprecated: Use SkuInventorySearchResponse.ProtoReflect.Descriptor instead.

func (*SkuInventorySearchResponse) GetCommon

func (*SkuInventorySearchResponse) GetList

func (*SkuInventorySearchResponse) ProtoMessage

func (*SkuInventorySearchResponse) ProtoMessage()

func (*SkuInventorySearchResponse) ProtoReflect

func (*SkuInventorySearchResponse) Reset

func (x *SkuInventorySearchResponse) Reset()

func (*SkuInventorySearchResponse) String

func (x *SkuInventorySearchResponse) String() string

type UnimplementedSearchBusinessServiceServer

type UnimplementedSearchBusinessServiceServer struct {
}

UnimplementedSearchBusinessServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedSearchBusinessServiceServer) ShopSearch

func (*UnimplementedSearchBusinessServiceServer) SkuInventorySearch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL