From 6311f9d66ff2ee98ef2b49907200b2faef002609 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 12 Jun 2023 11:34:47 +0800 Subject: [PATCH] cp --- _const/enum/cp_e/cp_relation.go | 2 ++ corn/cp_corn/cp.go | 6 ++++-- route/cp_r/cp_relation.go | 9 +++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/_const/enum/cp_e/cp_relation.go b/_const/enum/cp_e/cp_relation.go index 86bd635..ca95e4c 100644 --- a/_const/enum/cp_e/cp_relation.go +++ b/_const/enum/cp_e/cp_relation.go @@ -20,4 +20,6 @@ const ( CpCancelRevoke CpCancelStatus = 2 CpCancelAccept CpCancelStatus = 3 CpCancelAcceptAuto CpCancelStatus = 4 + + CpConfessionGiftId = 3379 // cp礼物id cwj---- ) diff --git a/corn/cp_corn/cp.go b/corn/cp_corn/cp.go index aed68b3..3fe4044 100644 --- a/corn/cp_corn/cp.go +++ b/corn/cp_corn/cp.go @@ -30,7 +30,8 @@ func CpInviteCancelInit() { defer utils.CheckGoPanic() model := domain.CreateModelNil() // 获取超过24小时没被处理的cp邀请 - inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().AddDate(0, 0, -1)) + //inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().AddDate(0, 0, -1)) cwj---- + inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().Add(time.Minute*10)) // cwj---- if err != nil { model.Log.Errorf("CpInviteCancelInit err:%v", err) return @@ -60,7 +61,8 @@ func CpInviteCancelInit() { } // 获取超过24小时没被处理的cp解除申请 - cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().AddDate(0, 0, -1)) + //cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().AddDate(0, 0, -1)) cwj---- + cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().Add(time.Minute*10)) // cwj---- if err != nil { model.Log.Errorf("CpInviteCancelInit err:%v", err) return diff --git a/route/cp_r/cp_relation.go b/route/cp_r/cp_relation.go index 03b3256..f109e80 100644 --- a/route/cp_r/cp_relation.go +++ b/route/cp_r/cp_relation.go @@ -9,6 +9,7 @@ import ( "git.hilo.cn/hilo-common/myerr/comerr" "git.hilo.cn/hilo-common/resource/mysql" "git.hilo.cn/hilo-common/sdk/tencentyun" + "git.hilo.cn/hilo-common/txop/bag_tx" "git.hilo.cn/hilo-common/txop/msg" "git.hilo.cn/hilo-common/utils" "github.com/gin-gonic/gin" @@ -205,10 +206,10 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { return err } // 发放告白礼物 cwj---- - //if _, err = bag_tx.SendUserBag(model, userSender.ID, 1, award.GiftId, award.GiftN, 3, "告白礼物"); err != nil { - // model.Log.Errorf("ReplyCpInvite userSender:%d, user:%d, status:%d, err:%v", userSender.ID, user.ID, updateStatus, err) - // return err - //} + if _, err = bag_tx.SendUserBag(model, userSender.ID, 1, cp_e.CpConfessionGiftId, 1, 3, "告白礼物"); err != nil { + model.Log.Errorf("ReplyCpInvite userSender:%d, user:%d, status:%d, err:%v", userSender.ID, user.ID, updateStatus, err) + return err + } // 发放头饰 cwj---- //if err = headwear_tx.SendHeadwear(model, userSender.ID, 1, 3); err != nil { // model.Log.Errorf("ReplyCpInvite userSender:%d, user:%d, status:%d, err:%v", userSender.ID, user.ID, updateStatus, err) -- 2.22.0