From 263747a760ab0a7c9abf7de9a5bb6e0d09f89521 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 28 Dec 2022 10:09:05 +0800 Subject: [PATCH] =?UTF-8?q?bingo=E7=8E=A9=E5=AE=B6lv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 4 +++- modules/user/module.go | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index 5648fd7b3..9b9c0401e 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -121,6 +121,8 @@ type ( SearchRmoteUser(nickname string) ([]*pb.DBUser, error) // 检查是不是新获得的英雄 CheckTujianHero(session IUserSession, heros []string) []bool + // bingo设置玩家等级 + BingoSetUserLv(session IUserSession, lv int32) error } //武器模块 IEquipment interface { @@ -271,7 +273,7 @@ type ( MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo) // 设置工会经验 BingoSetExp(session IUserSession, exp int32) error - // 设置工会经验 + // 设置工会活跃度 BingoSetActivity(session IUserSession, activity int32) error ///红点 IReddot diff --git a/modules/user/module.go b/modules/user/module.go index 2f6e74134..6eac79c81 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -580,3 +580,14 @@ func (this *User) CheckTujianHero(session comm.IUserSession, heros []string) []b } return sz } + +func (this *User) BingoSetUserLv(session comm.IUserSession, lv int32) error { + if lv <= 0 { + return comm.NewCustomError(pb.ErrorCode_ReqParameterError) + } + update := map[string]interface{}{ + "lv": lv, + "exp": 0, + } + return this.modelUser.Change(session.GetUserId(), update) +}