浏览代码

feat:增加信息分发

duxin 2 年之前
父节点
当前提交
2627cbca2b

+ 4 - 4
jyBXSubscribe/api/bxsubscribe.api

@@ -26,9 +26,9 @@ type (
 		Subtype    string `json:"subtype,optional"`
 		Price      string `json:"price,optional"`
 		FileExists string `json:"fileExists,optional"`
-		Source     int  `json:"source,optional"`   //信息来源
-        IsRead     int  `json:"isRead,optional"`    //是否已读
-        Staffs     string `json:"staffs,optional"` //分发的员工
+		Source     int    `json:"source,optional"`                                        //信息来源
+		IsRead     int    `json:"isRead,optional"`                                        //是否已读
+		Staffs     string `json:"staffs,optional"`                                        //分发的员工
 		UserType   string `path:"userType,default=fType,options=fType|vType|mType|eType"` //fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户;
 		NewUserId  int64  `header:"newUserId"`
 		IsEnt      bool   `json:"isEnt,optional"`
@@ -123,4 +123,4 @@ service bxsubscribe-api {
 	post /jybx/subscribe/:userType/distributor(DistributorReq) returns (commonResp)
 	@handler viewStatus
 	post /jybx/subscribe/:userType/viewStatus(viewStatusReq) returns (commonResp)
-}
+}

+ 3 - 0
jyBXSubscribe/api/internal/types/types.go

@@ -18,6 +18,9 @@ type SubscribeReq struct {
 	Subtype    string `json:"subtype,optional"`
 	Price      string `json:"price,optional"`
 	FileExists string `json:"fileExists,optional"`
+	Source     int    `json:"source,optional"`                                        //信息来源
+	IsRead     int    `json:"isRead,optional"`                                        //是否已读
+	Staffs     string `json:"staffs,optional"`                                        //分发的员工
 	UserType   string `path:"userType,default=fType,options=fType|vType|mType|eType"` //fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户;
 	NewUserId  int64  `header:"newUserId"`
 	IsEnt      bool   `json:"isEnt,optional"`

+ 11 - 2
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -24,6 +24,7 @@ type (
 	KeyItems               = bxsubscribe.KeyItems
 	KeyResp                = bxsubscribe.KeyResp
 	Keys                   = bxsubscribe.Keys
+	MsgDistributorReq      = bxsubscribe.MsgDistributorReq
 	SetReadReq             = bxsubscribe.SetReadReq
 	SomeInfo               = bxsubscribe.SomeInfo
 	SomeInfoReq            = bxsubscribe.SomeInfoReq
@@ -51,7 +52,9 @@ type (
 		SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 		// 关键词获取
 		GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
-		// 手动分发人员
+		// 信息分发
+		MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 手动分发人员查询
 		GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
 		// 查看状态
 		GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error)
@@ -104,7 +107,13 @@ func (m *defaultBxsubscribe) GetKey(ctx context.Context, in *GetKeyReq, opts ...
 	return client.GetKey(ctx, in, opts...)
 }
 
-// 手动分发人员
+// 信息分发
+func (m *defaultBxsubscribe) MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.MsgDistributor(ctx, in, opts...)
+}
+
+// 手动分发人员查询
 func (m *defaultBxsubscribe) GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error) {
 	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
 	return client.GetDistributor(ctx, in, opts...)

+ 31 - 0
jyBXSubscribe/rpc/internal/logic/msgdistributorlogic.go

@@ -0,0 +1,31 @@
+package logic
+
+import (
+	"context"
+
+	"jyBXSubscribe/rpc/internal/svc"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type MsgDistributorLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewMsgDistributorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MsgDistributorLogic {
+	return &MsgDistributorLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 信息分发
+func (l *MsgDistributorLogic) MsgDistributor(in *bxsubscribe.MsgDistributorReq) (*bxsubscribe.StatusResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &bxsubscribe.StatusResp{}, nil
+}

+ 7 - 1
jyBXSubscribe/rpc/internal/server/bxsubscribeserver.go

@@ -58,7 +58,13 @@ func (s *BxsubscribeServer) GetKey(ctx context.Context, in *bxsubscribe.GetKeyRe
 	return l.GetKey(in)
 }
 
-// 手动分发人员
+// 信息分发
+func (s *BxsubscribeServer) MsgDistributor(ctx context.Context, in *bxsubscribe.MsgDistributorReq) (*bxsubscribe.StatusResp, error) {
+	l := logic.NewMsgDistributorLogic(ctx, s.svcCtx)
+	return l.MsgDistributor(in)
+}
+
+// 手动分发人员查询
 func (s *BxsubscribeServer) GetDistributor(ctx context.Context, in *bxsubscribe.GetDistributorReq) (*bxsubscribe.DistributorResp, error) {
 	l := logic.NewGetDistributorLogic(ctx, s.svcCtx)
 	return l.GetDistributor(in)

文件差异内容过多而无法显示
+ 463 - 339
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go


+ 40 - 2
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

@@ -34,7 +34,9 @@ type BxsubscribeClient interface {
 	SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 	// 关键词获取
 	GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
-	// 手动分发人员
+	// 信息分发
+	MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error)
+	// 手动分发人员查询
 	GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
 	// 查看状态
 	GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error)
@@ -102,6 +104,15 @@ func (c *bxsubscribeClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...g
 	return out, nil
 }
 
+func (c *bxsubscribeClient) MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	out := new(StatusResp)
+	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/MsgDistributor", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *bxsubscribeClient) GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error) {
 	out := new(DistributorResp)
 	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetDistributor", in, out, opts...)
@@ -136,7 +147,9 @@ type BxsubscribeServer interface {
 	SetRead(context.Context, *SetReadReq) (*StatusResp, error)
 	// 关键词获取
 	GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
-	// 手动分发人员
+	// 信息分发
+	MsgDistributor(context.Context, *MsgDistributorReq) (*StatusResp, error)
+	// 手动分发人员查询
 	GetDistributor(context.Context, *GetDistributorReq) (*DistributorResp, error)
 	// 查看状态
 	GetViewStatus(context.Context, *GetViewStatusReq) (*ViewStatusResp, error)
@@ -165,6 +178,9 @@ func (UnimplementedBxsubscribeServer) SetRead(context.Context, *SetReadReq) (*St
 func (UnimplementedBxsubscribeServer) GetKey(context.Context, *GetKeyReq) (*KeyResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
 }
+func (UnimplementedBxsubscribeServer) MsgDistributor(context.Context, *MsgDistributorReq) (*StatusResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method MsgDistributor not implemented")
+}
 func (UnimplementedBxsubscribeServer) GetDistributor(context.Context, *GetDistributorReq) (*DistributorResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetDistributor not implemented")
 }
@@ -292,6 +308,24 @@ func _Bxsubscribe_GetKey_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Bxsubscribe_MsgDistributor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(MsgDistributorReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxsubscribeServer).MsgDistributor(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxsubscribe.Bxsubscribe/MsgDistributor",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxsubscribeServer).MsgDistributor(ctx, req.(*MsgDistributorReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Bxsubscribe_GetDistributor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(GetDistributorReq)
 	if err := dec(in); err != nil {
@@ -359,6 +393,10 @@ var Bxsubscribe_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetKey",
 			Handler:    _Bxsubscribe_GetKey_Handler,
 		},
+		{
+			MethodName: "MsgDistributor",
+			Handler:    _Bxsubscribe_MsgDistributor_Handler,
+		},
 		{
 			MethodName: "GetDistributor",
 			Handler:    _Bxsubscribe_GetDistributor_Handler,

部分文件因为文件数量过多而无法显示