|
@@ -7,7 +7,6 @@ import (
|
|
"wechat-api/internal/types"
|
|
"wechat-api/internal/types"
|
|
"wechat-api/internal/utils/dberrorhandler"
|
|
"wechat-api/internal/utils/dberrorhandler"
|
|
|
|
|
|
-
|
|
|
|
"github.com/suyuan32/simple-admin-common/msg/errormsg"
|
|
"github.com/suyuan32/simple-admin-common/msg/errormsg"
|
|
"github.com/suyuan32/simple-admin-common/utils/pointy"
|
|
"github.com/suyuan32/simple-admin-common/utils/pointy"
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
"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) {
|
|
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 nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
}
|
|
}
|
|
|
|
|
|
- return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
|
|
|
|
|
|
+ return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
|
|
}
|
|
}
|