Bladeren bron

fix:修改群发列表API

jimmyyem 18 uur geleden
bovenliggende
commit
f9d4a55a90

+ 1 - 0
internal/logic/batch_msg/get_batch_msg_by_id_logic.go

@@ -76,6 +76,7 @@ func (l *GetBatchMsgByIdLogic) GetBatchMsgById(req *types.IDReq) (*types.BatchMs
 			Success:      &data.Success,
 			Fail:         &data.Fail,
 			Type:         &data.Type,
+			Ctype:        &data.Ctype,
 			StartTime:    pointy.GetUnixMilliPointer(data.StartTime.UnixMilli()),
 			StopTime:     pointy.GetUnixMilliPointer(data.StopTime.UnixMilli()),
 			SendTime:     pointy.GetUnixMilliPointer(data.SendTime.UnixMilli()),

+ 1 - 0
internal/logic/batch_msg/get_batch_msg_list_logic.go

@@ -81,6 +81,7 @@ func (l *GetBatchMsgListLogic) GetBatchMsgList(req *types.BatchMsgListReq) (*typ
 				Success:      &v.Success,
 				Fail:         &v.Fail,
 				Type:         &v.Type,
+				Ctype:        &v.Ctype,
 				StartTime:    pointy.GetUnixMilliPointer(v.StartTime.UnixMilli()),
 				StopTime:     pointy.GetUnixMilliPointer(v.StopTime.UnixMilli()),
 				StartTimeStr: pointy.GetPointer(v.StartTime.Format("2006-01-02 15:04:05")),

+ 16 - 16
internal/logic/batch_msg/update_batch_msg_logic.go

@@ -7,7 +7,6 @@ import (
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
 
-
 	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 	"github.com/suyuan32/simple-admin-common/utils/pointy"
 	"github.com/zeromicro/go-zero/core/logx"
@@ -28,22 +27,23 @@ func NewUpdateBatchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
 }
 
 func (l *UpdateBatchMsgLogic) UpdateBatchMsg(req *types.BatchMsgInfo) (*types.BaseMsgResp, error) {
-    err := l.svcCtx.DB.BatchMsg.UpdateOneID(*req.Id).
-			SetNotNilStatus(req.Status).
-			SetNotNilBatchNo(req.BatchNo).
-			SetNotNilFromwxid(req.Fromwxid).
-			SetNotNilMsg(req.Msg).
-			SetNotNilTag(req.Tag).
-			SetNotNilTotal(req.Total).
-			SetNotNilSuccess(req.Success).
-			SetNotNilFail(req.Fail).
-			SetNotNilStartTime(pointy.GetTimeMilliPointer(req.StartTime)).
-			SetNotNilStopTime(pointy.GetTimeMilliPointer(req.StopTime)).
-			Exec(l.ctx)
-
-    if err != nil {
+	err := l.svcCtx.DB.BatchMsg.UpdateOneID(*req.Id).
+		SetNotNilStatus(req.Status).
+		SetNotNilBatchNo(req.BatchNo).
+		SetNotNilFromwxid(req.Fromwxid).
+		SetNotNilMsg(req.Msg).
+		SetNotNilTag(req.Tag).
+		SetNotNilTotal(req.Total).
+		SetNotNilSuccess(req.Success).
+		SetNotNilFail(req.Fail).
+		SetNotNilCtype(req.Ctype).
+		SetNotNilStartTime(pointy.GetTimeMilliPointer(req.StartTime)).
+		SetNotNilStopTime(pointy.GetTimeMilliPointer(req.StopTime)).
+		Exec(l.ctx)
+
+	if err != nil {
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
-    return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
+	return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
 }