|
@@ -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
|
|
|
+}
|