refactor: centralize protobuf and remove go-zero

This commit is contained in:
2026-08-09 15:10:19 +08:00
parent 5cc5fd92ed
commit 4bbed3156c
357 changed files with 14208 additions and 19903 deletions

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: agency.proto
// protoc-gen-go v1.36.11
// protoc v7.35.0
// source: module/ec/market/proto/agency.proto
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -32,7 +33,7 @@ type LoginRequest struct {
func (x *LoginRequest) Reset() {
*x = LoginRequest{}
mi := &file_agency_proto_msgTypes[0]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -44,7 +45,7 @@ func (x *LoginRequest) String() string {
func (*LoginRequest) ProtoMessage() {}
func (x *LoginRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[0]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -57,7 +58,7 @@ func (x *LoginRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{0}
return file_module_ec_market_proto_agency_proto_rawDescGZIP(), []int{0}
}
func (x *LoginRequest) GetAccount() string {
@@ -109,7 +110,7 @@ type MarketAgenctyItem struct {
func (x *MarketAgenctyItem) Reset() {
*x = MarketAgenctyItem{}
mi := &file_agency_proto_msgTypes[1]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -121,7 +122,7 @@ func (x *MarketAgenctyItem) String() string {
func (*MarketAgenctyItem) ProtoMessage() {}
func (x *MarketAgenctyItem) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[1]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -134,7 +135,7 @@ func (x *MarketAgenctyItem) ProtoReflect() protoreflect.Message {
// Deprecated: Use MarketAgenctyItem.ProtoReflect.Descriptor instead.
func (*MarketAgenctyItem) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{1}
return file_module_ec_market_proto_agency_proto_rawDescGZIP(), []int{1}
}
func (x *MarketAgenctyItem) GetIdentity() string {
@@ -288,7 +289,7 @@ type SetPasswordRequest struct {
func (x *SetPasswordRequest) Reset() {
*x = SetPasswordRequest{}
mi := &file_agency_proto_msgTypes[2]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -300,7 +301,7 @@ func (x *SetPasswordRequest) String() string {
func (*SetPasswordRequest) ProtoMessage() {}
func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[2]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -313,7 +314,7 @@ func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetPasswordRequest.ProtoReflect.Descriptor instead.
func (*SetPasswordRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{2}
return file_module_ec_market_proto_agency_proto_rawDescGZIP(), []int{2}
}
func (x *SetPasswordRequest) GetIdentity() string {
@@ -347,7 +348,7 @@ type AgencyReply struct {
func (x *AgencyReply) Reset() {
*x = AgencyReply{}
mi := &file_agency_proto_msgTypes[3]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -359,7 +360,7 @@ func (x *AgencyReply) String() string {
func (*AgencyReply) ProtoMessage() {}
func (x *AgencyReply) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[3]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -372,7 +373,7 @@ func (x *AgencyReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use AgencyReply.ProtoReflect.Descriptor instead.
func (*AgencyReply) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{3}
return file_module_ec_market_proto_agency_proto_rawDescGZIP(), []int{3}
}
func (x *AgencyReply) GetCount() int64 {
@@ -399,7 +400,7 @@ type ApproveRequest struct {
func (x *ApproveRequest) Reset() {
*x = ApproveRequest{}
mi := &file_agency_proto_msgTypes[4]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -411,7 +412,7 @@ func (x *ApproveRequest) String() string {
func (*ApproveRequest) ProtoMessage() {}
func (x *ApproveRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[4]
mi := &file_module_ec_market_proto_agency_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -424,7 +425,7 @@ func (x *ApproveRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ApproveRequest.ProtoReflect.Descriptor instead.
func (*ApproveRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{4}
return file_module_ec_market_proto_agency_proto_rawDescGZIP(), []int{4}
}
func (x *ApproveRequest) GetApprove() int32 {
@@ -441,11 +442,11 @@ func (x *ApproveRequest) GetIdentity() string {
return ""
}
var File_agency_proto protoreflect.FileDescriptor
var File_module_ec_market_proto_agency_proto protoreflect.FileDescriptor
const file_agency_proto_rawDesc = "" +
const file_module_ec_market_proto_agency_proto_rawDesc = "" +
"\n" +
"\x16ec/market/agency.proto\x12\x06market\x1a\x13market/blocks.proto\"\\\n" +
"#module/ec/market/proto/agency.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\\\n" +
"\fLoginRequest\x12\x18\n" +
"\aaccount\x18\x01 \x01(\tR\aaccount\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\x12\x16\n" +
@@ -483,63 +484,62 @@ const file_agency_proto_rawDesc = "" +
"\x04data\x18\x02 \x03(\v2\x19.market.MarketAgenctyItemR\x04data\"F\n" +
"\x0eApproveRequest\x12\x18\n" +
"\aapprove\x18\x01 \x01(\x05R\aapprove\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity2\x90\x04\n" +
"\x06Agency\x123\n" +
"\x05Login\x12\x14.market.LoginRequest\x1a\x12.market.LoginReply\"\x00\x12:\n" +
"\x06Create\x12\x19.market.MarketAgenctyItem\x1a\x13.market.StatusReply\"\x00\x128\n" +
"\x03Get\x12\x14.market.IdentRequest\x1a\x19.market.MarketAgenctyItem\"\x00\x124\n" +
"\x05Fetch\x12\x14.market.FetchRequest\x1a\x13.market.AgencyReply\"\x00\x12:\n" +
"\x06Modify\x12\x19.market.MarketAgenctyItem\x1a\x13.market.StatusReply\"\x00\x125\n" +
"\x06Delete\x12\x14.market.IdentRequest\x1a\x13.market.StatusReply\"\x00\x12@\n" +
"\vSetPassword\x12\x1a.market.SetPasswordRequest\x1a\x13.market.StatusReply\"\x00\x126\n" +
"\aPending\x12\x14.market.FetchRequest\x1a\x13.market.AgencyReply\"\x00\x128\n" +
"\aApprove\x12\x16.market.ApproveRequest\x1a\x13.market.StatusReply\"\x00B\n" +
"Z\b.;marketb\x06proto3"
"\bidentity\x18\x02 \x01(\tR\bidentity2\xca\x04\n" +
"\x06Agency\x129\n" +
"\x05Login\x12\x14.market.LoginRequest\x1a\x18.blocks.MarketLoginReply\"\x00\x12B\n" +
"\x06Create\x12\x19.market.MarketAgenctyItem\x1a\x1b.blocks.IdentityStatusReply\"\x00\x128\n" +
"\x03Get\x12\x14.blocks.IdentRequest\x1a\x19.market.MarketAgenctyItem\"\x00\x12:\n" +
"\x05Fetch\x12\x1a.blocks.MarketFetchRequest\x1a\x13.market.AgencyReply\"\x00\x12B\n" +
"\x06Modify\x12\x19.market.MarketAgenctyItem\x1a\x1b.blocks.IdentityStatusReply\"\x00\x12=\n" +
"\x06Delete\x12\x14.blocks.IdentRequest\x1a\x1b.blocks.IdentityStatusReply\"\x00\x12H\n" +
"\vSetPassword\x12\x1a.market.SetPasswordRequest\x1a\x1b.blocks.IdentityStatusReply\"\x00\x12<\n" +
"\aPending\x12\x1a.blocks.MarketFetchRequest\x1a\x13.market.AgencyReply\"\x00\x12@\n" +
"\aApprove\x12\x16.market.ApproveRequest\x1a\x1b.blocks.IdentityStatusReply\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
var (
file_agency_proto_rawDescOnce sync.Once
file_agency_proto_rawDescData []byte
file_module_ec_market_proto_agency_proto_rawDescOnce sync.Once
file_module_ec_market_proto_agency_proto_rawDescData []byte
)
func file_agency_proto_rawDescGZIP() []byte {
file_agency_proto_rawDescOnce.Do(func() {
file_agency_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_agency_proto_rawDesc), len(file_agency_proto_rawDesc)))
func file_module_ec_market_proto_agency_proto_rawDescGZIP() []byte {
file_module_ec_market_proto_agency_proto_rawDescOnce.Do(func() {
file_module_ec_market_proto_agency_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_agency_proto_rawDesc), len(file_module_ec_market_proto_agency_proto_rawDesc)))
})
return file_agency_proto_rawDescData
return file_module_ec_market_proto_agency_proto_rawDescData
}
var file_agency_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_agency_proto_goTypes = []any{
(*LoginRequest)(nil), // 0: market.LoginRequest
(*MarketAgenctyItem)(nil), // 1: market.MarketAgenctyItem
(*SetPasswordRequest)(nil), // 2: market.SetPasswordRequest
(*AgencyReply)(nil), // 3: market.AgencyReply
(*ApproveRequest)(nil), // 4: market.ApproveRequest
(*IdentRequest)(nil), // 5: market.IdentRequest
(*FetchRequest)(nil), // 6: market.FetchRequest
(*LoginReply)(nil), // 7: market.LoginReply
(*StatusReply)(nil), // 8: market.StatusReply
var file_module_ec_market_proto_agency_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_module_ec_market_proto_agency_proto_goTypes = []any{
(*LoginRequest)(nil), // 0: market.LoginRequest
(*MarketAgenctyItem)(nil), // 1: market.MarketAgenctyItem
(*SetPasswordRequest)(nil), // 2: market.SetPasswordRequest
(*AgencyReply)(nil), // 3: market.AgencyReply
(*ApproveRequest)(nil), // 4: market.ApproveRequest
(*protobuf.IdentRequest)(nil), // 5: blocks.IdentRequest
(*protobuf.MarketFetchRequest)(nil), // 6: blocks.MarketFetchRequest
(*protobuf.MarketLoginReply)(nil), // 7: blocks.MarketLoginReply
(*protobuf.IdentityStatusReply)(nil), // 8: blocks.IdentityStatusReply
}
var file_agency_proto_depIdxs = []int32{
var file_module_ec_market_proto_agency_proto_depIdxs = []int32{
1, // 0: market.AgencyReply.data:type_name -> market.MarketAgenctyItem
0, // 1: market.Agency.Login:input_type -> market.LoginRequest
1, // 2: market.Agency.Create:input_type -> market.MarketAgenctyItem
5, // 3: market.Agency.Get:input_type -> market.IdentRequest
6, // 4: market.Agency.Fetch:input_type -> market.FetchRequest
5, // 3: market.Agency.Get:input_type -> blocks.IdentRequest
6, // 4: market.Agency.Fetch:input_type -> blocks.MarketFetchRequest
1, // 5: market.Agency.Modify:input_type -> market.MarketAgenctyItem
5, // 6: market.Agency.Delete:input_type -> market.IdentRequest
5, // 6: market.Agency.Delete:input_type -> blocks.IdentRequest
2, // 7: market.Agency.SetPassword:input_type -> market.SetPasswordRequest
6, // 8: market.Agency.Pending:input_type -> market.FetchRequest
6, // 8: market.Agency.Pending:input_type -> blocks.MarketFetchRequest
4, // 9: market.Agency.Approve:input_type -> market.ApproveRequest
7, // 10: market.Agency.Login:output_type -> market.LoginReply
8, // 11: market.Agency.Create:output_type -> market.StatusReply
7, // 10: market.Agency.Login:output_type -> blocks.MarketLoginReply
8, // 11: market.Agency.Create:output_type -> blocks.IdentityStatusReply
1, // 12: market.Agency.Get:output_type -> market.MarketAgenctyItem
3, // 13: market.Agency.Fetch:output_type -> market.AgencyReply
8, // 14: market.Agency.Modify:output_type -> market.StatusReply
8, // 15: market.Agency.Delete:output_type -> market.StatusReply
8, // 16: market.Agency.SetPassword:output_type -> market.StatusReply
8, // 14: market.Agency.Modify:output_type -> blocks.IdentityStatusReply
8, // 15: market.Agency.Delete:output_type -> blocks.IdentityStatusReply
8, // 16: market.Agency.SetPassword:output_type -> blocks.IdentityStatusReply
3, // 17: market.Agency.Pending:output_type -> market.AgencyReply
8, // 18: market.Agency.Approve:output_type -> market.StatusReply
8, // 18: market.Agency.Approve:output_type -> blocks.IdentityStatusReply
10, // [10:19] is the sub-list for method output_type
1, // [1:10] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -547,27 +547,26 @@ var file_agency_proto_depIdxs = []int32{
0, // [0:1] is the sub-list for field type_name
}
func init() { file_agency_proto_init() }
func file_agency_proto_init() {
if File_agency_proto != nil {
func init() { file_module_ec_market_proto_agency_proto_init() }
func file_module_ec_market_proto_agency_proto_init() {
if File_module_ec_market_proto_agency_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_agency_proto_rawDesc), len(file_agency_proto_rawDesc)),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_agency_proto_rawDesc), len(file_module_ec_market_proto_agency_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_agency_proto_goTypes,
DependencyIndexes: file_agency_proto_depIdxs,
MessageInfos: file_agency_proto_msgTypes,
GoTypes: file_module_ec_market_proto_agency_proto_goTypes,
DependencyIndexes: file_module_ec_market_proto_agency_proto_depIdxs,
MessageInfos: file_module_ec_market_proto_agency_proto_msgTypes,
}.Build()
File_agency_proto = out.File
file_agency_proto_goTypes = nil
file_agency_proto_depIdxs = nil
File_module_ec_market_proto_agency_proto = out.File
file_module_ec_market_proto_agency_proto_goTypes = nil
file_module_ec_market_proto_agency_proto_depIdxs = nil
}

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: agency.proto
// source: module/ec/market/proto/agency.proto
/*
Package market is a reverse proxy.
@@ -9,6 +9,7 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -43,6 +44,9 @@ func request_Agency_Login_0(ctx context.Context, marshaler runtime.Marshaler, cl
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -67,6 +71,9 @@ func request_Agency_Create_0(ctx context.Context, marshaler runtime.Marshaler, c
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -85,19 +92,22 @@ func local_request_Agency_Create_0(ctx context.Context, marshaler runtime.Marsha
func request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -109,19 +119,22 @@ func local_request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler
func request_Agency_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Fetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -139,6 +152,9 @@ func request_Agency_Modify_0(ctx context.Context, marshaler runtime.Marshaler, c
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Modify(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -157,19 +173,22 @@ func local_request_Agency_Modify_0(ctx context.Context, marshaler runtime.Marsha
func request_Agency_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -187,6 +206,9 @@ func request_Agency_SetPassword_0(ctx context.Context, marshaler runtime.Marshal
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.SetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -205,19 +227,22 @@ func local_request_Agency_SetPassword_0(ctx context.Context, marshaler runtime.M
func request_Agency_Pending_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Pending(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Pending_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -235,6 +260,9 @@ func request_Agency_Approve_0(ctx context.Context, marshaler runtime.Marshaler,
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Approve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: agency.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/ec/market/proto/agency.proto
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -37,23 +38,23 @@ const (
// 营销服务 - 代理商
type AgencyClient interface {
// 登录
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error)
// 新增代理商
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 获取一个代理商
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 更新代理商数据
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除一个代理商
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 更新密码
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
//待审核
Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 待审核
Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 审核
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error)
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type agencyClient struct {
@@ -64,9 +65,9 @@ func NewAgencyClient(cc grpc.ClientConnInterface) AgencyClient {
return &agencyClient{cc}
}
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoginReply)
out := new(protobuf.MarketLoginReply)
err := c.cc.Invoke(ctx, Agency_Login_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -74,9 +75,9 @@ func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc
return out, nil
}
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -84,7 +85,7 @@ func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts .
return out, nil
}
func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
func (c *agencyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MarketAgenctyItem)
err := c.cc.Invoke(ctx, Agency_Get_FullMethodName, in, out, cOpts...)
@@ -94,7 +95,7 @@ func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.C
return out, nil
}
func (c *agencyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AgencyReply)
err := c.cc.Invoke(ctx, Agency_Fetch_FullMethodName, in, out, cOpts...)
@@ -104,9 +105,9 @@ func (c *agencyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc
return out, nil
}
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -114,9 +115,9 @@ func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts .
return out, nil
}
func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -124,9 +125,9 @@ func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grp
return out, nil
}
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_SetPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -134,7 +135,7 @@ func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest,
return out, nil
}
func (c *agencyClient) Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
func (c *agencyClient) Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AgencyReply)
err := c.cc.Invoke(ctx, Agency_Pending_FullMethodName, in, out, cOpts...)
@@ -144,9 +145,9 @@ func (c *agencyClient) Pending(ctx context.Context, in *FetchRequest, opts ...gr
return out, nil
}
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Approve_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -155,68 +156,66 @@ func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...
}
// AgencyServer is the server API for Agency service.
// All implementations must embed UnimplementedAgencyServer
// All implementations should embed UnimplementedAgencyServer
// for forward compatibility.
//
// 营销服务 - 代理商
type AgencyServer interface {
// 登录
Login(context.Context, *LoginRequest) (*LoginReply, error)
Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error)
// 新增代理商
Create(context.Context, *MarketAgenctyItem) (*StatusReply, error)
Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
// 获取一个代理商
Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error)
Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(context.Context, *FetchRequest) (*AgencyReply, error)
Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
// 更新代理商数据
Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error)
Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
// 删除一个代理商
Delete(context.Context, *IdentRequest) (*StatusReply, error)
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
// 更新密码
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
//待审核
Pending(context.Context, *FetchRequest) (*AgencyReply, error)
SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error)
// 待审核
Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
// 审核
Approve(context.Context, *ApproveRequest) (*StatusReply, error)
mustEmbedUnimplementedAgencyServer()
Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedAgencyServer must be embedded to have
// UnimplementedAgencyServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAgencyServer struct{}
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*LoginReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error) {
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAgencyServer) Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
func (UnimplementedAgencyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedAgencyServer) Fetch(context.Context, *FetchRequest) (*AgencyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
func (UnimplementedAgencyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedAgencyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
func (UnimplementedAgencyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
}
func (UnimplementedAgencyServer) Pending(context.Context, *FetchRequest) (*AgencyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Pending not implemented")
func (UnimplementedAgencyServer) Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Pending not implemented")
}
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented")
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Approve not implemented")
}
func (UnimplementedAgencyServer) mustEmbedUnimplementedAgencyServer() {}
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
// UnsafeAgencyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AgencyServer will
@@ -226,7 +225,7 @@ type UnsafeAgencyServer interface {
}
func RegisterAgencyServer(s grpc.ServiceRegistrar, srv AgencyServer) {
// If the following call pancis, it indicates UnimplementedAgencyServer was
// If the following call panics, it indicates UnimplementedAgencyServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -273,7 +272,7 @@ func _Agency_Create_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Agency_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -285,13 +284,13 @@ func _Agency_Get_Handler(srv interface{}, ctx context.Context, dec func(interfac
FullMethod: Agency_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Get(ctx, req.(*IdentRequest))
return srv.(AgencyServer).Get(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -303,7 +302,7 @@ func _Agency_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Agency_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Fetch(ctx, req.(*FetchRequest))
return srv.(AgencyServer).Fetch(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -327,7 +326,7 @@ func _Agency_Modify_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Agency_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -339,7 +338,7 @@ func _Agency_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Agency_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Delete(ctx, req.(*IdentRequest))
return srv.(AgencyServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -363,7 +362,7 @@ func _Agency_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(
}
func _Agency_Pending_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -375,7 +374,7 @@ func _Agency_Pending_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: Agency_Pending_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Pending(ctx, req.(*FetchRequest))
return srv.(AgencyServer).Pending(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -443,5 +442,5 @@ var Agency_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "agency.proto",
Metadata: "module/ec/market/proto/agency.proto",
}

View File

@@ -1,622 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: blocks.proto
package market
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Empty struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Empty) Reset() {
*x = Empty{}
mi := &file_blocks_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{0}
}
type FetchRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
PageNo int64 `protobuf:"varint,1,opt,name=page_no,proto3" json:"page_no,omitempty"` // 页数
PageSize int64 `protobuf:"varint,2,opt,name=page_size,proto3" json:"page_size,omitempty"` // 每页记录数
Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 条件参数,key=val,eg key:categoryId=?,vlaue=11
Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
Keyword string `protobuf:"bytes,5,opt,name=keyword,proto3" json:"keyword,omitempty"` //关键词
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` // 状态默认为0-1禁止1为正常
Approve int32 `protobuf:"varint,7,opt,name=approve,proto3" json:"approve,omitempty"` // 审核状态0待审核 2审核通过 -2审核未通过
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FetchRequest) Reset() {
*x = FetchRequest{}
mi := &file_blocks_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FetchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FetchRequest) ProtoMessage() {}
func (x *FetchRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.
func (*FetchRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{1}
}
func (x *FetchRequest) GetPageNo() int64 {
if x != nil {
return x.PageNo
}
return 0
}
func (x *FetchRequest) GetPageSize() int64 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *FetchRequest) GetParams() map[string]string {
if x != nil {
return x.Params
}
return nil
}
func (x *FetchRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *FetchRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
func (x *FetchRequest) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *FetchRequest) GetApprove() int32 {
if x != nil {
return x.Approve
}
return 0
}
type IdentRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 唯一ID
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一码
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IdentRequest) Reset() {
*x = IdentRequest{}
mi := &file_blocks_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IdentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IdentRequest) ProtoMessage() {}
func (x *IdentRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IdentRequest.ProtoReflect.Descriptor instead.
func (*IdentRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{2}
}
func (x *IdentRequest) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *IdentRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
type StoreSerialRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
StoreIdentity string `protobuf:"bytes,1,opt,name=store_identity,proto3" json:"store_identity,omitempty"` // 店铺Identity
SerialId []string `protobuf:"bytes,2,rep,name=serial_id,proto3" json:"serial_id,omitempty"` // 序列Identity
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StoreSerialRequest) Reset() {
*x = StoreSerialRequest{}
mi := &file_blocks_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StoreSerialRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StoreSerialRequest) ProtoMessage() {}
func (x *StoreSerialRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StoreSerialRequest.ProtoReflect.Descriptor instead.
func (*StoreSerialRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{3}
}
func (x *StoreSerialRequest) GetStoreIdentity() string {
if x != nil {
return x.StoreIdentity
}
return ""
}
func (x *StoreSerialRequest) GetSerialId() []string {
if x != nil {
return x.SerialId
}
return nil
}
type StatusReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 标识码
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` //状态说明
Timeseq int64 `protobuf:"varint,4,opt,name=timeseq,proto3" json:"timeseq,omitempty"` // 响应时间序列
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StatusReply) Reset() {
*x = StatusReply{}
mi := &file_blocks_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StatusReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusReply) ProtoMessage() {}
func (x *StatusReply) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
func (*StatusReply) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{4}
}
func (x *StatusReply) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
func (x *StatusReply) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *StatusReply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *StatusReply) GetTimeseq() int64 {
if x != nil {
return x.Timeseq
}
return 0
}
type LoginReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // token 授权码
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
MarketIdentity string `protobuf:"bytes,3,opt,name=market_identity,proto3" json:"market_identity,omitempty"` // 店铺唯一标识
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // 姓名
Account string `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"` // 账号
Role string `protobuf:"bytes,6,opt,name=role,proto3" json:"role,omitempty"` // 角色
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` // 状态
CreatedAt string `protobuf:"bytes,8,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
MarketName string `protobuf:"bytes,9,opt,name=market_name,proto3" json:"market_name,omitempty"` // 店铺名称
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *LoginReply) Reset() {
*x = LoginReply{}
mi := &file_blocks_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LoginReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginReply) ProtoMessage() {}
func (x *LoginReply) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
func (*LoginReply) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{5}
}
func (x *LoginReply) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *LoginReply) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *LoginReply) GetMarketIdentity() string {
if x != nil {
return x.MarketIdentity
}
return ""
}
func (x *LoginReply) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *LoginReply) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *LoginReply) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
func (x *LoginReply) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *LoginReply) GetCreatedAt() string {
if x != nil {
return x.CreatedAt
}
return ""
}
func (x *LoginReply) GetMarketName() string {
if x != nil {
return x.MarketName
}
return ""
}
type VersionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // 时序版本号
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *VersionRequest) Reset() {
*x = VersionRequest{}
mi := &file_blocks_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *VersionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VersionRequest) ProtoMessage() {}
func (x *VersionRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead.
func (*VersionRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{6}
}
func (x *VersionRequest) GetVersion() int64 {
if x != nil {
return x.Version
}
return 0
}
type SearchRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` //关键词
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SearchRequest) Reset() {
*x = SearchRequest{}
mi := &file_blocks_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SearchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchRequest) ProtoMessage() {}
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{7}
}
func (x *SearchRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
var File_blocks_proto protoreflect.FileDescriptor
const file_blocks_proto_rawDesc = "" +
"\n" +
"\x13market/blocks.proto\x12\x06market\"\a\n" +
"\x05Empty\"\xa3\x02\n" +
"\fFetchRequest\x12\x18\n" +
"\apage_no\x18\x01 \x01(\x03R\apage_no\x12\x1c\n" +
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x128\n" +
"\x06params\x18\x03 \x03(\v2 .market.FetchRequest.ParamsEntryR\x06params\x12\x1a\n" +
"\bidentity\x18\x04 \x01(\tR\bidentity\x12\x18\n" +
"\akeyword\x18\x05 \x01(\tR\akeyword\x12\x16\n" +
"\x06status\x18\x06 \x01(\x05R\x06status\x12\x18\n" +
"\aapprove\x18\a \x01(\x05R\aapprove\x1a9\n" +
"\vParamsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\":\n" +
"\fIdentRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\"Z\n" +
"\x12StoreSerialRequest\x12&\n" +
"\x0estore_identity\x18\x01 \x01(\tR\x0estore_identity\x12\x1c\n" +
"\tserial_id\x18\x02 \x03(\tR\tserial_id\"q\n" +
"\vStatusReply\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\x12\x18\n" +
"\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" +
"\atimeseq\x18\x04 \x01(\x03R\atimeseq\"\x84\x02\n" +
"\n" +
"LoginReply\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\x12(\n" +
"\x0fmarket_identity\x18\x03 \x01(\tR\x0fmarket_identity\x12\x12\n" +
"\x04name\x18\x04 \x01(\tR\x04name\x12\x18\n" +
"\aaccount\x18\x05 \x01(\tR\aaccount\x12\x12\n" +
"\x04role\x18\x06 \x01(\tR\x04role\x12\x16\n" +
"\x06status\x18\a \x01(\x05R\x06status\x12\x1e\n" +
"\n" +
"created_at\x18\b \x01(\tR\n" +
"created_at\x12 \n" +
"\vmarket_name\x18\t \x01(\tR\vmarket_name\"*\n" +
"\x0eVersionRequest\x12\x18\n" +
"\aversion\x18\x01 \x01(\x03R\aversion\")\n" +
"\rSearchRequest\x12\x18\n" +
"\akeyword\x18\x01 \x01(\tR\akeywordB\n" +
"Z\b.;marketb\x06proto3"
var (
file_blocks_proto_rawDescOnce sync.Once
file_blocks_proto_rawDescData []byte
)
func file_blocks_proto_rawDescGZIP() []byte {
file_blocks_proto_rawDescOnce.Do(func() {
file_blocks_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)))
})
return file_blocks_proto_rawDescData
}
var file_blocks_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_blocks_proto_goTypes = []any{
(*Empty)(nil), // 0: market.Empty
(*FetchRequest)(nil), // 1: market.FetchRequest
(*IdentRequest)(nil), // 2: market.IdentRequest
(*StoreSerialRequest)(nil), // 3: market.StoreSerialRequest
(*StatusReply)(nil), // 4: market.StatusReply
(*LoginReply)(nil), // 5: market.LoginReply
(*VersionRequest)(nil), // 6: market.VersionRequest
(*SearchRequest)(nil), // 7: market.SearchRequest
nil, // 8: market.FetchRequest.ParamsEntry
}
var file_blocks_proto_depIdxs = []int32{
8, // 0: market.FetchRequest.params:type_name -> market.FetchRequest.ParamsEntry
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_blocks_proto_init() }
func file_blocks_proto_init() {
if File_blocks_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)),
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_blocks_proto_goTypes,
DependencyIndexes: file_blocks_proto_depIdxs,
MessageInfos: file_blocks_proto_msgTypes,
}.Build()
File_blocks_proto = out.File
file_blocks_proto_goTypes = nil
file_blocks_proto_depIdxs = nil
}

View File

@@ -0,0 +1,12 @@
package market
import blocks "bsm/full/protobuf"
type Empty = blocks.Empty
type FetchRequest = blocks.MarketFetchRequest
type IdentRequest = blocks.IdentRequest
type StoreSerialRequest = blocks.StoreSerialRequest
type StatusReply = blocks.IdentityStatusReply
type LoginReply = blocks.MarketLoginReply
type VersionRequest = blocks.VersionRequest
type SearchRequest = blocks.SearchRequest

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: data.proto
// protoc-gen-go v1.36.11
// protoc v7.35.0
// source: module/ec/market/proto/data.proto
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -41,7 +42,7 @@ type OverviewReply struct {
func (x *OverviewReply) Reset() {
*x = OverviewReply{}
mi := &file_data_proto_msgTypes[0]
mi := &file_module_ec_market_proto_data_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -53,7 +54,7 @@ func (x *OverviewReply) String() string {
func (*OverviewReply) ProtoMessage() {}
func (x *OverviewReply) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[0]
mi := &file_module_ec_market_proto_data_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -66,7 +67,7 @@ func (x *OverviewReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use OverviewReply.ProtoReflect.Descriptor instead.
func (*OverviewReply) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{0}
return file_module_ec_market_proto_data_proto_rawDescGZIP(), []int{0}
}
func (x *OverviewReply) GetTotalApprove() int64 {
@@ -121,7 +122,7 @@ type DataReply struct {
func (x *DataReply) Reset() {
*x = DataReply{}
mi := &file_data_proto_msgTypes[1]
mi := &file_module_ec_market_proto_data_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -133,7 +134,7 @@ func (x *DataReply) String() string {
func (*DataReply) ProtoMessage() {}
func (x *DataReply) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[1]
mi := &file_module_ec_market_proto_data_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -146,7 +147,7 @@ func (x *DataReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use DataReply.ProtoReflect.Descriptor instead.
func (*DataReply) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{1}
return file_module_ec_market_proto_data_proto_rawDescGZIP(), []int{1}
}
func (x *DataReply) GetCount() int64 {
@@ -173,7 +174,7 @@ type KeyVal struct {
func (x *KeyVal) Reset() {
*x = KeyVal{}
mi := &file_data_proto_msgTypes[2]
mi := &file_module_ec_market_proto_data_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -185,7 +186,7 @@ func (x *KeyVal) String() string {
func (*KeyVal) ProtoMessage() {}
func (x *KeyVal) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[2]
mi := &file_module_ec_market_proto_data_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -198,7 +199,7 @@ func (x *KeyVal) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeyVal.ProtoReflect.Descriptor instead.
func (*KeyVal) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{2}
return file_module_ec_market_proto_data_proto_rawDescGZIP(), []int{2}
}
func (x *KeyVal) GetKey() string {
@@ -215,12 +216,11 @@ func (x *KeyVal) GetVal() string {
return ""
}
var File_data_proto protoreflect.FileDescriptor
var File_module_ec_market_proto_data_proto protoreflect.FileDescriptor
const file_data_proto_rawDesc = "" +
const file_module_ec_market_proto_data_proto_rawDesc = "" +
"\n" +
"\x14" +
"ec/market/data.proto\x12\x06market\x1a\x13market/blocks.proto\"\xad\x03\n" +
"!module/ec/market/proto/data.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\xad\x03\n" +
"\rOverviewReply\x12$\n" +
"\rtotal_approve\x18\x01 \x01(\x03R\rtotal_approve\x12 \n" +
"\vtotal_month\x18\x02 \x01(\x03R\vtotal_month\x12\x1c\n" +
@@ -239,48 +239,47 @@ const file_data_proto_rawDesc = "" +
"\x04data\x18\x02 \x03(\v2\x0e.market.KeyValR\x04data\",\n" +
"\x06KeyVal\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x10\n" +
"\x03val\x18\x02 \x01(\tR\x03val2\x9e\x02\n" +
"\x03val\x18\x02 \x01(\tR\x03val2\xaa\x02\n" +
"\x04Data\x122\n" +
"\bOverview\x12\r.market.Empty\x1a\x15.market.OverviewReply\"\x00\x128\n" +
"\vMemberFetch\x12\x14.market.FetchRequest\x1a\x11.market.DataReply\"\x00\x127\n" +
"\rMemberDetails\x12\x14.market.IdentRequest\x1a\x0e.market.KeyVal\"\x00\x127\n" +
"\bOverview\x12\r.blocks.Empty\x1a\x15.market.OverviewReply\"\x00\x12>\n" +
"\vMemberFetch\x12\x1a.blocks.MarketFetchRequest\x1a\x11.market.DataReply\"\x00\x127\n" +
"\rMemberDetails\x12\x14.blocks.IdentRequest\x1a\x0e.market.KeyVal\"\x00\x12=\n" +
"\n" +
"OrderFetch\x12\x14.market.FetchRequest\x1a\x11.market.DataReply\"\x00\x126\n" +
"\fOrderDetails\x12\x14.market.IdentRequest\x1a\x0e.market.KeyVal\"\x00B\n" +
"Z\b.;marketb\x06proto3"
"OrderFetch\x12\x1a.blocks.MarketFetchRequest\x1a\x11.market.DataReply\"\x00\x126\n" +
"\fOrderDetails\x12\x14.blocks.IdentRequest\x1a\x0e.market.KeyVal\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
var (
file_data_proto_rawDescOnce sync.Once
file_data_proto_rawDescData []byte
file_module_ec_market_proto_data_proto_rawDescOnce sync.Once
file_module_ec_market_proto_data_proto_rawDescData []byte
)
func file_data_proto_rawDescGZIP() []byte {
file_data_proto_rawDescOnce.Do(func() {
file_data_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_data_proto_rawDesc), len(file_data_proto_rawDesc)))
func file_module_ec_market_proto_data_proto_rawDescGZIP() []byte {
file_module_ec_market_proto_data_proto_rawDescOnce.Do(func() {
file_module_ec_market_proto_data_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_data_proto_rawDesc), len(file_module_ec_market_proto_data_proto_rawDesc)))
})
return file_data_proto_rawDescData
return file_module_ec_market_proto_data_proto_rawDescData
}
var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_data_proto_goTypes = []any{
(*OverviewReply)(nil), // 0: market.OverviewReply
(*DataReply)(nil), // 1: market.DataReply
(*KeyVal)(nil), // 2: market.KeyVal
nil, // 3: market.OverviewReply.ReportMonthEntry
nil, // 4: market.OverviewReply.ReportStaffEntry
(*Empty)(nil), // 5: market.Empty
(*FetchRequest)(nil), // 6: market.FetchRequest
(*IdentRequest)(nil), // 7: market.IdentRequest
var file_module_ec_market_proto_data_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_module_ec_market_proto_data_proto_goTypes = []any{
(*OverviewReply)(nil), // 0: market.OverviewReply
(*DataReply)(nil), // 1: market.DataReply
(*KeyVal)(nil), // 2: market.KeyVal
nil, // 3: market.OverviewReply.ReportMonthEntry
nil, // 4: market.OverviewReply.ReportStaffEntry
(*protobuf.Empty)(nil), // 5: blocks.Empty
(*protobuf.MarketFetchRequest)(nil), // 6: blocks.MarketFetchRequest
(*protobuf.IdentRequest)(nil), // 7: blocks.IdentRequest
}
var file_data_proto_depIdxs = []int32{
var file_module_ec_market_proto_data_proto_depIdxs = []int32{
3, // 0: market.OverviewReply.report_month:type_name -> market.OverviewReply.ReportMonthEntry
4, // 1: market.OverviewReply.report_staff:type_name -> market.OverviewReply.ReportStaffEntry
2, // 2: market.DataReply.data:type_name -> market.KeyVal
5, // 3: market.Data.Overview:input_type -> market.Empty
6, // 4: market.Data.MemberFetch:input_type -> market.FetchRequest
7, // 5: market.Data.MemberDetails:input_type -> market.IdentRequest
6, // 6: market.Data.OrderFetch:input_type -> market.FetchRequest
7, // 7: market.Data.OrderDetails:input_type -> market.IdentRequest
5, // 3: market.Data.Overview:input_type -> blocks.Empty
6, // 4: market.Data.MemberFetch:input_type -> blocks.MarketFetchRequest
7, // 5: market.Data.MemberDetails:input_type -> blocks.IdentRequest
6, // 6: market.Data.OrderFetch:input_type -> blocks.MarketFetchRequest
7, // 7: market.Data.OrderDetails:input_type -> blocks.IdentRequest
0, // 8: market.Data.Overview:output_type -> market.OverviewReply
1, // 9: market.Data.MemberFetch:output_type -> market.DataReply
2, // 10: market.Data.MemberDetails:output_type -> market.KeyVal
@@ -293,27 +292,26 @@ var file_data_proto_depIdxs = []int32{
0, // [0:3] is the sub-list for field type_name
}
func init() { file_data_proto_init() }
func file_data_proto_init() {
if File_data_proto != nil {
func init() { file_module_ec_market_proto_data_proto_init() }
func file_module_ec_market_proto_data_proto_init() {
if File_module_ec_market_proto_data_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_data_proto_rawDesc), len(file_data_proto_rawDesc)),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_data_proto_rawDesc), len(file_module_ec_market_proto_data_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_data_proto_goTypes,
DependencyIndexes: file_data_proto_depIdxs,
MessageInfos: file_data_proto_msgTypes,
GoTypes: file_module_ec_market_proto_data_proto_goTypes,
DependencyIndexes: file_module_ec_market_proto_data_proto_depIdxs,
MessageInfos: file_module_ec_market_proto_data_proto_msgTypes,
}.Build()
File_data_proto = out.File
file_data_proto_goTypes = nil
file_data_proto_depIdxs = nil
File_module_ec_market_proto_data_proto = out.File
file_module_ec_market_proto_data_proto_goTypes = nil
file_module_ec_market_proto_data_proto_depIdxs = nil
}

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: data.proto
// source: module/ec/market/proto/data.proto
/*
Package market is a reverse proxy.
@@ -9,6 +9,7 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -37,19 +38,22 @@ var (
func request_Data_Overview_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq Empty
protoReq blocks.Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Overview(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_Overview_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq Empty
protoReq blocks.Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -61,19 +65,22 @@ func local_request_Data_Overview_0(ctx context.Context, marshaler runtime.Marsha
func request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.MemberFetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -85,19 +92,22 @@ func local_request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Mar
func request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.MemberDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -109,19 +119,22 @@ func local_request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.M
func request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.OrderFetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -133,19 +146,22 @@ func local_request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Mars
func request_Data_OrderDetails_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.OrderDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_OrderDetails_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: data.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/ec/market/proto/data.proto
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -33,15 +34,15 @@ const (
// 数据服务
type DataClient interface {
// 概况
Overview(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OverviewReply, error)
Overview(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*OverviewReply, error)
// 会员列表
MemberFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error)
MemberFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 会员详情
MemberDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
MemberDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
// 订单列表
OrderFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error)
OrderFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 订单详情
OrderDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
OrderDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
}
type dataClient struct {
@@ -52,7 +53,7 @@ func NewDataClient(cc grpc.ClientConnInterface) DataClient {
return &dataClient{cc}
}
func (c *dataClient) Overview(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OverviewReply, error) {
func (c *dataClient) Overview(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*OverviewReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OverviewReply)
err := c.cc.Invoke(ctx, Data_Overview_FullMethodName, in, out, cOpts...)
@@ -62,7 +63,7 @@ func (c *dataClient) Overview(ctx context.Context, in *Empty, opts ...grpc.CallO
return out, nil
}
func (c *dataClient) MemberFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
func (c *dataClient) MemberFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DataReply)
err := c.cc.Invoke(ctx, Data_MemberFetch_FullMethodName, in, out, cOpts...)
@@ -72,7 +73,7 @@ func (c *dataClient) MemberFetch(ctx context.Context, in *FetchRequest, opts ...
return out, nil
}
func (c *dataClient) MemberDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
func (c *dataClient) MemberDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(KeyVal)
err := c.cc.Invoke(ctx, Data_MemberDetails_FullMethodName, in, out, cOpts...)
@@ -82,7 +83,7 @@ func (c *dataClient) MemberDetails(ctx context.Context, in *IdentRequest, opts .
return out, nil
}
func (c *dataClient) OrderFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
func (c *dataClient) OrderFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DataReply)
err := c.cc.Invoke(ctx, Data_OrderFetch_FullMethodName, in, out, cOpts...)
@@ -92,7 +93,7 @@ func (c *dataClient) OrderFetch(ctx context.Context, in *FetchRequest, opts ...g
return out, nil
}
func (c *dataClient) OrderDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
func (c *dataClient) OrderDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(KeyVal)
err := c.cc.Invoke(ctx, Data_OrderDetails_FullMethodName, in, out, cOpts...)
@@ -103,48 +104,46 @@ func (c *dataClient) OrderDetails(ctx context.Context, in *IdentRequest, opts ..
}
// DataServer is the server API for Data service.
// All implementations must embed UnimplementedDataServer
// All implementations should embed UnimplementedDataServer
// for forward compatibility.
//
// 数据服务
type DataServer interface {
// 概况
Overview(context.Context, *Empty) (*OverviewReply, error)
Overview(context.Context, *protobuf.Empty) (*OverviewReply, error)
// 会员列表
MemberFetch(context.Context, *FetchRequest) (*DataReply, error)
MemberFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error)
// 会员详情
MemberDetails(context.Context, *IdentRequest) (*KeyVal, error)
MemberDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error)
// 订单列表
OrderFetch(context.Context, *FetchRequest) (*DataReply, error)
OrderFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error)
// 订单详情
OrderDetails(context.Context, *IdentRequest) (*KeyVal, error)
mustEmbedUnimplementedDataServer()
OrderDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error)
}
// UnimplementedDataServer must be embedded to have
// UnimplementedDataServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDataServer struct{}
func (UnimplementedDataServer) Overview(context.Context, *Empty) (*OverviewReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Overview not implemented")
func (UnimplementedDataServer) Overview(context.Context, *protobuf.Empty) (*OverviewReply, error) {
return nil, status.Error(codes.Unimplemented, "method Overview not implemented")
}
func (UnimplementedDataServer) MemberFetch(context.Context, *FetchRequest) (*DataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MemberFetch not implemented")
func (UnimplementedDataServer) MemberFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error) {
return nil, status.Error(codes.Unimplemented, "method MemberFetch not implemented")
}
func (UnimplementedDataServer) MemberDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Errorf(codes.Unimplemented, "method MemberDetails not implemented")
func (UnimplementedDataServer) MemberDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error) {
return nil, status.Error(codes.Unimplemented, "method MemberDetails not implemented")
}
func (UnimplementedDataServer) OrderFetch(context.Context, *FetchRequest) (*DataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderFetch not implemented")
func (UnimplementedDataServer) OrderFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error) {
return nil, status.Error(codes.Unimplemented, "method OrderFetch not implemented")
}
func (UnimplementedDataServer) OrderDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderDetails not implemented")
func (UnimplementedDataServer) OrderDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error) {
return nil, status.Error(codes.Unimplemented, "method OrderDetails not implemented")
}
func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {}
func (UnimplementedDataServer) testEmbeddedByValue() {}
func (UnimplementedDataServer) testEmbeddedByValue() {}
// UnsafeDataServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DataServer will
@@ -154,7 +153,7 @@ type UnsafeDataServer interface {
}
func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
// If the following call pancis, it indicates UnimplementedDataServer was
// If the following call panics, it indicates UnimplementedDataServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -165,7 +164,7 @@ func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
}
func _Data_Overview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
in := new(protobuf.Empty)
if err := dec(in); err != nil {
return nil, err
}
@@ -177,13 +176,13 @@ func _Data_Overview_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Data_Overview_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).Overview(ctx, req.(*Empty))
return srv.(DataServer).Overview(ctx, req.(*protobuf.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Data_MemberFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -195,13 +194,13 @@ func _Data_MemberFetch_Handler(srv interface{}, ctx context.Context, dec func(in
FullMethod: Data_MemberFetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).MemberFetch(ctx, req.(*FetchRequest))
return srv.(DataServer).MemberFetch(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_MemberDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -213,13 +212,13 @@ func _Data_MemberDetails_Handler(srv interface{}, ctx context.Context, dec func(
FullMethod: Data_MemberDetails_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).MemberDetails(ctx, req.(*IdentRequest))
return srv.(DataServer).MemberDetails(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_OrderFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -231,13 +230,13 @@ func _Data_OrderFetch_Handler(srv interface{}, ctx context.Context, dec func(int
FullMethod: Data_OrderFetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).OrderFetch(ctx, req.(*FetchRequest))
return srv.(DataServer).OrderFetch(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_OrderDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -249,7 +248,7 @@ func _Data_OrderDetails_Handler(srv interface{}, ctx context.Context, dec func(i
FullMethod: Data_OrderDetails_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).OrderDetails(ctx, req.(*IdentRequest))
return srv.(DataServer).OrderDetails(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -283,5 +282,5 @@ var Data_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "data.proto",
Metadata: "module/ec/market/proto/data.proto",
}

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: supply.proto
// protoc-gen-go v1.36.11
// protoc v7.35.0
// source: module/ec/market/proto/supply.proto
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -44,7 +45,7 @@ type MarketSupplyItem struct {
func (x *MarketSupplyItem) Reset() {
*x = MarketSupplyItem{}
mi := &file_supply_proto_msgTypes[0]
mi := &file_module_ec_market_proto_supply_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -56,7 +57,7 @@ func (x *MarketSupplyItem) String() string {
func (*MarketSupplyItem) ProtoMessage() {}
func (x *MarketSupplyItem) ProtoReflect() protoreflect.Message {
mi := &file_supply_proto_msgTypes[0]
mi := &file_module_ec_market_proto_supply_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -69,7 +70,7 @@ func (x *MarketSupplyItem) ProtoReflect() protoreflect.Message {
// Deprecated: Use MarketSupplyItem.ProtoReflect.Descriptor instead.
func (*MarketSupplyItem) Descriptor() ([]byte, []int) {
return file_supply_proto_rawDescGZIP(), []int{0}
return file_module_ec_market_proto_supply_proto_rawDescGZIP(), []int{0}
}
func (x *MarketSupplyItem) GetName() string {
@@ -187,7 +188,7 @@ type SupplyReply struct {
func (x *SupplyReply) Reset() {
*x = SupplyReply{}
mi := &file_supply_proto_msgTypes[1]
mi := &file_module_ec_market_proto_supply_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -199,7 +200,7 @@ func (x *SupplyReply) String() string {
func (*SupplyReply) ProtoMessage() {}
func (x *SupplyReply) ProtoReflect() protoreflect.Message {
mi := &file_supply_proto_msgTypes[1]
mi := &file_module_ec_market_proto_supply_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -212,7 +213,7 @@ func (x *SupplyReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use SupplyReply.ProtoReflect.Descriptor instead.
func (*SupplyReply) Descriptor() ([]byte, []int) {
return file_supply_proto_rawDescGZIP(), []int{1}
return file_module_ec_market_proto_supply_proto_rawDescGZIP(), []int{1}
}
func (x *SupplyReply) GetCount() int64 {
@@ -229,11 +230,11 @@ func (x *SupplyReply) GetData() []*MarketSupplyItem {
return nil
}
var File_supply_proto protoreflect.FileDescriptor
var File_module_ec_market_proto_supply_proto protoreflect.FileDescriptor
const file_supply_proto_rawDesc = "" +
const file_module_ec_market_proto_supply_proto_rawDesc = "" +
"\n" +
"\x16ec/market/supply.proto\x12\x06market\x1a\x13market/blocks.proto\"\x9e\x03\n" +
"#module/ec/market/proto/supply.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\x9e\x03\n" +
"\x10MarketSupplyItem\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" +
"\x06avatar\x18\x02 \x01(\tR\x06avatar\x12(\n" +
@@ -253,47 +254,46 @@ const file_supply_proto_rawDesc = "" +
"\x02id\x18\x0f \x01(\x05R\x02id\"Q\n" +
"\vSupplyReply\x12\x14\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\x12,\n" +
"\x04data\x18\x02 \x03(\v2\x18.market.MarketSupplyItemR\x04data2\xa4\x02\n" +
"\x06Supply\x129\n" +
"\x06Create\x12\x18.market.MarketSupplyItem\x1a\x13.market.StatusReply\"\x00\x127\n" +
"\x03Get\x12\x14.market.IdentRequest\x1a\x18.market.MarketSupplyItem\"\x00\x124\n" +
"\x05Fetch\x12\x14.market.FetchRequest\x1a\x13.market.SupplyReply\"\x00\x129\n" +
"\x06Modify\x12\x18.market.MarketSupplyItem\x1a\x13.market.StatusReply\"\x00\x125\n" +
"\x06Delete\x12\x14.market.IdentRequest\x1a\x13.market.StatusReply\"\x00B\n" +
"Z\b.;marketb\x06proto3"
"\x04data\x18\x02 \x03(\v2\x18.market.MarketSupplyItemR\x04data2\xc2\x02\n" +
"\x06Supply\x12A\n" +
"\x06Create\x12\x18.market.MarketSupplyItem\x1a\x1b.blocks.IdentityStatusReply\"\x00\x127\n" +
"\x03Get\x12\x14.blocks.IdentRequest\x1a\x18.market.MarketSupplyItem\"\x00\x12:\n" +
"\x05Fetch\x12\x1a.blocks.MarketFetchRequest\x1a\x13.market.SupplyReply\"\x00\x12A\n" +
"\x06Modify\x12\x18.market.MarketSupplyItem\x1a\x1b.blocks.IdentityStatusReply\"\x00\x12=\n" +
"\x06Delete\x12\x14.blocks.IdentRequest\x1a\x1b.blocks.IdentityStatusReply\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
var (
file_supply_proto_rawDescOnce sync.Once
file_supply_proto_rawDescData []byte
file_module_ec_market_proto_supply_proto_rawDescOnce sync.Once
file_module_ec_market_proto_supply_proto_rawDescData []byte
)
func file_supply_proto_rawDescGZIP() []byte {
file_supply_proto_rawDescOnce.Do(func() {
file_supply_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_supply_proto_rawDesc), len(file_supply_proto_rawDesc)))
func file_module_ec_market_proto_supply_proto_rawDescGZIP() []byte {
file_module_ec_market_proto_supply_proto_rawDescOnce.Do(func() {
file_module_ec_market_proto_supply_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_supply_proto_rawDesc), len(file_module_ec_market_proto_supply_proto_rawDesc)))
})
return file_supply_proto_rawDescData
return file_module_ec_market_proto_supply_proto_rawDescData
}
var file_supply_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_supply_proto_goTypes = []any{
(*MarketSupplyItem)(nil), // 0: market.MarketSupplyItem
(*SupplyReply)(nil), // 1: market.SupplyReply
(*IdentRequest)(nil), // 2: market.IdentRequest
(*FetchRequest)(nil), // 3: market.FetchRequest
(*StatusReply)(nil), // 4: market.StatusReply
var file_module_ec_market_proto_supply_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_module_ec_market_proto_supply_proto_goTypes = []any{
(*MarketSupplyItem)(nil), // 0: market.MarketSupplyItem
(*SupplyReply)(nil), // 1: market.SupplyReply
(*protobuf.IdentRequest)(nil), // 2: blocks.IdentRequest
(*protobuf.MarketFetchRequest)(nil), // 3: blocks.MarketFetchRequest
(*protobuf.IdentityStatusReply)(nil), // 4: blocks.IdentityStatusReply
}
var file_supply_proto_depIdxs = []int32{
var file_module_ec_market_proto_supply_proto_depIdxs = []int32{
0, // 0: market.SupplyReply.data:type_name -> market.MarketSupplyItem
0, // 1: market.Supply.Create:input_type -> market.MarketSupplyItem
2, // 2: market.Supply.Get:input_type -> market.IdentRequest
3, // 3: market.Supply.Fetch:input_type -> market.FetchRequest
2, // 2: market.Supply.Get:input_type -> blocks.IdentRequest
3, // 3: market.Supply.Fetch:input_type -> blocks.MarketFetchRequest
0, // 4: market.Supply.Modify:input_type -> market.MarketSupplyItem
2, // 5: market.Supply.Delete:input_type -> market.IdentRequest
4, // 6: market.Supply.Create:output_type -> market.StatusReply
2, // 5: market.Supply.Delete:input_type -> blocks.IdentRequest
4, // 6: market.Supply.Create:output_type -> blocks.IdentityStatusReply
0, // 7: market.Supply.Get:output_type -> market.MarketSupplyItem
1, // 8: market.Supply.Fetch:output_type -> market.SupplyReply
4, // 9: market.Supply.Modify:output_type -> market.StatusReply
4, // 10: market.Supply.Delete:output_type -> market.StatusReply
4, // 9: market.Supply.Modify:output_type -> blocks.IdentityStatusReply
4, // 10: market.Supply.Delete:output_type -> blocks.IdentityStatusReply
6, // [6:11] is the sub-list for method output_type
1, // [1:6] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -301,27 +301,26 @@ var file_supply_proto_depIdxs = []int32{
0, // [0:1] is the sub-list for field type_name
}
func init() { file_supply_proto_init() }
func file_supply_proto_init() {
if File_supply_proto != nil {
func init() { file_module_ec_market_proto_supply_proto_init() }
func file_module_ec_market_proto_supply_proto_init() {
if File_module_ec_market_proto_supply_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_supply_proto_rawDesc), len(file_supply_proto_rawDesc)),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_module_ec_market_proto_supply_proto_rawDesc), len(file_module_ec_market_proto_supply_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_supply_proto_goTypes,
DependencyIndexes: file_supply_proto_depIdxs,
MessageInfos: file_supply_proto_msgTypes,
GoTypes: file_module_ec_market_proto_supply_proto_goTypes,
DependencyIndexes: file_module_ec_market_proto_supply_proto_depIdxs,
MessageInfos: file_module_ec_market_proto_supply_proto_msgTypes,
}.Build()
File_supply_proto = out.File
file_supply_proto_goTypes = nil
file_supply_proto_depIdxs = nil
File_module_ec_market_proto_supply_proto = out.File
file_module_ec_market_proto_supply_proto_goTypes = nil
file_module_ec_market_proto_supply_proto_depIdxs = nil
}

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: supply.proto
// source: module/ec/market/proto/supply.proto
/*
Package market is a reverse proxy.
@@ -9,6 +9,7 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -43,6 +44,9 @@ func request_Supply_Create_0(ctx context.Context, marshaler runtime.Marshaler, c
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -61,19 +65,22 @@ func local_request_Supply_Create_0(ctx context.Context, marshaler runtime.Marsha
func request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -85,19 +92,22 @@ func local_request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler
func request_Supply_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Fetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
protoReq blocks.MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -115,6 +125,9 @@ func request_Supply_Modify_0(ctx context.Context, marshaler runtime.Marshaler, c
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Modify(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@@ -133,19 +146,22 @@ func local_request_Supply_Modify_0(ctx context.Context, marshaler runtime.Marsha
func request_Supply_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
protoReq blocks.IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: supply.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/ec/market/proto/supply.proto
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -33,15 +34,15 @@ const (
// 营销服务 - 供应商
type SupplyClient interface {
// 新增供应商
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 获取一个供应商
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
// 供应商列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
// 更新供应商数据
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除一个供应商
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type supplyClient struct {
@@ -52,9 +53,9 @@ func NewSupplyClient(cc grpc.ClientConnInterface) SupplyClient {
return &supplyClient{cc}
}
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -62,7 +63,7 @@ func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
func (c *supplyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MarketSupplyItem)
err := c.cc.Invoke(ctx, Supply_Get_FullMethodName, in, out, cOpts...)
@@ -72,7 +73,7 @@ func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.C
return out, nil
}
func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
func (c *supplyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SupplyReply)
err := c.cc.Invoke(ctx, Supply_Fetch_FullMethodName, in, out, cOpts...)
@@ -82,9 +83,9 @@ func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc
return out, nil
}
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -92,9 +93,9 @@ func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -103,48 +104,46 @@ func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grp
}
// SupplyServer is the server API for Supply service.
// All implementations must embed UnimplementedSupplyServer
// All implementations should embed UnimplementedSupplyServer
// for forward compatibility.
//
// 营销服务 - 供应商
type SupplyServer interface {
// 新增供应商
Create(context.Context, *MarketSupplyItem) (*StatusReply, error)
Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
// 获取一个供应商
Get(context.Context, *IdentRequest) (*MarketSupplyItem, error)
Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error)
// 供应商列表
Fetch(context.Context, *FetchRequest) (*SupplyReply, error)
Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error)
// 更新供应商数据
Modify(context.Context, *MarketSupplyItem) (*StatusReply, error)
Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
// 删除一个供应商
Delete(context.Context, *IdentRequest) (*StatusReply, error)
mustEmbedUnimplementedSupplyServer()
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedSupplyServer must be embedded to have
// UnimplementedSupplyServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSupplyServer struct{}
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSupplyServer) Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
func (UnimplementedSupplyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedSupplyServer) Fetch(context.Context, *FetchRequest) (*SupplyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
func (UnimplementedSupplyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedSupplyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
func (UnimplementedSupplyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedSupplyServer) mustEmbedUnimplementedSupplyServer() {}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
// UnsafeSupplyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SupplyServer will
@@ -154,7 +153,7 @@ type UnsafeSupplyServer interface {
}
func RegisterSupplyServer(s grpc.ServiceRegistrar, srv SupplyServer) {
// If the following call pancis, it indicates UnimplementedSupplyServer was
// If the following call panics, it indicates UnimplementedSupplyServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -183,7 +182,7 @@ func _Supply_Create_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Supply_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -195,13 +194,13 @@ func _Supply_Get_Handler(srv interface{}, ctx context.Context, dec func(interfac
FullMethod: Supply_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Get(ctx, req.(*IdentRequest))
return srv.(SupplyServer).Get(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -213,7 +212,7 @@ func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Supply_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Fetch(ctx, req.(*FetchRequest))
return srv.(SupplyServer).Fetch(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -237,7 +236,7 @@ func _Supply_Modify_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Supply_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -249,7 +248,7 @@ func _Supply_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Supply_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Delete(ctx, req.(*IdentRequest))
return srv.(SupplyServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -283,5 +282,5 @@ var Supply_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "supply.proto",
Metadata: "module/ec/market/proto/supply.proto",
}