瀏覽代碼

dev/v1.2.12_rjj

renjiaojiao 1 年之前
父節點
當前提交
3107b7f0e7

+ 37 - 0
rpc/internal/logic/bitmapsavemsglogic.go

@@ -0,0 +1,37 @@
+package logic
+
+import (
+	service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
+	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
+	"context"
+
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type BitmapSaveMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewBitmapSaveMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BitmapSaveMsgLogic {
+	return &BitmapSaveMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// BitmapSaveMsg bitmap发送消息
+func (l *BitmapSaveMsgLogic) BitmapSaveMsg(in *messageclient.BitmapSaveMsgReq) (*messageclient.MultipleSaveMsgResp, error) {
+	var code = 1
+	err := service.UpdateUserMsgSummary(in)
+	if err != nil {
+		code = 0
+	}
+	return &messageclient.MultipleSaveMsgResp{
+		Code:    int64(code),
+		Message: err.Error(),
+	}, nil
+}

+ 36 - 0
rpc/internal/logic/newusermsglogic.go

@@ -0,0 +1,36 @@
+package logic
+
+import (
+	service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
+	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
+	"context"
+	"fmt"
+
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type NewUserMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewNewUserMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *NewUserMsgLogic {
+	return &NewUserMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 新用户发送消息
+func (l *NewUserMsgLogic) NewUserMsg(in *messageclient.NewUserInsertMsgReq) (*messageclient.Response, error) {
+	// todo: add your logic here and delete this line
+	fmt.Println(in)
+	msg := service.NewUserSendMsg(in)
+	return &messageclient.Response{
+		Code:    1,
+		Message: msg,
+	}, nil
+}

+ 43 - 0
rpc/internal/logic/updatemsgsummarylogic.go

@@ -0,0 +1,43 @@
+package logic
+
+import (
+	service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
+	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
+	"context"
+
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateMsgSummaryLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewUpdateMsgSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMsgSummaryLogic {
+	return &UpdateMsgSummaryLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 发送消息更新一次消息汇总表
+func (l *UpdateMsgSummaryLogic) UpdateMsgSummary(in *messageclient.UpdateMsgSummaryReq) (*messageclient.Response, error) {
+	var (
+		code = 1
+		msg  = "成功"
+	)
+	err := service.SetMsgSummary(in.MsgLogId, in.GroupId, in.MsgType)
+	if err != nil {
+		code = 0
+		msg = err.Error()
+	}
+	return &message.Response{
+		Code:    int64(code),
+		Message: msg,
+	}, nil
+}