refactor: add unified all service gateway
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: david.yan(david.yan@qq.com)
|
||||
* @Date: 2021-11-26 15:25:03
|
||||
*/
|
||||
package service
|
||||
package main
|
||||
|
||||
import (
|
||||
"bsm/full/module/ec/market/internal/config"
|
||||
@@ -20,7 +20,7 @@ func Run() {
|
||||
impl.NewImpl()
|
||||
|
||||
// 初始化服务
|
||||
s := server.New(config.Spec.Addr)
|
||||
s := server.New(nil)
|
||||
srv := service.New(
|
||||
s.Grpc,
|
||||
&service.Options{
|
||||
|
||||
@@ -17,10 +17,15 @@ type Server struct {
|
||||
grpcConns map[string]*grpc.ClientConn // 连接池
|
||||
}
|
||||
|
||||
func New(addr string) *Server {
|
||||
func New(grpcServ *grpc.Server) *Server {
|
||||
standalone := grpcServ == nil
|
||||
if standalone {
|
||||
grpcServ = grpc.NewServer()
|
||||
}
|
||||
|
||||
srv := &Server{
|
||||
Ctx: context.Background(),
|
||||
Grpc: grpc.NewServer(),
|
||||
Grpc: grpcServ,
|
||||
grpcConns: make(map[string]*grpc.ClientConn),
|
||||
}
|
||||
|
||||
@@ -29,7 +34,9 @@ func New(addr string) *Server {
|
||||
pb.RegisterDataServer(srv.Grpc, NewDataServer())
|
||||
pb.RegisterSupplyServer(srv.Grpc, NewSupplyServer())
|
||||
|
||||
reflection.Register(srv.Grpc)
|
||||
if standalone {
|
||||
reflection.Register(srv.Grpc)
|
||||
}
|
||||
|
||||
return srv
|
||||
}
|
||||
|
||||
@@ -483,17 +483,17 @@ const file_module_ec_market_proto_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\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"
|
||||
"\bidentity\x18\x02 \x01(\tR\bidentity2\xae\x05\n" +
|
||||
"\x06Agency\x12C\n" +
|
||||
"\x05Login\x12\x14.market.LoginRequest\x1a\".ec_market_blocks.MarketLoginReply\"\x00\x12L\n" +
|
||||
"\x06Create\x12\x19.market.MarketAgenctyItem\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12B\n" +
|
||||
"\x03Get\x12\x1e.ec_market_blocks.IdentRequest\x1a\x19.market.MarketAgenctyItem\"\x00\x12D\n" +
|
||||
"\x05Fetch\x12$.ec_market_blocks.MarketFetchRequest\x1a\x13.market.AgencyReply\"\x00\x12L\n" +
|
||||
"\x06Modify\x12\x19.market.MarketAgenctyItem\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12Q\n" +
|
||||
"\x06Delete\x12\x1e.ec_market_blocks.IdentRequest\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12R\n" +
|
||||
"\vSetPassword\x12\x1a.market.SetPasswordRequest\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12F\n" +
|
||||
"\aPending\x12$.ec_market_blocks.MarketFetchRequest\x1a\x13.market.AgencyReply\"\x00\x12J\n" +
|
||||
"\aApprove\x12\x16.market.ApproveRequest\x1a%.ec_market_blocks.IdentityStatusReply\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
|
||||
|
||||
var (
|
||||
file_module_ec_market_proto_agency_proto_rawDescOnce sync.Once
|
||||
@@ -514,31 +514,31 @@ var file_module_ec_market_proto_agency_proto_goTypes = []any{
|
||||
(*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
|
||||
(*IdentRequest)(nil), // 5: ec_market_blocks.IdentRequest
|
||||
(*MarketFetchRequest)(nil), // 6: ec_market_blocks.MarketFetchRequest
|
||||
(*MarketLoginReply)(nil), // 7: ec_market_blocks.MarketLoginReply
|
||||
(*IdentityStatusReply)(nil), // 8: ec_market_blocks.IdentityStatusReply
|
||||
}
|
||||
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 -> blocks.IdentRequest
|
||||
6, // 4: market.Agency.Fetch:input_type -> blocks.MarketFetchRequest
|
||||
5, // 3: market.Agency.Get:input_type -> ec_market_blocks.IdentRequest
|
||||
6, // 4: market.Agency.Fetch:input_type -> ec_market_blocks.MarketFetchRequest
|
||||
1, // 5: market.Agency.Modify:input_type -> market.MarketAgenctyItem
|
||||
5, // 6: market.Agency.Delete:input_type -> blocks.IdentRequest
|
||||
5, // 6: market.Agency.Delete:input_type -> ec_market_blocks.IdentRequest
|
||||
2, // 7: market.Agency.SetPassword:input_type -> market.SetPasswordRequest
|
||||
6, // 8: market.Agency.Pending:input_type -> blocks.MarketFetchRequest
|
||||
6, // 8: market.Agency.Pending:input_type -> ec_market_blocks.MarketFetchRequest
|
||||
4, // 9: market.Agency.Approve:input_type -> market.ApproveRequest
|
||||
7, // 10: market.Agency.Login:output_type -> blocks.MarketLoginReply
|
||||
8, // 11: market.Agency.Create:output_type -> blocks.IdentityStatusReply
|
||||
7, // 10: market.Agency.Login:output_type -> ec_market_blocks.MarketLoginReply
|
||||
8, // 11: market.Agency.Create:output_type -> ec_market_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 -> blocks.IdentityStatusReply
|
||||
8, // 15: market.Agency.Delete:output_type -> blocks.IdentityStatusReply
|
||||
8, // 16: market.Agency.SetPassword:output_type -> blocks.IdentityStatusReply
|
||||
8, // 14: market.Agency.Modify:output_type -> ec_market_blocks.IdentityStatusReply
|
||||
8, // 15: market.Agency.Delete:output_type -> ec_market_blocks.IdentityStatusReply
|
||||
8, // 16: market.Agency.SetPassword:output_type -> ec_market_blocks.IdentityStatusReply
|
||||
3, // 17: market.Agency.Pending:output_type -> market.AgencyReply
|
||||
8, // 18: market.Agency.Approve:output_type -> blocks.IdentityStatusReply
|
||||
8, // 18: market.Agency.Approve:output_type -> ec_market_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
|
||||
|
||||
@@ -2975,12 +2975,12 @@ var File_module_ec_market_proto_const_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\"module/ec/market/proto/const.proto\x12\x06blocks\"\a\n" +
|
||||
"\x05Empty\"\xbb\x01\n" +
|
||||
"\"module/ec/market/proto/const.proto\x12\x10ec_market_blocks\"\a\n" +
|
||||
"\x05Empty\"\xc5\x01\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 .blocks.FetchRequest.ParamsEntryR\x06params\x1a9\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x12B\n" +
|
||||
"\x06params\x18\x03 \x03(\v2*.ec_market_blocks.FetchRequest.ParamsEntryR\x06params\x1a9\n" +
|
||||
"\vParamsEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\":\n" +
|
||||
@@ -2999,11 +2999,11 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\x10CmsSearchRequest\x12\x18\n" +
|
||||
"\akeyword\x18\x01 \x01(\tR\akeyword\x12\x18\n" +
|
||||
"\apage_no\x18\x02 \x01(\x03R\apage_no\x12\x1c\n" +
|
||||
"\tpage_size\x18\x03 \x01(\x03R\tpage_size\"\xf6\x02\n" +
|
||||
"\tpage_size\x18\x03 \x01(\x03R\tpage_size\"\x80\x03\n" +
|
||||
"\x10MallFetchRequest\x12\x18\n" +
|
||||
"\apage_no\x18\x01 \x01(\x03R\apage_no\x12\x1c\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x12<\n" +
|
||||
"\x06params\x18\x03 \x03(\v2$.blocks.MallFetchRequest.ParamsEntryR\x06params\x12&\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x12F\n" +
|
||||
"\x06params\x18\x03 \x03(\v2..ec_market_blocks.MallFetchRequest.ParamsEntryR\x06params\x12&\n" +
|
||||
"\x0estore_identity\x18\x04 \x01(\tR\x0estore_identity\x12\x18\n" +
|
||||
"\akeyword\x18\x05 \x01(\tR\akeyword\x12\x1f\n" +
|
||||
"\vcategory_id\x18\x06 \x03(\x03R\n" +
|
||||
@@ -3013,11 +3013,11 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\tmax_price\x18\t \x01(\x03R\tmax_price\x1a9\n" +
|
||||
"\vParamsEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x02\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb9\x02\n" +
|
||||
"\x12MarketFetchRequest\x12\x18\n" +
|
||||
"\apage_no\x18\x01 \x01(\x03R\apage_no\x12\x1c\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x12>\n" +
|
||||
"\x06params\x18\x03 \x03(\v2&.blocks.MarketFetchRequest.ParamsEntryR\x06params\x12\x1a\n" +
|
||||
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x12H\n" +
|
||||
"\x06params\x18\x03 \x03(\v20.ec_market_blocks.MarketFetchRequest.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" +
|
||||
@@ -3072,7 +3072,7 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\x11passport_identity\x18\x02 \x01(\tR\x10passportIdentity\"M\n" +
|
||||
"\tCloudBase\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\"\xe0\x02\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\"\xea\x02\n" +
|
||||
"\x0fCmsCategoryItem\x12$\n" +
|
||||
"\rsite_identity\x18\x01 \x01(\tR\rsite_identity\x12\x0e\n" +
|
||||
"\x02id\x18\x02 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
@@ -3088,9 +3088,9 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"created_at\x12\x1e\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\t \x01(\tR\n" +
|
||||
"updated_at\x12-\n" +
|
||||
"updated_at\x127\n" +
|
||||
"\x05child\x18\n" +
|
||||
" \x03(\v2\x17.blocks.CmsCategoryItemR\x05child\x12\"\n" +
|
||||
" \x03(\v2!.ec_market_blocks.CmsCategoryItemR\x05child\x12\"\n" +
|
||||
"\fcategory_key\x18\v \x01(\tR\fcategory_key\"\xa5\x01\n" +
|
||||
"\vCmsTagsItem\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
@@ -3129,7 +3129,7 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"created_at\x18\b \x01(\tR\n" +
|
||||
"created_at\x12 \n" +
|
||||
"\vmarket_name\x18\t \x01(\tR\vmarket_name\"\xcc\t\n" +
|
||||
"\vmarket_name\x18\t \x01(\tR\vmarket_name\"\xd6\t\n" +
|
||||
"\x10OrderSummaryItem\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
"\border_no\x18\x02 \x01(\tR\border_no\x12\x1e\n" +
|
||||
@@ -3165,8 +3165,8 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"pay_remark\x18\x1e \x01(\tR\n" +
|
||||
"pay_remark\x12\x18\n" +
|
||||
"\acreated\x18\x1f \x01(\tR\acreated\x12\x18\n" +
|
||||
"\aupdated\x18 \x01(\tR\aupdated\x12.\n" +
|
||||
"\adetails\x18! \x03(\v2\x14.blocks.OrderDetailsR\adetails\x12\x12\n" +
|
||||
"\aupdated\x18 \x01(\tR\aupdated\x128\n" +
|
||||
"\adetails\x18! \x03(\v2\x1e.ec_market_blocks.OrderDetailsR\adetails\x12\x12\n" +
|
||||
"\x04addr\x18\" \x01(\tR\x04addr\x12\"\n" +
|
||||
"\fcar_identity\x18# \x01(\tR\fcar_identity\x12*\n" +
|
||||
"\x10delivery_address\x18$ \x01(\tR\x10delivery_address\x12\x14\n" +
|
||||
@@ -3196,10 +3196,10 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\aspec_id\x18\f \x01(\x03R\aspec_id\x12*\n" +
|
||||
"\x10product_identity\x18\r \x01(\tR\x10product_identity\x12\x1c\n" +
|
||||
"\tgas_types\x18\x0e \x01(\x03R\tgas_types\x12 \n" +
|
||||
"\vtotal_price\x18\x0f \x01(\x03R\vtotal_price\"O\n" +
|
||||
"\x11FeedPostListReply\x12(\n" +
|
||||
"\x04list\x18\x01 \x03(\v2\x14.blocks.FeedPostItemR\x04list\x12\x10\n" +
|
||||
"\x03cnt\x18\x02 \x01(\x03R\x03cnt\"\xd1\x02\n" +
|
||||
"\vtotal_price\x18\x0f \x01(\x03R\vtotal_price\"Y\n" +
|
||||
"\x11FeedPostListReply\x122\n" +
|
||||
"\x04list\x18\x01 \x03(\v2\x1e.ec_market_blocks.FeedPostItemR\x04list\x12\x10\n" +
|
||||
"\x03cnt\x18\x02 \x01(\x03R\x03cnt\"\xe5\x02\n" +
|
||||
"\fFeedPostItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x18\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\x12\x17\n" +
|
||||
@@ -3210,10 +3210,10 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"cnt_unlike\x18\x06 \x01(\x03R\tcntUnlike\x12\x1f\n" +
|
||||
"\vcnt_comment\x18\a \x01(\x03R\n" +
|
||||
"cntComment\x12\x19\n" +
|
||||
"\bcnt_like\x18\b \x01(\x03R\acntLike\x120\n" +
|
||||
"\aattachs\x18\t \x03(\v2\x16.blocks.FeedAttachItemR\aattachs\x12'\n" +
|
||||
"\bcnt_like\x18\b \x01(\x03R\acntLike\x12:\n" +
|
||||
"\aattachs\x18\t \x03(\v2 .ec_market_blocks.FeedAttachItemR\aattachs\x121\n" +
|
||||
"\x04tags\x18\n" +
|
||||
" \x03(\v2\x13.blocks.FeedTagItemR\x04tags\"_\n" +
|
||||
" \x03(\v2\x1d.ec_market_blocks.FeedTagItemR\x04tags\"_\n" +
|
||||
"\x0eFeedAttachItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x1f\n" +
|
||||
"\vattach_type\x18\x02 \x01(\tR\n" +
|
||||
@@ -3221,10 +3221,10 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"\x03url\x18\x03 \x01(\tR\x03url\"9\n" +
|
||||
"\vFeedTagItem\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x18\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\"Q\n" +
|
||||
"\x12GroupPostListReply\x12)\n" +
|
||||
"\x04list\x18\x01 \x03(\v2\x15.blocks.GroupPostItemR\x04list\x12\x10\n" +
|
||||
"\x03cnt\x18\x02 \x01(\x03R\x03cnt\"\xe4\x02\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\"[\n" +
|
||||
"\x12GroupPostListReply\x123\n" +
|
||||
"\x04list\x18\x01 \x03(\v2\x1f.ec_market_blocks.GroupPostItemR\x04list\x12\x10\n" +
|
||||
"\x03cnt\x18\x02 \x01(\x03R\x03cnt\"\xf8\x02\n" +
|
||||
"\rGroupPostItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x18\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\x12\x1f\n" +
|
||||
@@ -3236,10 +3236,10 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
"cnt_unlike\x18\x06 \x01(\x03R\tcntUnlike\x12\x1f\n" +
|
||||
"\vcnt_comment\x18\a \x01(\x03R\n" +
|
||||
"cntComment\x12\x19\n" +
|
||||
"\bcnt_like\x18\b \x01(\x03R\acntLike\x121\n" +
|
||||
"\aattachs\x18\t \x03(\v2\x17.blocks.GroupAttachItemR\aattachs\x12(\n" +
|
||||
"\bcnt_like\x18\b \x01(\x03R\acntLike\x12;\n" +
|
||||
"\aattachs\x18\t \x03(\v2!.ec_market_blocks.GroupAttachItemR\aattachs\x122\n" +
|
||||
"\x04tags\x18\n" +
|
||||
" \x03(\v2\x14.blocks.GroupTagItemR\x04tags\"`\n" +
|
||||
" \x03(\v2\x1e.ec_market_blocks.GroupTagItemR\x04tags\"`\n" +
|
||||
"\x0fGroupAttachItem\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x1f\n" +
|
||||
"\vattach_type\x18\x02 \x01(\tR\n" +
|
||||
@@ -3263,10 +3263,10 @@ const file_module_ec_market_proto_const_proto_rawDesc = "" +
|
||||
" \x01(\x05R\x04area\x12\x12\n" +
|
||||
"\x04sign\x18\v \x01(\tR\x04sign\x12\x12\n" +
|
||||
"\x04tags\x18\f \x03(\tR\x04tags\x12%\n" +
|
||||
"\x0eforeign_status\x18\r \x01(\x05R\rforeignStatus\"X\n" +
|
||||
"\x0eforeign_status\x18\r \x01(\x05R\rforeignStatus\"b\n" +
|
||||
"\x16FetchRelationItemReply\x12\x14\n" +
|
||||
"\x05total\x18\x01 \x01(\x03R\x05total\x12(\n" +
|
||||
"\x04data\x18\x02 \x03(\v2\x14.blocks.RelationItemR\x04dataB%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
|
||||
"\x05total\x18\x01 \x01(\x03R\x05total\x122\n" +
|
||||
"\x04data\x18\x02 \x03(\v2\x1e.ec_market_blocks.RelationItemR\x04dataB%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
|
||||
|
||||
var (
|
||||
file_module_ec_market_proto_const_proto_rawDescOnce sync.Once
|
||||
@@ -3282,60 +3282,60 @@ func file_module_ec_market_proto_const_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_ec_market_proto_const_proto_msgTypes = make([]protoimpl.MessageInfo, 40)
|
||||
var file_module_ec_market_proto_const_proto_goTypes = []any{
|
||||
(*Empty)(nil), // 0: blocks.Empty
|
||||
(*FetchRequest)(nil), // 1: blocks.FetchRequest
|
||||
(*IdentRequest)(nil), // 2: blocks.IdentRequest
|
||||
(*VersionRequest)(nil), // 3: blocks.VersionRequest
|
||||
(*SearchRequest)(nil), // 4: blocks.SearchRequest
|
||||
(*StatusReply)(nil), // 5: blocks.StatusReply
|
||||
(*CmsSearchRequest)(nil), // 6: blocks.CmsSearchRequest
|
||||
(*MallFetchRequest)(nil), // 7: blocks.MallFetchRequest
|
||||
(*MarketFetchRequest)(nil), // 8: blocks.MarketFetchRequest
|
||||
(*OrderIdentRequest)(nil), // 9: blocks.OrderIdentRequest
|
||||
(*DeliveryStatusReply)(nil), // 10: blocks.DeliveryStatusReply
|
||||
(*IdentityStatusReply)(nil), // 11: blocks.IdentityStatusReply
|
||||
(*OrderStatusReply)(nil), // 12: blocks.OrderStatusReply
|
||||
(*DataStatusReply)(nil), // 13: blocks.DataStatusReply
|
||||
(*StoreSerialRequest)(nil), // 14: blocks.StoreSerialRequest
|
||||
(*IDRequest)(nil), // 15: blocks.IDRequest
|
||||
(*IDListRequest)(nil), // 16: blocks.IDListRequest
|
||||
(*StdIicuds)(nil), // 17: blocks.StdIicuds
|
||||
(*StdPassport)(nil), // 18: blocks.StdPassport
|
||||
(*CloudBase)(nil), // 19: blocks.CloudBase
|
||||
(*CmsCategoryItem)(nil), // 20: blocks.CmsCategoryItem
|
||||
(*CmsTagsItem)(nil), // 21: blocks.CmsTagsItem
|
||||
(*CmsAccessoryItem)(nil), // 22: blocks.CmsAccessoryItem
|
||||
(*VerifyStatus)(nil), // 23: blocks.VerifyStatus
|
||||
(*MarketLoginReply)(nil), // 24: blocks.MarketLoginReply
|
||||
(*OrderSummaryItem)(nil), // 25: blocks.OrderSummaryItem
|
||||
(*OrderDetails)(nil), // 26: blocks.OrderDetails
|
||||
(*FeedPostListReply)(nil), // 27: blocks.FeedPostListReply
|
||||
(*FeedPostItem)(nil), // 28: blocks.FeedPostItem
|
||||
(*FeedAttachItem)(nil), // 29: blocks.FeedAttachItem
|
||||
(*FeedTagItem)(nil), // 30: blocks.FeedTagItem
|
||||
(*GroupPostListReply)(nil), // 31: blocks.GroupPostListReply
|
||||
(*GroupPostItem)(nil), // 32: blocks.GroupPostItem
|
||||
(*GroupAttachItem)(nil), // 33: blocks.GroupAttachItem
|
||||
(*GroupTagItem)(nil), // 34: blocks.GroupTagItem
|
||||
(*RelationItem)(nil), // 35: blocks.RelationItem
|
||||
(*FetchRelationItemReply)(nil), // 36: blocks.FetchRelationItemReply
|
||||
nil, // 37: blocks.FetchRequest.ParamsEntry
|
||||
nil, // 38: blocks.MallFetchRequest.ParamsEntry
|
||||
nil, // 39: blocks.MarketFetchRequest.ParamsEntry
|
||||
(*Empty)(nil), // 0: ec_market_blocks.Empty
|
||||
(*FetchRequest)(nil), // 1: ec_market_blocks.FetchRequest
|
||||
(*IdentRequest)(nil), // 2: ec_market_blocks.IdentRequest
|
||||
(*VersionRequest)(nil), // 3: ec_market_blocks.VersionRequest
|
||||
(*SearchRequest)(nil), // 4: ec_market_blocks.SearchRequest
|
||||
(*StatusReply)(nil), // 5: ec_market_blocks.StatusReply
|
||||
(*CmsSearchRequest)(nil), // 6: ec_market_blocks.CmsSearchRequest
|
||||
(*MallFetchRequest)(nil), // 7: ec_market_blocks.MallFetchRequest
|
||||
(*MarketFetchRequest)(nil), // 8: ec_market_blocks.MarketFetchRequest
|
||||
(*OrderIdentRequest)(nil), // 9: ec_market_blocks.OrderIdentRequest
|
||||
(*DeliveryStatusReply)(nil), // 10: ec_market_blocks.DeliveryStatusReply
|
||||
(*IdentityStatusReply)(nil), // 11: ec_market_blocks.IdentityStatusReply
|
||||
(*OrderStatusReply)(nil), // 12: ec_market_blocks.OrderStatusReply
|
||||
(*DataStatusReply)(nil), // 13: ec_market_blocks.DataStatusReply
|
||||
(*StoreSerialRequest)(nil), // 14: ec_market_blocks.StoreSerialRequest
|
||||
(*IDRequest)(nil), // 15: ec_market_blocks.IDRequest
|
||||
(*IDListRequest)(nil), // 16: ec_market_blocks.IDListRequest
|
||||
(*StdIicuds)(nil), // 17: ec_market_blocks.StdIicuds
|
||||
(*StdPassport)(nil), // 18: ec_market_blocks.StdPassport
|
||||
(*CloudBase)(nil), // 19: ec_market_blocks.CloudBase
|
||||
(*CmsCategoryItem)(nil), // 20: ec_market_blocks.CmsCategoryItem
|
||||
(*CmsTagsItem)(nil), // 21: ec_market_blocks.CmsTagsItem
|
||||
(*CmsAccessoryItem)(nil), // 22: ec_market_blocks.CmsAccessoryItem
|
||||
(*VerifyStatus)(nil), // 23: ec_market_blocks.VerifyStatus
|
||||
(*MarketLoginReply)(nil), // 24: ec_market_blocks.MarketLoginReply
|
||||
(*OrderSummaryItem)(nil), // 25: ec_market_blocks.OrderSummaryItem
|
||||
(*OrderDetails)(nil), // 26: ec_market_blocks.OrderDetails
|
||||
(*FeedPostListReply)(nil), // 27: ec_market_blocks.FeedPostListReply
|
||||
(*FeedPostItem)(nil), // 28: ec_market_blocks.FeedPostItem
|
||||
(*FeedAttachItem)(nil), // 29: ec_market_blocks.FeedAttachItem
|
||||
(*FeedTagItem)(nil), // 30: ec_market_blocks.FeedTagItem
|
||||
(*GroupPostListReply)(nil), // 31: ec_market_blocks.GroupPostListReply
|
||||
(*GroupPostItem)(nil), // 32: ec_market_blocks.GroupPostItem
|
||||
(*GroupAttachItem)(nil), // 33: ec_market_blocks.GroupAttachItem
|
||||
(*GroupTagItem)(nil), // 34: ec_market_blocks.GroupTagItem
|
||||
(*RelationItem)(nil), // 35: ec_market_blocks.RelationItem
|
||||
(*FetchRelationItemReply)(nil), // 36: ec_market_blocks.FetchRelationItemReply
|
||||
nil, // 37: ec_market_blocks.FetchRequest.ParamsEntry
|
||||
nil, // 38: ec_market_blocks.MallFetchRequest.ParamsEntry
|
||||
nil, // 39: ec_market_blocks.MarketFetchRequest.ParamsEntry
|
||||
}
|
||||
var file_module_ec_market_proto_const_proto_depIdxs = []int32{
|
||||
37, // 0: blocks.FetchRequest.params:type_name -> blocks.FetchRequest.ParamsEntry
|
||||
38, // 1: blocks.MallFetchRequest.params:type_name -> blocks.MallFetchRequest.ParamsEntry
|
||||
39, // 2: blocks.MarketFetchRequest.params:type_name -> blocks.MarketFetchRequest.ParamsEntry
|
||||
20, // 3: blocks.CmsCategoryItem.child:type_name -> blocks.CmsCategoryItem
|
||||
26, // 4: blocks.OrderSummaryItem.details:type_name -> blocks.OrderDetails
|
||||
28, // 5: blocks.FeedPostListReply.list:type_name -> blocks.FeedPostItem
|
||||
29, // 6: blocks.FeedPostItem.attachs:type_name -> blocks.FeedAttachItem
|
||||
30, // 7: blocks.FeedPostItem.tags:type_name -> blocks.FeedTagItem
|
||||
32, // 8: blocks.GroupPostListReply.list:type_name -> blocks.GroupPostItem
|
||||
33, // 9: blocks.GroupPostItem.attachs:type_name -> blocks.GroupAttachItem
|
||||
34, // 10: blocks.GroupPostItem.tags:type_name -> blocks.GroupTagItem
|
||||
35, // 11: blocks.FetchRelationItemReply.data:type_name -> blocks.RelationItem
|
||||
37, // 0: ec_market_blocks.FetchRequest.params:type_name -> ec_market_blocks.FetchRequest.ParamsEntry
|
||||
38, // 1: ec_market_blocks.MallFetchRequest.params:type_name -> ec_market_blocks.MallFetchRequest.ParamsEntry
|
||||
39, // 2: ec_market_blocks.MarketFetchRequest.params:type_name -> ec_market_blocks.MarketFetchRequest.ParamsEntry
|
||||
20, // 3: ec_market_blocks.CmsCategoryItem.child:type_name -> ec_market_blocks.CmsCategoryItem
|
||||
26, // 4: ec_market_blocks.OrderSummaryItem.details:type_name -> ec_market_blocks.OrderDetails
|
||||
28, // 5: ec_market_blocks.FeedPostListReply.list:type_name -> ec_market_blocks.FeedPostItem
|
||||
29, // 6: ec_market_blocks.FeedPostItem.attachs:type_name -> ec_market_blocks.FeedAttachItem
|
||||
30, // 7: ec_market_blocks.FeedPostItem.tags:type_name -> ec_market_blocks.FeedTagItem
|
||||
32, // 8: ec_market_blocks.GroupPostListReply.list:type_name -> ec_market_blocks.GroupPostItem
|
||||
33, // 9: ec_market_blocks.GroupPostItem.attachs:type_name -> ec_market_blocks.GroupAttachItem
|
||||
34, // 10: ec_market_blocks.GroupPostItem.tags:type_name -> ec_market_blocks.GroupTagItem
|
||||
35, // 11: ec_market_blocks.FetchRelationItemReply.data:type_name -> ec_market_blocks.RelationItem
|
||||
12, // [12:12] is the sub-list for method output_type
|
||||
12, // [12:12] is the sub-list for method input_type
|
||||
12, // [12:12] is the sub-list for extension type_name
|
||||
|
||||
@@ -238,14 +238,14 @@ const file_module_ec_market_proto_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\xaa\x02\n" +
|
||||
"\x04Data\x122\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" +
|
||||
"\x03val\x18\x02 \x01(\tR\x03val2\xdc\x02\n" +
|
||||
"\x04Data\x12<\n" +
|
||||
"\bOverview\x12\x17.ec_market_blocks.Empty\x1a\x15.market.OverviewReply\"\x00\x12H\n" +
|
||||
"\vMemberFetch\x12$.ec_market_blocks.MarketFetchRequest\x1a\x11.market.DataReply\"\x00\x12A\n" +
|
||||
"\rMemberDetails\x12\x1e.ec_market_blocks.IdentRequest\x1a\x0e.market.KeyVal\"\x00\x12G\n" +
|
||||
"\n" +
|
||||
"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"
|
||||
"OrderFetch\x12$.ec_market_blocks.MarketFetchRequest\x1a\x11.market.DataReply\"\x00\x12@\n" +
|
||||
"\fOrderDetails\x12\x1e.ec_market_blocks.IdentRequest\x1a\x0e.market.KeyVal\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
|
||||
|
||||
var (
|
||||
file_module_ec_market_proto_data_proto_rawDescOnce sync.Once
|
||||
@@ -266,19 +266,19 @@ var file_module_ec_market_proto_data_proto_goTypes = []any{
|
||||
(*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
|
||||
(*Empty)(nil), // 5: ec_market_blocks.Empty
|
||||
(*MarketFetchRequest)(nil), // 6: ec_market_blocks.MarketFetchRequest
|
||||
(*IdentRequest)(nil), // 7: ec_market_blocks.IdentRequest
|
||||
}
|
||||
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 -> 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
|
||||
5, // 3: market.Data.Overview:input_type -> ec_market_blocks.Empty
|
||||
6, // 4: market.Data.MemberFetch:input_type -> ec_market_blocks.MarketFetchRequest
|
||||
7, // 5: market.Data.MemberDetails:input_type -> ec_market_blocks.IdentRequest
|
||||
6, // 6: market.Data.OrderFetch:input_type -> ec_market_blocks.MarketFetchRequest
|
||||
7, // 7: market.Data.OrderDetails:input_type -> ec_market_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
|
||||
|
||||
@@ -253,13 +253,13 @@ const file_module_ec_market_proto_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\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"
|
||||
"\x04data\x18\x02 \x03(\v2\x18.market.MarketSupplyItemR\x04data2\xfe\x02\n" +
|
||||
"\x06Supply\x12K\n" +
|
||||
"\x06Create\x12\x18.market.MarketSupplyItem\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12A\n" +
|
||||
"\x03Get\x12\x1e.ec_market_blocks.IdentRequest\x1a\x18.market.MarketSupplyItem\"\x00\x12D\n" +
|
||||
"\x05Fetch\x12$.ec_market_blocks.MarketFetchRequest\x1a\x13.market.SupplyReply\"\x00\x12K\n" +
|
||||
"\x06Modify\x12\x18.market.MarketSupplyItem\x1a%.ec_market_blocks.IdentityStatusReply\"\x00\x12Q\n" +
|
||||
"\x06Delete\x12\x1e.ec_market_blocks.IdentRequest\x1a%.ec_market_blocks.IdentityStatusReply\"\x00B%Z#bsm/full/module/ec/market/pb;marketb\x06proto3"
|
||||
|
||||
var (
|
||||
file_module_ec_market_proto_supply_proto_rawDescOnce sync.Once
|
||||
@@ -277,22 +277,22 @@ var file_module_ec_market_proto_supply_proto_msgTypes = make([]protoimpl.Message
|
||||
var file_module_ec_market_proto_supply_proto_goTypes = []any{
|
||||
(*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
|
||||
(*IdentRequest)(nil), // 2: ec_market_blocks.IdentRequest
|
||||
(*MarketFetchRequest)(nil), // 3: ec_market_blocks.MarketFetchRequest
|
||||
(*IdentityStatusReply)(nil), // 4: ec_market_blocks.IdentityStatusReply
|
||||
}
|
||||
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 -> blocks.IdentRequest
|
||||
3, // 3: market.Supply.Fetch:input_type -> blocks.MarketFetchRequest
|
||||
2, // 2: market.Supply.Get:input_type -> ec_market_blocks.IdentRequest
|
||||
3, // 3: market.Supply.Fetch:input_type -> ec_market_blocks.MarketFetchRequest
|
||||
0, // 4: market.Supply.Modify:input_type -> market.MarketSupplyItem
|
||||
2, // 5: market.Supply.Delete:input_type -> blocks.IdentRequest
|
||||
4, // 6: market.Supply.Create:output_type -> blocks.IdentityStatusReply
|
||||
2, // 5: market.Supply.Delete:input_type -> ec_market_blocks.IdentRequest
|
||||
4, // 6: market.Supply.Create:output_type -> ec_market_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 -> blocks.IdentityStatusReply
|
||||
4, // 10: market.Supply.Delete:output_type -> blocks.IdentityStatusReply
|
||||
4, // 9: market.Supply.Modify:output_type -> ec_market_blocks.IdentityStatusReply
|
||||
4, // 10: market.Supply.Delete:output_type -> ec_market_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
|
||||
|
||||
@@ -6,31 +6,31 @@ import "module/ec/market/proto/const.proto";
|
||||
// 营销服务 - 代理商
|
||||
service Agency{
|
||||
// 登录
|
||||
rpc Login(LoginRequest) returns (blocks.MarketLoginReply) {}
|
||||
rpc Login(LoginRequest) returns (ec_market_blocks.MarketLoginReply) {}
|
||||
|
||||
// 新增代理商
|
||||
rpc Create(MarketAgenctyItem) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Create(MarketAgenctyItem) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
// 获取一个代理商
|
||||
rpc Get(blocks.IdentRequest) returns (MarketAgenctyItem) {}
|
||||
rpc Get(ec_market_blocks.IdentRequest) returns (MarketAgenctyItem) {}
|
||||
|
||||
// 代理商列表
|
||||
rpc Fetch(blocks.MarketFetchRequest) returns (AgencyReply) {}
|
||||
rpc Fetch(ec_market_blocks.MarketFetchRequest) returns (AgencyReply) {}
|
||||
|
||||
// 更新代理商数据
|
||||
rpc Modify(MarketAgenctyItem) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Modify(MarketAgenctyItem) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
// 删除一个代理商
|
||||
rpc Delete(blocks.IdentRequest) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Delete(ec_market_blocks.IdentRequest) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
// 更新密码
|
||||
rpc SetPassword(SetPasswordRequest) returns (blocks.IdentityStatusReply) {}
|
||||
rpc SetPassword(SetPasswordRequest) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
//待审核
|
||||
rpc Pending(blocks.MarketFetchRequest) returns (AgencyReply) {}
|
||||
rpc Pending(ec_market_blocks.MarketFetchRequest) returns (AgencyReply) {}
|
||||
|
||||
// 审核
|
||||
rpc Approve(ApproveRequest) returns (blocks.IdentityStatusReply) {};
|
||||
rpc Approve(ApproveRequest) returns (ec_market_blocks.IdentityStatusReply) {};
|
||||
|
||||
}
|
||||
|
||||
@@ -80,4 +80,4 @@ message AgencyReply {
|
||||
message ApproveRequest {
|
||||
int32 approve = 1; // 1:通过 2:拒绝
|
||||
string identity = 2; // 唯一标识
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package blocks;
|
||||
package ec_market_blocks;
|
||||
|
||||
option go_package = "bsm/full/module/ec/market/pb;market";
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@ import "module/ec/market/proto/const.proto";
|
||||
// 数据服务
|
||||
service Data{
|
||||
// 概况
|
||||
rpc Overview(blocks.Empty) returns (OverviewReply) {}
|
||||
rpc Overview(ec_market_blocks.Empty) returns (OverviewReply) {}
|
||||
|
||||
// 会员列表
|
||||
rpc MemberFetch(blocks.MarketFetchRequest) returns (DataReply) {}
|
||||
rpc MemberFetch(ec_market_blocks.MarketFetchRequest) returns (DataReply) {}
|
||||
|
||||
// 会员详情
|
||||
rpc MemberDetails(blocks.IdentRequest) returns (KeyVal) {}
|
||||
rpc MemberDetails(ec_market_blocks.IdentRequest) returns (KeyVal) {}
|
||||
|
||||
// 订单列表
|
||||
rpc OrderFetch(blocks.MarketFetchRequest) returns (DataReply) {}
|
||||
rpc OrderFetch(ec_market_blocks.MarketFetchRequest) returns (DataReply) {}
|
||||
|
||||
// 订单详情
|
||||
rpc OrderDetails(blocks.IdentRequest) returns (KeyVal) {}
|
||||
rpc OrderDetails(ec_market_blocks.IdentRequest) returns (KeyVal) {}
|
||||
}
|
||||
|
||||
message OverviewReply {
|
||||
@@ -46,4 +46,4 @@ message DataReply {
|
||||
message KeyVal {
|
||||
string key=1;
|
||||
string val=2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@ import "module/ec/market/proto/const.proto";
|
||||
service Supply{
|
||||
|
||||
// 新增供应商
|
||||
rpc Create(MarketSupplyItem) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Create(MarketSupplyItem) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
// 获取一个供应商
|
||||
rpc Get(blocks.IdentRequest) returns (MarketSupplyItem) {}
|
||||
rpc Get(ec_market_blocks.IdentRequest) returns (MarketSupplyItem) {}
|
||||
|
||||
// 供应商列表
|
||||
rpc Fetch(blocks.MarketFetchRequest) returns (SupplyReply) {}
|
||||
rpc Fetch(ec_market_blocks.MarketFetchRequest) returns (SupplyReply) {}
|
||||
|
||||
// 更新供应商数据
|
||||
rpc Modify(MarketSupplyItem) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Modify(MarketSupplyItem) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
// 删除一个供应商
|
||||
rpc Delete(blocks.IdentRequest) returns (blocks.IdentityStatusReply) {}
|
||||
rpc Delete(ec_market_blocks.IdentRequest) returns (ec_market_blocks.IdentityStatusReply) {}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,4 +49,4 @@ message MarketSupplyItem {
|
||||
message SupplyReply {
|
||||
int64 count = 1;// 总数
|
||||
repeated MarketSupplyItem data = 2;// 数据
|
||||
}
|
||||
}
|
||||
|
||||
31
module/ec/market/service/expose.go
Normal file
31
module/ec/market/service/expose.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/ec/market/internal/server"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type ExposeOptions struct {
|
||||
GRPC *grpc.Server
|
||||
Gateway *gwRuntime.ServeMux
|
||||
}
|
||||
|
||||
func Expose(options ExposeOptions) error {
|
||||
server.New(options.GRPC)
|
||||
|
||||
ctx := context.Background()
|
||||
if err := pb.RegisterAgencyHandlerServer(ctx, options.Gateway, server.NewAgencyServer()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := pb.RegisterDataHandlerServer(ctx, options.Gateway, server.NewDataServer()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := pb.RegisterSupplyHandlerServer(ctx, options.Gateway, server.NewSupplyServer()); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user