Documentation ¶
Overview ¶
Package trolley_business is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTrolleyBusinessServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTrolleyBusinessServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterTrolleyBusinessServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTrolleyBusinessServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterTrolleyBusinessServiceServer(s *grpc.Server, srv TrolleyBusinessServiceServer)
- type CommonResponse
- func (*CommonResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CommonResponse) GetCode() RetCode
- func (x *CommonResponse) GetMsg() string
- func (*CommonResponse) ProtoMessage()
- func (x *CommonResponse) ProtoReflect() protoreflect.Message
- func (x *CommonResponse) Reset()
- func (x *CommonResponse) String() string
- type GetUserTrolleyListRequest
- func (*GetUserTrolleyListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserTrolleyListRequest) GetUid() int64
- func (*GetUserTrolleyListRequest) ProtoMessage()
- func (x *GetUserTrolleyListRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserTrolleyListRequest) Reset()
- func (x *GetUserTrolleyListRequest) String() string
- type GetUserTrolleyListResponse
- func (*GetUserTrolleyListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserTrolleyListResponse) GetCommon() *CommonResponse
- func (x *GetUserTrolleyListResponse) GetRecords() []*UserTrolleyRecord
- func (*GetUserTrolleyListResponse) ProtoMessage()
- func (x *GetUserTrolleyListResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserTrolleyListResponse) Reset()
- func (x *GetUserTrolleyListResponse) String() string
- type JoinSkuRequest
- func (*JoinSkuRequest) Descriptor() ([]byte, []int)deprecated
- func (x *JoinSkuRequest) GetCount() int64
- func (x *JoinSkuRequest) GetSelected() bool
- func (x *JoinSkuRequest) GetShopId() int64
- func (x *JoinSkuRequest) GetSkuCode() string
- func (x *JoinSkuRequest) GetTime() string
- func (x *JoinSkuRequest) GetUid() int64
- func (*JoinSkuRequest) ProtoMessage()
- func (x *JoinSkuRequest) ProtoReflect() protoreflect.Message
- func (x *JoinSkuRequest) Reset()
- func (x *JoinSkuRequest) String() string
- type JoinSkuResponse
- type OperationType
- func (OperationType) Descriptor() protoreflect.EnumDescriptor
- func (x OperationType) Enum() *OperationType
- func (OperationType) EnumDescriptor() ([]byte, []int)deprecated
- func (x OperationType) Number() protoreflect.EnumNumber
- func (x OperationType) String() string
- func (OperationType) Type() protoreflect.EnumType
- type RemoveSkuRequest
- func (*RemoveSkuRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveSkuRequest) GetShopId() int64
- func (x *RemoveSkuRequest) GetSkuCode() string
- func (x *RemoveSkuRequest) GetUid() int64
- func (*RemoveSkuRequest) ProtoMessage()
- func (x *RemoveSkuRequest) ProtoReflect() protoreflect.Message
- func (x *RemoveSkuRequest) Reset()
- func (x *RemoveSkuRequest) String() string
- type RemoveSkuResponse
- func (*RemoveSkuResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveSkuResponse) GetCommon() *CommonResponse
- func (*RemoveSkuResponse) ProtoMessage()
- func (x *RemoveSkuResponse) ProtoReflect() protoreflect.Message
- func (x *RemoveSkuResponse) Reset()
- func (x *RemoveSkuResponse) String() string
- type RetCode
- type TrolleyBusinessServiceClient
- type TrolleyBusinessServiceServer
- type UnimplementedTrolleyBusinessServiceServer
- func (*UnimplementedTrolleyBusinessServiceServer) GetUserTrolleyList(context.Context, *GetUserTrolleyListRequest) (*GetUserTrolleyListResponse, error)
- func (*UnimplementedTrolleyBusinessServiceServer) JoinSku(context.Context, *JoinSkuRequest) (*JoinSkuResponse, error)
- func (*UnimplementedTrolleyBusinessServiceServer) RemoveSku(context.Context, *RemoveSkuRequest) (*RemoveSkuResponse, error)
- type UserTrolleyRecord
- func (*UserTrolleyRecord) Descriptor() ([]byte, []int)deprecated
- func (x *UserTrolleyRecord) GetCount() int64
- func (x *UserTrolleyRecord) GetSelected() bool
- func (x *UserTrolleyRecord) GetShopId() int64
- func (x *UserTrolleyRecord) GetSkuCode() string
- func (x *UserTrolleyRecord) GetTime() string
- func (*UserTrolleyRecord) ProtoMessage()
- func (x *UserTrolleyRecord) ProtoReflect() protoreflect.Message
- func (x *UserTrolleyRecord) Reset()
- func (x *UserTrolleyRecord) String() string
Constants ¶
This section is empty.
Variables ¶
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.
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.
var File_proto_micro_mall_trolley_proto_trolley_business_trolley_business_proto protoreflect.FileDescriptor
Functions ¶
func RegisterTrolleyBusinessServiceHandler ¶
func RegisterTrolleyBusinessServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTrolleyBusinessServiceHandler registers the http handlers for service TrolleyBusinessService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTrolleyBusinessServiceHandlerClient ¶
func RegisterTrolleyBusinessServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TrolleyBusinessServiceClient) error
RegisterTrolleyBusinessServiceHandlerClient registers the http handlers for service TrolleyBusinessService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TrolleyBusinessServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TrolleyBusinessServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TrolleyBusinessServiceClient" to call the correct interceptors.
func RegisterTrolleyBusinessServiceHandlerFromEndpoint ¶
func RegisterTrolleyBusinessServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTrolleyBusinessServiceHandlerFromEndpoint is same as RegisterTrolleyBusinessServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTrolleyBusinessServiceHandlerServer ¶
func RegisterTrolleyBusinessServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TrolleyBusinessServiceServer) error
RegisterTrolleyBusinessServiceHandlerServer registers the http handlers for service TrolleyBusinessService to "mux". UnaryRPC :call TrolleyBusinessServiceServer 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 RegisterTrolleyBusinessServiceHandlerFromEndpoint instead.
func RegisterTrolleyBusinessServiceServer ¶
func RegisterTrolleyBusinessServiceServer(s *grpc.Server, srv TrolleyBusinessServiceServer)
Types ¶
type CommonResponse ¶
type CommonResponse struct { Code RetCode `protobuf:"varint,1,opt,name=code,proto3,enum=trolley_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 GetUserTrolleyListRequest ¶
type GetUserTrolleyListRequest struct { Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // contains filtered or unexported fields }
func (*GetUserTrolleyListRequest) Descriptor
deprecated
func (*GetUserTrolleyListRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserTrolleyListRequest.ProtoReflect.Descriptor instead.
func (*GetUserTrolleyListRequest) GetUid ¶
func (x *GetUserTrolleyListRequest) GetUid() int64
func (*GetUserTrolleyListRequest) ProtoMessage ¶
func (*GetUserTrolleyListRequest) ProtoMessage()
func (*GetUserTrolleyListRequest) ProtoReflect ¶
func (x *GetUserTrolleyListRequest) ProtoReflect() protoreflect.Message
func (*GetUserTrolleyListRequest) Reset ¶
func (x *GetUserTrolleyListRequest) Reset()
func (*GetUserTrolleyListRequest) String ¶
func (x *GetUserTrolleyListRequest) String() string
type GetUserTrolleyListResponse ¶
type GetUserTrolleyListResponse struct { Common *CommonResponse `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` Records []*UserTrolleyRecord `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` // contains filtered or unexported fields }
func (*GetUserTrolleyListResponse) Descriptor
deprecated
func (*GetUserTrolleyListResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserTrolleyListResponse.ProtoReflect.Descriptor instead.
func (*GetUserTrolleyListResponse) GetCommon ¶
func (x *GetUserTrolleyListResponse) GetCommon() *CommonResponse
func (*GetUserTrolleyListResponse) GetRecords ¶
func (x *GetUserTrolleyListResponse) GetRecords() []*UserTrolleyRecord
func (*GetUserTrolleyListResponse) ProtoMessage ¶
func (*GetUserTrolleyListResponse) ProtoMessage()
func (*GetUserTrolleyListResponse) ProtoReflect ¶
func (x *GetUserTrolleyListResponse) ProtoReflect() protoreflect.Message
func (*GetUserTrolleyListResponse) Reset ¶
func (x *GetUserTrolleyListResponse) Reset()
func (*GetUserTrolleyListResponse) String ¶
func (x *GetUserTrolleyListResponse) String() string
type JoinSkuRequest ¶
type JoinSkuRequest struct { Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` SkuCode string `protobuf:"bytes,2,opt,name=sku_code,json=skuCode,proto3" json:"sku_code,omitempty"` ShopId int64 `protobuf:"varint,3,opt,name=shop_id,json=shopId,proto3" json:"shop_id,omitempty"` Time string `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"` Count int64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` Selected bool `protobuf:"varint,6,opt,name=selected,proto3" json:"selected,omitempty"` // contains filtered or unexported fields }
func (*JoinSkuRequest) Descriptor
deprecated
func (*JoinSkuRequest) Descriptor() ([]byte, []int)
Deprecated: Use JoinSkuRequest.ProtoReflect.Descriptor instead.
func (*JoinSkuRequest) GetCount ¶
func (x *JoinSkuRequest) GetCount() int64
func (*JoinSkuRequest) GetSelected ¶
func (x *JoinSkuRequest) GetSelected() bool
func (*JoinSkuRequest) GetShopId ¶
func (x *JoinSkuRequest) GetShopId() int64
func (*JoinSkuRequest) GetSkuCode ¶
func (x *JoinSkuRequest) GetSkuCode() string
func (*JoinSkuRequest) GetTime ¶
func (x *JoinSkuRequest) GetTime() string
func (*JoinSkuRequest) GetUid ¶
func (x *JoinSkuRequest) GetUid() int64
func (*JoinSkuRequest) ProtoMessage ¶
func (*JoinSkuRequest) ProtoMessage()
func (*JoinSkuRequest) ProtoReflect ¶
func (x *JoinSkuRequest) ProtoReflect() protoreflect.Message
func (*JoinSkuRequest) Reset ¶
func (x *JoinSkuRequest) Reset()
func (*JoinSkuRequest) String ¶
func (x *JoinSkuRequest) String() string
type JoinSkuResponse ¶
type JoinSkuResponse struct { Common *CommonResponse `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` // contains filtered or unexported fields }
func (*JoinSkuResponse) Descriptor
deprecated
func (*JoinSkuResponse) Descriptor() ([]byte, []int)
Deprecated: Use JoinSkuResponse.ProtoReflect.Descriptor instead.
func (*JoinSkuResponse) GetCommon ¶
func (x *JoinSkuResponse) GetCommon() *CommonResponse
func (*JoinSkuResponse) ProtoMessage ¶
func (*JoinSkuResponse) ProtoMessage()
func (*JoinSkuResponse) ProtoReflect ¶
func (x *JoinSkuResponse) ProtoReflect() protoreflect.Message
func (*JoinSkuResponse) Reset ¶
func (x *JoinSkuResponse) Reset()
func (*JoinSkuResponse) String ¶
func (x *JoinSkuResponse) 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) Descriptor() protoreflect.EnumDescriptor
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 (x OperationType) Number() protoreflect.EnumNumber
func (OperationType) String ¶
func (x OperationType) String() string
func (OperationType) Type ¶
func (OperationType) Type() protoreflect.EnumType
type RemoveSkuRequest ¶
type RemoveSkuRequest struct { Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` SkuCode string `protobuf:"bytes,2,opt,name=sku_code,json=skuCode,proto3" json:"sku_code,omitempty"` ShopId int64 `protobuf:"varint,3,opt,name=shop_id,json=shopId,proto3" json:"shop_id,omitempty"` // contains filtered or unexported fields }
func (*RemoveSkuRequest) Descriptor
deprecated
func (*RemoveSkuRequest) Descriptor() ([]byte, []int)
Deprecated: Use RemoveSkuRequest.ProtoReflect.Descriptor instead.
func (*RemoveSkuRequest) GetShopId ¶
func (x *RemoveSkuRequest) GetShopId() int64
func (*RemoveSkuRequest) GetSkuCode ¶
func (x *RemoveSkuRequest) GetSkuCode() string
func (*RemoveSkuRequest) GetUid ¶
func (x *RemoveSkuRequest) GetUid() int64
func (*RemoveSkuRequest) ProtoMessage ¶
func (*RemoveSkuRequest) ProtoMessage()
func (*RemoveSkuRequest) ProtoReflect ¶
func (x *RemoveSkuRequest) ProtoReflect() protoreflect.Message
func (*RemoveSkuRequest) Reset ¶
func (x *RemoveSkuRequest) Reset()
func (*RemoveSkuRequest) String ¶
func (x *RemoveSkuRequest) String() string
type RemoveSkuResponse ¶
type RemoveSkuResponse struct { Common *CommonResponse `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` // contains filtered or unexported fields }
func (*RemoveSkuResponse) Descriptor
deprecated
func (*RemoveSkuResponse) Descriptor() ([]byte, []int)
Deprecated: Use RemoveSkuResponse.ProtoReflect.Descriptor instead.
func (*RemoveSkuResponse) GetCommon ¶
func (x *RemoveSkuResponse) GetCommon() *CommonResponse
func (*RemoveSkuResponse) ProtoMessage ¶
func (*RemoveSkuResponse) ProtoMessage()
func (*RemoveSkuResponse) ProtoReflect ¶
func (x *RemoveSkuResponse) ProtoReflect() protoreflect.Message
func (*RemoveSkuResponse) Reset ¶
func (x *RemoveSkuResponse) Reset()
func (*RemoveSkuResponse) String ¶
func (x *RemoveSkuResponse) String() string
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) EnumDescriptor
deprecated
func (RetCode) Number ¶
func (x RetCode) Number() protoreflect.EnumNumber
func (RetCode) Type ¶
func (RetCode) Type() protoreflect.EnumType
type TrolleyBusinessServiceClient ¶
type TrolleyBusinessServiceClient interface { // 添加商品到购物车 JoinSku(ctx context.Context, in *JoinSkuRequest, opts ...grpc.CallOption) (*JoinSkuResponse, error) // 从购物车移除商品 RemoveSku(ctx context.Context, in *RemoveSkuRequest, opts ...grpc.CallOption) (*RemoveSkuResponse, error) // 获取用户购物车中的商品 GetUserTrolleyList(ctx context.Context, in *GetUserTrolleyListRequest, opts ...grpc.CallOption) (*GetUserTrolleyListResponse, error) }
TrolleyBusinessServiceClient is the client API for TrolleyBusinessService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTrolleyBusinessServiceClient ¶
func NewTrolleyBusinessServiceClient(cc grpc.ClientConnInterface) TrolleyBusinessServiceClient
type TrolleyBusinessServiceServer ¶
type TrolleyBusinessServiceServer interface { // 添加商品到购物车 JoinSku(context.Context, *JoinSkuRequest) (*JoinSkuResponse, error) // 从购物车移除商品 RemoveSku(context.Context, *RemoveSkuRequest) (*RemoveSkuResponse, error) // 获取用户购物车中的商品 GetUserTrolleyList(context.Context, *GetUserTrolleyListRequest) (*GetUserTrolleyListResponse, error) }
TrolleyBusinessServiceServer is the server API for TrolleyBusinessService service.
type UnimplementedTrolleyBusinessServiceServer ¶
type UnimplementedTrolleyBusinessServiceServer struct { }
UnimplementedTrolleyBusinessServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedTrolleyBusinessServiceServer) GetUserTrolleyList ¶
func (*UnimplementedTrolleyBusinessServiceServer) GetUserTrolleyList(context.Context, *GetUserTrolleyListRequest) (*GetUserTrolleyListResponse, error)
func (*UnimplementedTrolleyBusinessServiceServer) JoinSku ¶
func (*UnimplementedTrolleyBusinessServiceServer) JoinSku(context.Context, *JoinSkuRequest) (*JoinSkuResponse, error)
func (*UnimplementedTrolleyBusinessServiceServer) RemoveSku ¶
func (*UnimplementedTrolleyBusinessServiceServer) RemoveSku(context.Context, *RemoveSkuRequest) (*RemoveSkuResponse, error)
type UserTrolleyRecord ¶
type UserTrolleyRecord struct { SkuCode string `protobuf:"bytes,2,opt,name=sku_code,json=skuCode,proto3" json:"sku_code,omitempty"` ShopId int64 `protobuf:"varint,3,opt,name=shop_id,json=shopId,proto3" json:"shop_id,omitempty"` Time string `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"` Count int64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` Selected bool `protobuf:"varint,6,opt,name=selected,proto3" json:"selected,omitempty"` // contains filtered or unexported fields }
func (*UserTrolleyRecord) Descriptor
deprecated
func (*UserTrolleyRecord) Descriptor() ([]byte, []int)
Deprecated: Use UserTrolleyRecord.ProtoReflect.Descriptor instead.
func (*UserTrolleyRecord) GetCount ¶
func (x *UserTrolleyRecord) GetCount() int64
func (*UserTrolleyRecord) GetSelected ¶
func (x *UserTrolleyRecord) GetSelected() bool
func (*UserTrolleyRecord) GetShopId ¶
func (x *UserTrolleyRecord) GetShopId() int64
func (*UserTrolleyRecord) GetSkuCode ¶
func (x *UserTrolleyRecord) GetSkuCode() string
func (*UserTrolleyRecord) GetTime ¶
func (x *UserTrolleyRecord) GetTime() string
func (*UserTrolleyRecord) ProtoMessage ¶
func (*UserTrolleyRecord) ProtoMessage()
func (*UserTrolleyRecord) ProtoReflect ¶
func (x *UserTrolleyRecord) ProtoReflect() protoreflect.Message
func (*UserTrolleyRecord) Reset ¶
func (x *UserTrolleyRecord) Reset()
func (*UserTrolleyRecord) String ¶
func (x *UserTrolleyRecord) String() string