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

@@ -10,7 +10,7 @@ import (
)
// 审核
func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.StatusReply, err error) {
func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.IdentityStatusReply, err error) {
var data *models.MarketAgency
if in.GetIdentity() == "" {
return nil, errcode.ErrInvalidArgument
@@ -35,7 +35,7 @@ func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.StatusReply,
}
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: data.Identity,

View File

@@ -13,7 +13,7 @@ import (
)
// 新增代理商
func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusReply, err error) {
func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.IdentityStatusReply, err error) {
// _, err = service.ParseMetaCtx(ctx, nil)
// if err != nil {
// return nil, err
@@ -49,7 +49,7 @@ func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusRepl
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: mktModel.Identity,

View File

@@ -11,7 +11,7 @@ import (
)
// 删除一个代理商
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.IdentityStatusReply, err error) {
// parse authorization meta.
// _, err = service.ParseMetaCtx(ctx, nil)
// if err != nil {
@@ -26,7 +26,7 @@ func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, er
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: in.GetIdentity(),

View File

@@ -11,7 +11,7 @@ import (
)
// 代理商列表
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.AgencyReply, err error) {
func Fetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.AgencyReply, err error) {
var (
cnt int64 = 0
Offset int64 = (in.GetPageNo() - 1) * in.GetPageSize()

View File

@@ -11,7 +11,7 @@ import (
)
// 更新代理商数据
func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusReply, err error) {
func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.IdentityStatusReply, err error) {
var (
identity string
)
@@ -45,7 +45,7 @@ func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusRepl
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: mktModel.Identity,

View File

@@ -11,7 +11,7 @@ import (
)
// 待审核
func Pending(ctx context.Context, in *pb.FetchRequest) (reply *pb.AgencyReply, err error) {
func Pending(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.AgencyReply, err error) {
_, err = service.ParseMetaCtx(ctx, nil)
if err != nil {
return nil, err

View File

@@ -15,7 +15,7 @@ import (
)
// 更新密码
func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.StatusReply, err error) {
func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.IdentityStatusReply, err error) {
var (
identity string
)
@@ -50,7 +50,7 @@ func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.Stat
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: identity,

View File

@@ -7,7 +7,7 @@ import (
)
// 会员列表
func MemberFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
func MemberFetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.DataReply, err error) {
// parse authorization meta.
_, err = service.ParseMetaCtx(ctx, nil)
if err != nil {

View File

@@ -7,7 +7,7 @@ import (
)
// 订单列表
func OrderFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
func OrderFetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.DataReply, err error) {
// parse authorization meta.
_, err = service.ParseMetaCtx(ctx, nil)
if err != nil {

View File

@@ -12,7 +12,7 @@ import (
)
// 新增供应商
func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply, err error) {
func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.IdentityStatusReply, err error) {
// parse authorization meta.
// _, err = service.ParseMetaCtx(ctx, nil)
// if err != nil {
@@ -38,7 +38,7 @@ func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: mktModel.Identity,

View File

@@ -12,7 +12,7 @@ import (
)
// 删除一个供应商
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.IdentityStatusReply, err error) {
// parse authorization meta.
_, err = service.ParseMetaCtx(ctx, nil)
if err != nil {
@@ -29,7 +29,7 @@ func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, er
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Timeseq: time.Now().UnixNano(),

View File

@@ -11,7 +11,7 @@ import (
)
// 供应商列表
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.SupplyReply, err error) {
func Fetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.SupplyReply, err error) {
var (
cnt int64 = 0
Offset int64 = (in.GetPageNo() - 1) * in.GetPageSize()

View File

@@ -12,7 +12,7 @@ import (
)
// 更新供应商数据
func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply, err error) {
func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.IdentityStatusReply, err error) {
_, err = service.ParseMetaCtx(ctx, nil)
if err != nil {
return nil, err
@@ -38,7 +38,7 @@ func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply
return nil, err
}
return &pb.StatusReply{
return &pb.IdentityStatusReply{
Code: 0,
Message: "OK",
Identity: mktModel.Identity,

View File

@@ -2,9 +2,9 @@
package server
import (
"context"
"bsm/full/module/ec/market/internal/logic/agency"
pb "bsm/full/module/ec/market/pb"
"context"
)
type AgencyServer struct {
@@ -16,12 +16,12 @@ func NewAgencyServer() *AgencyServer {
}
// 登录
func (s *AgencyServer) Login(ctx context.Context, in *pb.LoginRequest) (*pb.LoginReply, error) {
func (s *AgencyServer) Login(ctx context.Context, in *pb.LoginRequest) (*pb.MarketLoginReply, error) {
return agency.Login(ctx, in)
}
// 新增代理商
func (s *AgencyServer) Create(ctx context.Context, in *pb.MarketAgenctyItem) (*pb.StatusReply, error) {
func (s *AgencyServer) Create(ctx context.Context, in *pb.MarketAgenctyItem) (*pb.IdentityStatusReply, error) {
return agency.Create(ctx, in)
}
@@ -31,31 +31,31 @@ func (s *AgencyServer) Get(ctx context.Context, in *pb.IdentRequest) (*pb.Market
}
// 代理商列表
func (s *AgencyServer) Fetch(ctx context.Context, in *pb.FetchRequest) (*pb.AgencyReply, error) {
func (s *AgencyServer) Fetch(ctx context.Context, in *pb.MarketFetchRequest) (*pb.AgencyReply, error) {
return agency.Fetch(ctx, in)
}
// 更新代理商数据
func (s *AgencyServer) Modify(ctx context.Context, in *pb.MarketAgenctyItem) (*pb.StatusReply, error) {
func (s *AgencyServer) Modify(ctx context.Context, in *pb.MarketAgenctyItem) (*pb.IdentityStatusReply, error) {
return agency.Modify(ctx, in)
}
// 删除一个代理商
func (s *AgencyServer) Delete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
func (s *AgencyServer) Delete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
return agency.Delete(ctx, in)
}
// 更新密码
func (s *AgencyServer) SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (*pb.StatusReply, error) {
func (s *AgencyServer) SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (*pb.IdentityStatusReply, error) {
return agency.SetPassword(ctx, in)
}
// 待审核
func (s *AgencyServer) Pending(ctx context.Context, in *pb.FetchRequest) (*pb.AgencyReply, error) {
func (s *AgencyServer) Pending(ctx context.Context, in *pb.MarketFetchRequest) (*pb.AgencyReply, error) {
return agency.Pending(ctx, in)
}
// 审核
func (s *AgencyServer) Approve(ctx context.Context, in *pb.ApproveRequest) (*pb.StatusReply, error) {
func (s *AgencyServer) Approve(ctx context.Context, in *pb.ApproveRequest) (*pb.IdentityStatusReply, error) {
return agency.Approve(ctx, in)
}

View File

@@ -2,9 +2,9 @@
package server
import (
"context"
"bsm/full/module/ec/market/internal/logic/data"
pb "bsm/full/module/ec/market/pb"
"context"
)
type DataServer struct {
@@ -21,7 +21,7 @@ func (s *DataServer) Overview(ctx context.Context, in *pb.Empty) (*pb.OverviewRe
}
// 会员列表
func (s *DataServer) MemberFetch(ctx context.Context, in *pb.FetchRequest) (*pb.DataReply, error) {
func (s *DataServer) MemberFetch(ctx context.Context, in *pb.MarketFetchRequest) (*pb.DataReply, error) {
return data.MemberFetch(ctx, in)
}
@@ -31,7 +31,7 @@ func (s *DataServer) MemberDetails(ctx context.Context, in *pb.IdentRequest) (*p
}
// 订单列表
func (s *DataServer) OrderFetch(ctx context.Context, in *pb.FetchRequest) (*pb.DataReply, error) {
func (s *DataServer) OrderFetch(ctx context.Context, in *pb.MarketFetchRequest) (*pb.DataReply, error) {
return data.OrderFetch(ctx, in)
}

View File

@@ -2,28 +2,27 @@
package server
import (
"context"
pb "bsm/full/module/ec/market/pb"
"git.apinb.com/bsm-sdk/core/vars"
"context"
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"google.golang.org/protobuf/proto"
"net/http"
"os"
"strings"
)
type Server struct {
Grpc *grpc.Server
Ctx context.Context
Mux *gwRuntime.ServeMux
Grpc *grpc.Server
Ctx context.Context
Mux *gwRuntime.ServeMux
grpcConns map[string]*grpc.ClientConn // 连接池
}
func New(addr string) *Server {
srv := &Server{Ctx: context.Background(), Grpc: grpc.NewServer(), Mux: gwRuntime.NewServeMux(
gwRuntime.WithForwardResponseRewriter(responseEnvelope),
)}
srv := &Server{
Ctx: context.Background(),
Grpc: grpc.NewServer(),
grpcConns: make(map[string]*grpc.ClientConn),
}
// register service to grpc.Server
pb.RegisterAgencyServer(srv.Grpc, NewAgencyServer())
@@ -32,44 +31,5 @@ func New(addr string) *Server {
reflection.Register(srv.Grpc)
// 将服务注册到Gateway
opts := []grpc.DialOption{grpc.WithInsecure()}
pb.RegisterAgencyHandlerFromEndpoint(srv.Ctx, srv.Mux, addr, opts)
pb.RegisterDataHandlerFromEndpoint(srv.Ctx, srv.Mux, addr, opts)
pb.RegisterSupplyHandlerFromEndpoint(srv.Ctx, srv.Mux, addr, opts)
// Register services swagger
srv.RegisterSwagger()
return srv
}
// RegisterSwagger 注册swagger
func (s *Server) RegisterSwagger() {
srvKey := strings.ToLower(vars.ServiceKey)
s.Mux.HandlePath("GET", "/"+srvKey+".swagger.json", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
w.Header().Set("Content-Type", "application/json")
bytes, err := os.ReadFile("./swagger/" + srvKey + ".swagger.json")
if err != nil {
w.WriteHeader(http.StatusNotFound)
w.Write([]byte(err.Error()))
return
}
w.Write(bytes)
return
})
}
// response envelope
func responseEnvelope(_ context.Context, response proto.Message) (interface{}, error) {
name := string(response.ProtoReflect().Descriptor().Name())
if name == "Status" || name == "Error" || name == "StatusReply" {
return response, nil
}
return map[string]any{
"code": 0,
"message": "OK",
"result": response,
}, nil
}

View File

@@ -2,9 +2,9 @@
package server
import (
"context"
"bsm/full/module/ec/market/internal/logic/supply"
pb "bsm/full/module/ec/market/pb"
"context"
)
type SupplyServer struct {
@@ -16,7 +16,7 @@ func NewSupplyServer() *SupplyServer {
}
// 新增供应商
func (s *SupplyServer) Create(ctx context.Context, in *pb.MarketSupplyItem) (*pb.StatusReply, error) {
func (s *SupplyServer) Create(ctx context.Context, in *pb.MarketSupplyItem) (*pb.IdentityStatusReply, error) {
return supply.Create(ctx, in)
}
@@ -26,16 +26,16 @@ func (s *SupplyServer) Get(ctx context.Context, in *pb.IdentRequest) (*pb.Market
}
// 供应商列表
func (s *SupplyServer) Fetch(ctx context.Context, in *pb.FetchRequest) (*pb.SupplyReply, error) {
func (s *SupplyServer) Fetch(ctx context.Context, in *pb.MarketFetchRequest) (*pb.SupplyReply, error) {
return supply.Fetch(ctx, in)
}
// 更新供应商数据
func (s *SupplyServer) Modify(ctx context.Context, in *pb.MarketSupplyItem) (*pb.StatusReply, error) {
func (s *SupplyServer) Modify(ctx context.Context, in *pb.MarketSupplyItem) (*pb.IdentityStatusReply, error) {
return supply.Modify(ctx, in)
}
// 删除一个供应商
func (s *SupplyServer) Delete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
func (s *SupplyServer) Delete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
return supply.Delete(ctx, in)
}

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)
}

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package market;
option go_package = "bsm/full/module/ec/market/pb;market";
import "protobuf/blocks.proto";
import "module/ec/market/proto/const.proto";
// 营销服务 - 代理商
service Agency{

View File

@@ -0,0 +1,326 @@
syntax = "proto3";
package blocks;
option go_package = "bsm/full/module/ec/market/pb;market";
// Shared request and response messages.
message Empty {}
message FetchRequest {
int64 page_no = 1 [json_name = "page_no"];
int64 page_size = 2 [json_name = "page_size"];
map<string, string> params = 3;
}
message IdentRequest {
int64 id = 1;
string identity = 2;
}
message VersionRequest {
int64 version = 1;
}
message SearchRequest {
string keyword = 1;
}
message StatusReply {
int32 code = 1;
string message = 2;
string details = 3;
int64 timeseq = 4;
}
// Service-specific variants whose wire formats differ from the shared types.
message CmsSearchRequest {
string keyword = 1;
int64 page_no = 2 [json_name = "page_no"];
int64 page_size = 3 [json_name = "page_size"];
}
message MallFetchRequest {
int64 page_no = 1 [json_name = "page_no"];
int64 page_size = 2 [json_name = "page_size"];
map<string, string> params = 3;
string store_identity = 4 [json_name = "store_identity"];
string keyword = 5;
repeated int64 category_id = 6;
string sort = 7;
int64 min_price = 8 [json_name = "min_price"];
int64 max_price = 9 [json_name = "max_price"];
}
message MarketFetchRequest {
int64 page_no = 1 [json_name = "page_no"];
int64 page_size = 2 [json_name = "page_size"];
map<string, string> params = 3;
string identity = 4;
string keyword = 5;
int32 status = 6;
int32 approve = 7;
}
message OrderIdentRequest {
int64 id = 1;
string identity = 2;
string reason = 3;
int32 approve = 4;
string agency = 5;
string store_identity = 6;
}
message DeliveryStatusReply {
int64 status = 1;
string identity = 2;
string message = 3;
int64 timeseq = 4;
}
message IdentityStatusReply {
int32 code = 1;
string identity = 2;
string message = 3;
int64 timeseq = 4;
}
message OrderStatusReply {
int32 code = 1;
string identity = 2;
string message = 3;
int64 timeseq = 4;
string reason = 5;
}
message DataStatusReply {
string data = 1;
int64 timeseq = 2;
}
message StoreSerialRequest {
string store_identity = 1 [json_name = "store_identity"];
repeated string serial_id = 2 [json_name = "serial_id"];
}
// Cloud messages.
message IDRequest {
uint64 id = 1;
}
message IDListRequest {
repeated uint64 ids = 1;
}
message StdIicuds {
uint64 id = 1;
string created_at = 2;
string updated_at = 3;
string deleted_at = 4;
}
message StdPassport {
uint64 passport_id = 1;
string passport_identity = 2;
}
message CloudBase {
uint64 cloud_id = 1;
string cloud_identity = 2;
}
// CMS messages.
message CmsCategoryItem {
string site_identity = 1 [json_name = "site_identity"];
int64 id = 2;
string identity = 3;
int64 parent_id = 4 [json_name = "parent_id"];
string title = 5;
string cover_path = 6 [json_name = "cover_path"];
string intro = 7;
string created_at = 8 [json_name = "created_at"];
string updated_at = 9 [json_name = "updated_at"];
repeated CmsCategoryItem child = 10;
string category_key = 11 [json_name = "category_key"];
}
message CmsTagsItem {
int64 id = 1;
string identity = 2;
string title = 3;
string cover_path = 4 [json_name = "cover_path"];
string intro = 5;
string created_at = 6 [json_name = "created_at"];
}
message CmsAccessoryItem {
string identity = 1;
string title = 2;
string file_path = 3 [json_name = "file_path"];
string created_at = 4 [json_name = "created_at"];
}
// Passport messages.
message VerifyStatus {
int32 email_verify = 1;
int32 phone_verify = 2;
int32 face_verify = 3;
int32 document_verify = 4;
int32 kyc_verify = 5;
}
// Market messages.
message MarketLoginReply {
string token = 1;
string identity = 2;
string market_identity = 3 [json_name = "market_identity"];
string name = 4;
string account = 5;
string role = 6;
int32 status = 7;
string created_at = 8 [json_name = "created_at"];
string market_name = 9 [json_name = "market_name"];
}
// Order messages.
message OrderSummaryItem {
int64 id = 1;
string order_no = 2 [json_name = "order_no"];
int64 partner_id = 3 [json_name = "partner_id"];
string identity = 4;
int64 total_price = 7 [json_name = "total_price"];
int64 trans_price = 8 [json_name = "trans_price"];
int64 refund_price = 9 [json_name = "refund_price"];
int64 logistics_fee = 11 [json_name = "logistics_fee"];
int64 coupon_amount = 12 [json_name = "coupon_amount"];
string remark = 13;
int32 status = 14;
string logistics_number = 15 [json_name = "logistics_number"];
string address_identity = 16 [json_name = "address_identity"];
string county = 17;
string province = 18;
string city = 19;
string area = 20;
string address = 21;
string contact = 22;
string phone = 23;
string delivery_time = 24 [json_name = "delivery_time"];
string delivery_identity = 25 [json_name = "delivery_identity"];
int32 pay_type = 26 [json_name = "pay_type"];
int64 pay_amount = 27 [json_name = "pay_amount"];
string pay_trade_no = 28 [json_name = "pay_trade_no"];
string pay_time = 29 [json_name = "pay_time"];
string pay_remark = 30 [json_name = "pay_remark"];
string created = 31;
string updated = 32;
repeated OrderDetails details = 33;
string addr = 34;
string car_identity = 35 [json_name = "car_identity"];
string delivery_address = 36 [json_name = "delivery_address"];
string brand = 37;
string version = 38;
string license_number = 39 [json_name = "license_number"];
string member_name = 40 [json_name = "member_name"];
string member_phone = 41 [json_name = "member_phone"];
int32 approve = 42;
}
message OrderDetails {
int64 id = 1;
int64 product_id = 2 [json_name = "product_id"];
string spec_no = 3 [json_name = "spec_no"];
string spec = 4;
int64 type = 5;
string title = 6;
string cover_image = 7 [json_name = "cover_image"];
int64 sales_price = 8 [json_name = "sales_price"];
string product_args = 9 [json_name = "product_args"];
int64 number = 10;
int64 unit_price = 11 [json_name = "unit_price"];
int64 spec_id = 12 [json_name = "spec_id"];
string product_identity = 13 [json_name = "product_identity"];
int64 gas_types = 14 [json_name = "gas_types"];
int64 total_price = 15 [json_name = "total_price"];
}
// Social feed messages.
message FeedPostListReply {
repeated FeedPostItem list = 1;
int64 cnt = 2;
}
message FeedPostItem {
string identity = 1;
string content = 2;
int64 feed_id = 3;
string feed_identity = 4;
bool is_open = 5;
int64 cnt_unlike = 6;
int64 cnt_comment = 7;
int64 cnt_like = 8;
repeated FeedAttachItem attachs = 9;
repeated FeedTagItem tags = 10;
}
message FeedAttachItem {
string identity = 1;
string attach_type = 2;
string url = 3;
}
message FeedTagItem {
string key = 1;
string content = 2;
}
// Social group messages.
message GroupPostListReply {
repeated GroupPostItem list = 1;
int64 cnt = 2;
}
message GroupPostItem {
string identity = 1;
string content = 2;
int64 passport_id = 3;
string passport_identity = 4;
bool is_open = 5;
int64 cnt_unlike = 6;
int64 cnt_comment = 7;
int64 cnt_like = 8;
repeated GroupAttachItem attachs = 9;
repeated GroupTagItem tags = 10;
}
message GroupAttachItem {
string identity = 1;
string attach_type = 2;
string url = 3;
}
message GroupTagItem {
string key = 1;
string content = 2;
}
// Social relation messages.
message RelationItem {
string identity = 1;
string nickname = 2;
string remark_name = 3;
int32 popular = 4;
string avatar = 5;
string birthday = 6;
int32 sex = 7;
int32 province = 8;
int32 city = 9;
int32 area = 10;
string sign = 11;
repeated string tags = 12;
int32 foreign_status = 13;
}
message FetchRelationItemReply {
int64 total = 1;
repeated RelationItem data = 2;
}

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package market;
option go_package = "bsm/full/module/ec/market/pb;market";
import "protobuf/blocks.proto";
import "module/ec/market/proto/const.proto";
// 数据服务
service Data{

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package market;
option go_package = "bsm/full/module/ec/market/pb;market";
import "protobuf/blocks.proto";
import "module/ec/market/proto/const.proto";
// 营销服务 - 供应商
service Supply{

View File

@@ -1,32 +0,0 @@
filebeat.inputs:
- type: log
enabled: true
# 开启json解析
json.keys_under_root: true
json.add_error_key: true
# 日志文件路径
paths:
- ./logs/content/error.log
- ./logs/content/slow.log
setup.template.settings:
index.number_of_shards: 1
# 定义kafka topic field
fields:
log_topic: scf.pb.dev
# 输出到kafka
output.kafka:
hosts: ["127.0.0.1:9092"]
topic: '%{[fields.log_topic]}'
partition.round_robin:
reachable_only: false
required_acks: 1
keep_alive: 10s
# ================================= Processors =================================
processors:
- decode_json_fields:
fields: ['@timestamp','level','content','trace','span','duration']
target: ""

View File

@@ -1,5 +0,0 @@
#install
go install github.com/securego/gosec/v2/cmd/gosec@latest
#run
gosec -fmt=json -out=./test/lint/gosec.json ./...

View File

@@ -1,383 +0,0 @@
{
"swagger": "2.0",
"info": {
"title": "blocks.proto",
"version": "version not set"
},
"tags": [
{
"name": "Agency"
},
{
"name": "Data"
},
{
"name": "Supply"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"marketAgencyReply": {
"type": "object",
"properties": {
"count": {
"type": "string",
"format": "int64",
"title": "总数"
},
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/marketMarketAgenctyItem"
},
"title": "数据"
}
}
},
"marketDataReply": {
"type": "object",
"properties": {
"count": {
"type": "string",
"format": "int64",
"title": "记录总数"
},
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/marketKeyVal"
},
"title": "当前页数据"
}
}
},
"marketKeyVal": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"val": {
"type": "string"
}
}
},
"marketLoginReply": {
"type": "object",
"properties": {
"token": {
"type": "string",
"title": "token 授权码"
},
"identity": {
"type": "string",
"title": "唯一标识"
},
"market_identity": {
"type": "string",
"title": "店铺唯一标识"
},
"name": {
"type": "string",
"title": "姓名"
},
"account": {
"type": "string",
"title": "账号"
},
"role": {
"type": "string",
"title": "角色"
},
"status": {
"type": "integer",
"format": "int32",
"title": "状态"
},
"created_at": {
"type": "string",
"title": "创建时间"
},
"market_name": {
"type": "string",
"title": "店铺名称"
}
}
},
"marketMarketAgenctyItem": {
"type": "object",
"properties": {
"identity": {
"type": "string",
"title": "唯一标识"
},
"created_at": {
"type": "string",
"title": "创建时间"
},
"name": {
"type": "string",
"title": "联系人名称 必填"
},
"avatar": {
"type": "string",
"title": "头像"
},
"account": {
"type": "string",
"title": "帐号"
},
"phone": {
"type": "string",
"title": "手机号"
},
"password": {
"type": "string",
"title": "密码"
},
"org_name": {
"type": "string",
"title": "机构名称"
},
"org_photo": {
"type": "string",
"title": "机构照片"
},
"id_name": {
"type": "string",
"title": "证件姓名"
},
"id_before": {
"type": "string",
"title": "证件照片"
},
"id_after": {
"type": "string",
"title": "证件照片"
},
"remark": {
"type": "string",
"title": "备注"
},
"commission_rate": {
"type": "integer",
"format": "int32",
"title": "佣金比例"
},
"agency_type": {
"type": "integer",
"format": "int32",
"title": "服务 状态1代理商 2安装商"
},
"status": {
"type": "integer",
"format": "int32",
"title": "状态默认为0-1禁止1为正常"
},
"email": {
"type": "string",
"title": "邮箱"
},
"country": {
"type": "string",
"title": "国家"
},
"area": {
"type": "string",
"title": "地区"
},
"approve": {
"type": "integer",
"format": "int32",
"title": "审核状态0待审核 2审核通过 -2审核未通过"
}
}
},
"marketMarketSupplyItem": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "联系人名称 必填"
},
"avatar": {
"type": "string",
"title": "头像"
},
"commission_rate": {
"type": "integer",
"format": "int32",
"title": "佣金比例"
},
"account": {
"type": "string",
"title": "帐号"
},
"phone": {
"type": "string",
"title": "手机号"
},
"password": {
"type": "string",
"title": "密码"
},
"org_name": {
"type": "string",
"title": "机构名称"
},
"org_photo": {
"type": "string",
"title": "机构照片"
},
"id_name": {
"type": "string",
"title": "证件姓名"
},
"id_before": {
"type": "string",
"title": "证件照片"
},
"id_after": {
"type": "string",
"title": "证件照片"
},
"remark": {
"type": "string",
"title": "备注"
},
"identity": {
"type": "string",
"title": "唯一标识"
},
"status": {
"type": "integer",
"format": "int32",
"title": "状态"
},
"id": {
"type": "integer",
"format": "int32",
"title": "id"
}
}
},
"marketOverviewReply": {
"type": "object",
"properties": {
"total_approve": {
"type": "string",
"format": "int64",
"title": "待沟通会员"
},
"total_month": {
"type": "string",
"format": "int64",
"title": "本月新会员"
},
"total_all": {
"type": "string",
"format": "int64",
"title": "全部会员"
},
"total_staff": {
"type": "string",
"format": "int64",
"title": "工作人员"
},
"reportMonth": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "int64"
},
"title": "按月统计,最近半年"
},
"reportStaff": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "int64"
},
"title": "按月统计,工作人员"
}
}
},
"marketStatusReply": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32",
"title": "状态码"
},
"identity": {
"type": "string",
"title": "标识码"
},
"message": {
"type": "string",
"title": "状态说明"
},
"timeseq": {
"type": "string",
"format": "int64",
"title": "响应时间序列"
}
}
},
"marketSupplyReply": {
"type": "object",
"properties": {
"count": {
"type": "string",
"format": "int64",
"title": "总数"
},
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/marketMarketSupplyItem"
},
"title": "数据"
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}