This commit is contained in:
lwl0608 2024-04-16 21:57:34 +08:00
parent e03489feba
commit 89bc85b415
3 changed files with 6 additions and 6 deletions

View File

@ -2392,7 +2392,7 @@ func (s *Service) ApiCreateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建 req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建
req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审 req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审
err, momentId := _DefaultZoneMoment.OpCreate(ctx, &zonemomentproto.OpCreateReq{ momentId, err := _DefaultZoneMoment.OpCreate(ctx, &zonemomentproto.OpCreateReq{
BaseRequest: req.BaseRequest, BaseRequest: req.BaseRequest,
ZoneMoment: req.ZoneMoment, ZoneMoment: req.ZoneMoment,
}) })

View File

@ -23,13 +23,13 @@ func NewZoneMoment(store *dao.Store) (a *ZoneMoment) {
return return
} }
func (p *ZoneMoment) OpCreate(ctx *gin.Context, req *zonemomentproto.OpCreateReq) (error, int64) { func (p *ZoneMoment) OpCreate(ctx *gin.Context, req *zonemomentproto.OpCreateReq) (int64, error) {
//产生zid //产生zid
zoneMomentIdSeq, err := p.store.GetAndUpdateZoneMomentIdSeq(ctx) zoneMomentIdSeq, err := p.store.GetAndUpdateZoneMomentIdSeq(ctx)
if err != nil { if err != nil {
logger.Error("GetAndUpdateZoneMomentIdSeq failed : %v", err) logger.Error("GetAndUpdateZoneMomentIdSeq failed : %v", err)
return err, 0 return 0, err
} }
req.ZoneMoment.Id = goproto.Int64(zoneMomentIdSeq.Seq) req.ZoneMoment.Id = goproto.Int64(zoneMomentIdSeq.Seq)
@ -40,9 +40,9 @@ func (p *ZoneMoment) OpCreate(ctx *gin.Context, req *zonemomentproto.OpCreateReq
err = p.store.CreateZoneMoment(ctx, req.ZoneMoment) err = p.store.CreateZoneMoment(ctx, req.ZoneMoment)
if err != nil { if err != nil {
logger.Error("CreateZoneMoment fail, err: %v", err) logger.Error("CreateZoneMoment fail, err: %v", err)
return err, 0 return 0, err
} }
return nil, zoneMomentIdSeq.Seq return zoneMomentIdSeq.Seq, nil
} }
func (p *ZoneMoment) OpUpdate(ctx *gin.Context, req *zonemomentproto.OpUpdateReq) error { func (p *ZoneMoment) OpUpdate(ctx *gin.Context, req *zonemomentproto.OpUpdateReq) error {

View File

@ -3205,7 +3205,7 @@ func (s *Service) OpCreateZoneMoment(ctx *gin.Context, req *zonemomentproto.OpCr
} }
req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建 req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建
req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审 req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审
err, _ := _DefaultZoneMoment.OpCreate(ctx, req) _, err := _DefaultZoneMoment.OpCreate(ctx, req)
if err != nil { if err != nil {
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err) logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneMomentSrvFail ec = errcode.ErrCodeZoneMomentSrvFail