From ba988e4e00607e464c70f2c809a969f16d88562a Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 15 Jun 2023 20:20:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=88=A0=E6=8E=89=E5=A4=B4=E9=A5=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _const/enum/cp_e/level.go | 3 ++- domain/model/cp_m/level.go | 4 ++-- route/cp_r/cp_relation.go | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/_const/enum/cp_e/level.go b/_const/enum/cp_e/level.go index 3cbda5a..c43f14c 100644 --- a/_const/enum/cp_e/level.go +++ b/_const/enum/cp_e/level.go @@ -3,7 +3,8 @@ package cp_e import "git.hilo.cn/hilo-common/resource/mysql" const ( - EffectDays = 30 // 30天有效期 + EffectDays = 30 // 30天有效期 + CpHeadwearId = 2571 ) type CpLevel int diff --git a/domain/model/cp_m/level.go b/domain/model/cp_m/level.go index dabd445..ea6c5a6 100644 --- a/domain/model/cp_m/level.go +++ b/domain/model/cp_m/level.go @@ -277,10 +277,10 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N } // 赠送cp头像头饰 if oldLevel < 3 && cpLevel.Level >= 3 { - if err := headwear_tx.SendHeadwear(model, cpRelation.UserId1, 2571, 30); err != nil { + if err := headwear_tx.SendHeadwear(model, cpRelation.UserId1, cp_e.CpHeadwearId, 30); err != nil { return err } - if err := headwear_tx.SendHeadwear(model, cpRelation.UserId2, 2571, 30); err != nil { + if err := headwear_tx.SendHeadwear(model, cpRelation.UserId2, cp_e.CpHeadwearId, 30); err != nil { return err } } diff --git a/route/cp_r/cp_relation.go b/route/cp_r/cp_relation.go index ac7243e..b274afb 100644 --- a/route/cp_r/cp_relation.go +++ b/route/cp_r/cp_relation.go @@ -376,6 +376,9 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) { Msg: content, Status: 2, }) + // 删除cp头饰 + _ = headwear_tx.DelHeadwear(model, myUser.ID, cp_e.CpHeadwearId) + _ = headwear_tx.DelHeadwear(model, user2.ID, cp_e.CpHeadwearId) } if err := tencentyun.BatchSendCustomMsg(model, 1, myUser.ExternalId, []string{user2.ExternalId}, string(msgData), "cp解除"); err != nil { model.Log.Errorf("ReplyCpCancel BatchSendCustomMsg fail:%v", err) -- 2.22.0