refactor: localize protobuf definitions

This commit is contained in:
2026-08-09 20:14:57 +08:00
parent 9f6f318bbb
commit 5ea45a76fe
429 changed files with 54058 additions and 61623 deletions

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -446,7 +445,7 @@ var File_module_ec_market_proto_agency_proto protoreflect.FileDescriptor
const file_module_ec_market_proto_agency_proto_rawDesc = "" +
"\n" +
"#module/ec/market/proto/agency.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\\\n" +
"#module/ec/market/proto/agency.proto\x12\x06market\x1a\"module/ec/market/proto/const.proto\"\\\n" +
"\fLoginRequest\x12\x18\n" +
"\aaccount\x18\x01 \x01(\tR\aaccount\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\x12\x16\n" +
@@ -510,15 +509,15 @@ func file_module_ec_market_proto_agency_proto_rawDescGZIP() []byte {
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
(*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: blocks.IdentRequest
(*MarketFetchRequest)(nil), // 6: blocks.MarketFetchRequest
(*MarketLoginReply)(nil), // 7: blocks.MarketLoginReply
(*IdentityStatusReply)(nil), // 8: blocks.IdentityStatusReply
}
var file_module_ec_market_proto_agency_proto_depIdxs = []int32{
1, // 0: market.AgencyReply.data:type_name -> market.MarketAgenctyItem
@@ -552,6 +551,7 @@ func file_module_ec_market_proto_agency_proto_init() {
if File_module_ec_market_proto_agency_proto != nil {
return
}
file_module_ec_market_proto_const_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{

View File

@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -92,7 +91,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -107,7 +106,7 @@ func request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler, clie
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -119,7 +118,7 @@ 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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -134,7 +133,7 @@ func request_Agency_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, cl
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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -173,7 +172,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -188,7 +187,7 @@ func request_Agency_Delete_0(ctx context.Context, marshaler runtime.Marshaler, c
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -227,7 +226,7 @@ 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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -242,7 +241,7 @@ func request_Agency_Pending_0(ctx context.Context, marshaler runtime.Marshaler,
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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -38,23 +37,23 @@ const (
// 营销服务 - 代理商
type AgencyClient interface {
// 登录
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error)
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*MarketLoginReply, error)
// 新增代理商
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 获取一个代理商
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
Fetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 更新代理商数据
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 删除一个代理商
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 更新密码
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 待审核
Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
Pending(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 审核
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
}
type agencyClient struct {
@@ -65,9 +64,9 @@ func NewAgencyClient(cc grpc.ClientConnInterface) AgencyClient {
return &agencyClient{cc}
}
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error) {
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*MarketLoginReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.MarketLoginReply)
out := new(MarketLoginReply)
err := c.cc.Invoke(ctx, Agency_Login_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -75,9 +74,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) (*protobuf.IdentityStatusReply, error) {
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -85,7 +84,7 @@ func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts .
return out, nil
}
func (c *agencyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
func (c *agencyClient) Get(ctx context.Context, in *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...)
@@ -95,7 +94,7 @@ func (c *agencyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts
return out, nil
}
func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
func (c *agencyClient) Fetch(ctx context.Context, in *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...)
@@ -105,9 +104,9 @@ func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchReques
return out, nil
}
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -115,9 +114,9 @@ func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts .
return out, nil
}
func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -125,9 +124,9 @@ func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, op
return out, nil
}
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_SetPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -135,7 +134,7 @@ func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest,
return out, nil
}
func (c *agencyClient) Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
func (c *agencyClient) Pending(ctx context.Context, in *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...)
@@ -145,9 +144,9 @@ func (c *agencyClient) Pending(ctx context.Context, in *protobuf.MarketFetchRequ
return out, nil
}
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Agency_Approve_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -162,23 +161,23 @@ func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...
// 营销服务 - 代理商
type AgencyServer interface {
// 登录
Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error)
Login(context.Context, *LoginRequest) (*MarketLoginReply, error)
// 新增代理商
Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
Create(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error)
// 获取一个代理商
Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error)
Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
Fetch(context.Context, *MarketFetchRequest) (*AgencyReply, error)
// 更新代理商数据
Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
Modify(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error)
// 删除一个代理商
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
// 更新密码
SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error)
SetPassword(context.Context, *SetPasswordRequest) (*IdentityStatusReply, error)
// 待审核
Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
Pending(context.Context, *MarketFetchRequest) (*AgencyReply, error)
// 审核
Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error)
Approve(context.Context, *ApproveRequest) (*IdentityStatusReply, error)
}
// UnimplementedAgencyServer should be embedded to have
@@ -188,31 +187,31 @@ type AgencyServer interface {
// pointer dereference when methods are called.
type UnimplementedAgencyServer struct{}
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error) {
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*MarketLoginReply, error) {
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAgencyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error) {
func (UnimplementedAgencyServer) Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedAgencyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
func (UnimplementedAgencyServer) Fetch(context.Context, *MarketFetchRequest) (*AgencyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedAgencyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedAgencyServer) Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
}
func (UnimplementedAgencyServer) Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
func (UnimplementedAgencyServer) Pending(context.Context, *MarketFetchRequest) (*AgencyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Pending not implemented")
}
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Approve not implemented")
}
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
@@ -272,7 +271,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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -284,13 +283,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.(*protobuf.IdentRequest))
return srv.(AgencyServer).Get(ctx, req.(*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(protobuf.MarketFetchRequest)
in := new(MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -302,7 +301,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.(*protobuf.MarketFetchRequest))
return srv.(AgencyServer).Fetch(ctx, req.(*MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -326,7 +325,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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -338,7 +337,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.(*protobuf.IdentRequest))
return srv.(AgencyServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -362,7 +361,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(protobuf.MarketFetchRequest)
in := new(MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -374,7 +373,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.(*protobuf.MarketFetchRequest))
return srv.(AgencyServer).Pending(ctx, req.(*MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}

View File

@@ -1,12 +1,3 @@
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
type LoginReply = MarketLoginReply

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -220,7 +219,7 @@ var File_module_ec_market_proto_data_proto protoreflect.FileDescriptor
const file_module_ec_market_proto_data_proto_rawDesc = "" +
"\n" +
"!module/ec/market/proto/data.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\xad\x03\n" +
"!module/ec/market/proto/data.proto\x12\x06market\x1a\"module/ec/market/proto/const.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" +
@@ -262,14 +261,14 @@ func file_module_ec_market_proto_data_proto_rawDescGZIP() []byte {
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
(*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: blocks.Empty
(*MarketFetchRequest)(nil), // 6: blocks.MarketFetchRequest
(*IdentRequest)(nil), // 7: blocks.IdentRequest
}
var file_module_ec_market_proto_data_proto_depIdxs = []int32{
3, // 0: market.OverviewReply.report_month:type_name -> market.OverviewReply.ReportMonthEntry
@@ -297,6 +296,7 @@ func file_module_ec_market_proto_data_proto_init() {
if File_module_ec_market_proto_data_proto != nil {
return
}
file_module_ec_market_proto_const_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{

View File

@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -38,7 +37,7 @@ 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 blocks.Empty
protoReq Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -53,7 +52,7 @@ func request_Data_Overview_0(ctx context.Context, marshaler runtime.Marshaler, c
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 blocks.Empty
protoReq Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -65,7 +64,7 @@ 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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -80,7 +79,7 @@ func request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Marshaler
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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -92,7 +91,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -107,7 +106,7 @@ func request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.Marshal
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -119,7 +118,7 @@ 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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -134,7 +133,7 @@ func request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Marshaler,
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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -146,7 +145,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -161,7 +160,7 @@ func request_Data_OrderDetails_0(ctx context.Context, marshaler runtime.Marshale
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -34,15 +33,15 @@ const (
// 数据服务
type DataClient interface {
// 概况
Overview(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*OverviewReply, error)
Overview(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OverviewReply, error)
// 会员列表
MemberFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
MemberFetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 会员详情
MemberDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
MemberDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
// 订单列表
OrderFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
OrderFetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 订单详情
OrderDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
OrderDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
}
type dataClient struct {
@@ -53,7 +52,7 @@ func NewDataClient(cc grpc.ClientConnInterface) DataClient {
return &dataClient{cc}
}
func (c *dataClient) Overview(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*OverviewReply, error) {
func (c *dataClient) Overview(ctx context.Context, in *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...)
@@ -63,7 +62,7 @@ func (c *dataClient) Overview(ctx context.Context, in *protobuf.Empty, opts ...g
return out, nil
}
func (c *dataClient) MemberFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
func (c *dataClient) MemberFetch(ctx context.Context, in *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...)
@@ -73,7 +72,7 @@ func (c *dataClient) MemberFetch(ctx context.Context, in *protobuf.MarketFetchRe
return out, nil
}
func (c *dataClient) MemberDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
func (c *dataClient) MemberDetails(ctx context.Context, in *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...)
@@ -83,7 +82,7 @@ func (c *dataClient) MemberDetails(ctx context.Context, in *protobuf.IdentReques
return out, nil
}
func (c *dataClient) OrderFetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
func (c *dataClient) OrderFetch(ctx context.Context, in *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...)
@@ -93,7 +92,7 @@ func (c *dataClient) OrderFetch(ctx context.Context, in *protobuf.MarketFetchReq
return out, nil
}
func (c *dataClient) OrderDetails(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
func (c *dataClient) OrderDetails(ctx context.Context, in *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...)
@@ -110,15 +109,15 @@ func (c *dataClient) OrderDetails(ctx context.Context, in *protobuf.IdentRequest
// 数据服务
type DataServer interface {
// 概况
Overview(context.Context, *protobuf.Empty) (*OverviewReply, error)
Overview(context.Context, *Empty) (*OverviewReply, error)
// 会员列表
MemberFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error)
MemberFetch(context.Context, *MarketFetchRequest) (*DataReply, error)
// 会员详情
MemberDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error)
MemberDetails(context.Context, *IdentRequest) (*KeyVal, error)
// 订单列表
OrderFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error)
OrderFetch(context.Context, *MarketFetchRequest) (*DataReply, error)
// 订单详情
OrderDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error)
OrderDetails(context.Context, *IdentRequest) (*KeyVal, error)
}
// UnimplementedDataServer should be embedded to have
@@ -128,19 +127,19 @@ type DataServer interface {
// pointer dereference when methods are called.
type UnimplementedDataServer struct{}
func (UnimplementedDataServer) Overview(context.Context, *protobuf.Empty) (*OverviewReply, error) {
func (UnimplementedDataServer) Overview(context.Context, *Empty) (*OverviewReply, error) {
return nil, status.Error(codes.Unimplemented, "method Overview not implemented")
}
func (UnimplementedDataServer) MemberFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error) {
func (UnimplementedDataServer) MemberFetch(context.Context, *MarketFetchRequest) (*DataReply, error) {
return nil, status.Error(codes.Unimplemented, "method MemberFetch not implemented")
}
func (UnimplementedDataServer) MemberDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error) {
func (UnimplementedDataServer) MemberDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Error(codes.Unimplemented, "method MemberDetails not implemented")
}
func (UnimplementedDataServer) OrderFetch(context.Context, *protobuf.MarketFetchRequest) (*DataReply, error) {
func (UnimplementedDataServer) OrderFetch(context.Context, *MarketFetchRequest) (*DataReply, error) {
return nil, status.Error(codes.Unimplemented, "method OrderFetch not implemented")
}
func (UnimplementedDataServer) OrderDetails(context.Context, *protobuf.IdentRequest) (*KeyVal, error) {
func (UnimplementedDataServer) OrderDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Error(codes.Unimplemented, "method OrderDetails not implemented")
}
func (UnimplementedDataServer) testEmbeddedByValue() {}
@@ -164,7 +163,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(protobuf.Empty)
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
@@ -176,13 +175,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.(*protobuf.Empty))
return srv.(DataServer).Overview(ctx, req.(*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(protobuf.MarketFetchRequest)
in := new(MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -194,13 +193,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.(*protobuf.MarketFetchRequest))
return srv.(DataServer).MemberFetch(ctx, req.(*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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -212,13 +211,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.(*protobuf.IdentRequest))
return srv.(DataServer).MemberDetails(ctx, req.(*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(protobuf.MarketFetchRequest)
in := new(MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -230,13 +229,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.(*protobuf.MarketFetchRequest))
return srv.(DataServer).OrderFetch(ctx, req.(*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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -248,7 +247,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.(*protobuf.IdentRequest))
return srv.(DataServer).OrderDetails(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -234,7 +233,7 @@ var File_module_ec_market_proto_supply_proto protoreflect.FileDescriptor
const file_module_ec_market_proto_supply_proto_rawDesc = "" +
"\n" +
"#module/ec/market/proto/supply.proto\x12\x06market\x1a\x15protobuf/blocks.proto\"\x9e\x03\n" +
"#module/ec/market/proto/supply.proto\x12\x06market\x1a\"module/ec/market/proto/const.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" +
@@ -276,11 +275,11 @@ func file_module_ec_market_proto_supply_proto_rawDescGZIP() []byte {
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
(*MarketSupplyItem)(nil), // 0: market.MarketSupplyItem
(*SupplyReply)(nil), // 1: market.SupplyReply
(*IdentRequest)(nil), // 2: blocks.IdentRequest
(*MarketFetchRequest)(nil), // 3: blocks.MarketFetchRequest
(*IdentityStatusReply)(nil), // 4: blocks.IdentityStatusReply
}
var file_module_ec_market_proto_supply_proto_depIdxs = []int32{
0, // 0: market.SupplyReply.data:type_name -> market.MarketSupplyItem
@@ -306,6 +305,7 @@ func file_module_ec_market_proto_supply_proto_init() {
if File_module_ec_market_proto_supply_proto != nil {
return
}
file_module_ec_market_proto_const_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{

View File

@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
package market
import (
"bsm/full/protobuf"
"context"
"errors"
"io"
@@ -65,7 +64,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -80,7 +79,7 @@ func request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler, clie
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -92,7 +91,7 @@ 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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -107,7 +106,7 @@ func request_Supply_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, cl
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 blocks.MarketFetchRequest
protoReq MarketFetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -146,7 +145,7 @@ 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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
@@ -161,7 +160,7 @@ func request_Supply_Delete_0(ctx context.Context, marshaler runtime.Marshaler, c
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 blocks.IdentRequest
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {

View File

@@ -7,7 +7,6 @@
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -34,15 +33,15 @@ const (
// 营销服务 - 供应商
type SupplyClient interface {
// 新增供应商
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 获取一个供应商
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
// 供应商列表
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
Fetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
// 更新供应商数据
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
// 删除一个供应商
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
}
type supplyClient struct {
@@ -53,9 +52,9 @@ func NewSupplyClient(cc grpc.ClientConnInterface) SupplyClient {
return &supplyClient{cc}
}
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -63,7 +62,7 @@ func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
func (c *supplyClient) Get(ctx context.Context, in *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...)
@@ -73,7 +72,7 @@ func (c *supplyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts
return out, nil
}
func (c *supplyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
func (c *supplyClient) Fetch(ctx context.Context, in *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...)
@@ -83,9 +82,9 @@ func (c *supplyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchReques
return out, nil
}
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -93,9 +92,9 @@ func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
out := new(IdentityStatusReply)
err := c.cc.Invoke(ctx, Supply_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -110,15 +109,15 @@ func (c *supplyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, op
// 营销服务 - 供应商
type SupplyServer interface {
// 新增供应商
Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
Create(context.Context, *MarketSupplyItem) (*IdentityStatusReply, error)
// 获取一个供应商
Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error)
Get(context.Context, *IdentRequest) (*MarketSupplyItem, error)
// 供应商列表
Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error)
Fetch(context.Context, *MarketFetchRequest) (*SupplyReply, error)
// 更新供应商数据
Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
Modify(context.Context, *MarketSupplyItem) (*IdentityStatusReply, error)
// 删除一个供应商
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
}
// UnimplementedSupplyServer should be embedded to have
@@ -128,19 +127,19 @@ type SupplyServer interface {
// pointer dereference when methods are called.
type UnimplementedSupplyServer struct{}
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSupplyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error) {
func (UnimplementedSupplyServer) Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedSupplyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error) {
func (UnimplementedSupplyServer) Fetch(context.Context, *MarketFetchRequest) (*SupplyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedSupplyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
func (UnimplementedSupplyServer) Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
@@ -182,7 +181,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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -194,13 +193,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.(*protobuf.IdentRequest))
return srv.(SupplyServer).Get(ctx, req.(*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(protobuf.MarketFetchRequest)
in := new(MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -212,7 +211,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.(*protobuf.MarketFetchRequest))
return srv.(SupplyServer).Fetch(ctx, req.(*MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -236,7 +235,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(protobuf.IdentRequest)
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -248,7 +247,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.(*protobuf.IdentRequest))
return srv.(SupplyServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}