From e00f9b89c12fb31af5609bcc856d34f55db06c4b Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Fri, 14 Apr 2023 15:28:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constDef.go | 1 + domain/service/diamond_s/diamond.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/constDef.go b/common/constDef.go index 5b041b5..0565715 100644 --- a/common/constDef.go +++ b/common/constDef.go @@ -107,6 +107,7 @@ const ( MSG_ID_BUY_FROM_FAMILY MsgIdType = 167 // 请向本家族代理购买钻石 MSG_ID_NEED_JOIN_FAMILY MsgIdType = 168 // 请加入代理的家族后进行购买 MSG_ID_SET_FAMILY_NAMEPL MsgIdType = 169 // 等级不够不能修改家族铭牌 + MSG_ID_CHARGE_NO_AREA MsgIdType = 181 // 充值(代理转账,用户给代理充值),失败,不是本区域用户 ADD_GROUP_FAILED AddGroupResultType = 0 ADD_GROUP_DONE AddGroupResultType = 1 diff --git a/domain/service/diamond_s/diamond.go b/domain/service/diamond_s/diamond.go index dc1a446..3ed3c4c 100644 --- a/domain/service/diamond_s/diamond.go +++ b/domain/service/diamond_s/diamond.go @@ -38,7 +38,7 @@ func (this *DiamondService) CheckDealerTransferFamilyLimit(dealerId, userId uint return err } if dealerArea != area { - return bizerr.DealerCannotSaleToOtherArea + return myerr.WrapErr(res_m.GetErrByLanguage(model.Db, common.MSG_ID_CHARGE_NO_AREA, lang, bizerr.DealerCannotSaleToOtherArea)) } // 代理、用户是否加入了家族 -- 2.22.0 From 333269a1238d4ca2a3c06d1c3c01cca2a11925e4 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Fri, 14 Apr 2023 15:59:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/middleHandle.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/route/middleHandle.go b/route/middleHandle.go index 62f2170..0d0652c 100644 --- a/route/middleHandle.go +++ b/route/middleHandle.go @@ -102,6 +102,12 @@ func LoggerHandle(c *gin.Context) { c.Set(mycontext.APP_VERSION, appVersion) c.Set(mycontext.URL, reqUri) c.Set(mycontext.METHOD, method) + lang := header.Get(mycontext.LANGUAGE) + c.Set(mycontext.LANGUAGE, lang) + carrier := header.Get(mycontext.CARRIER) + c.Set(mycontext.CARRIER, carrier) + timezone := header.Get(mycontext.TIMEZONE) + c.Set(mycontext.TIMEZONE, timezone) userId, _ := req.GetUserId(c) -- 2.22.0 From 5880cbcaa96f7b69920a6f9dffcb1636ccf9f6b9 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Tue, 18 Apr 2023 14:46:05 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=BC=80=E6=96=8B=E8=8A=82=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/mic_m/mic.go | 2 +- domain/service/event_s/event_init.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/domain/model/mic_m/mic.go b/domain/model/mic_m/mic.go index d83f144..36d51a5 100644 --- a/domain/model/mic_m/mic.go +++ b/domain/model/mic_m/mic.go @@ -25,7 +25,7 @@ type UserOnMic struct { // 允许返回gorm.ErrRecordNotFound func GetUserOnMic(model *domain.Model, userId mysql.ID, tz timezone_e.Timezone) (*UserOnMic, error) { res := new(UserOnMic) - day := time.Now().Format("2006-01-02") + day := time.Now().In(timezone_e.TimezoneLocMap[tz]).Format("2006-01-02") if err := model.DB().Where("date = ? AND user_id = ? AND tz = ?", day, userId, tz).First(res).Error; err != nil { return nil, err } diff --git a/domain/service/event_s/event_init.go b/domain/service/event_s/event_init.go index dcbfbd5..ca3d376 100644 --- a/domain/service/event_s/event_init.go +++ b/domain/service/event_s/event_init.go @@ -553,6 +553,8 @@ func OnMic() { } else { model.Log.Infof("cron micIn IncrUserOnMic success,userId:%v", event.UserId) } + // 处理活动数据 + go rpc.AddActPoint(model, event.UserId, 1) return nil }) } -- 2.22.0 From fbd791a1f7187c6b855248020c4932b7a70376af Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Tue, 18 Apr 2023 15:52:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=BC=80=E6=96=8B=E8=8A=82=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/group_s/group_op.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/domain/service/group_s/group_op.go b/domain/service/group_s/group_op.go index 6618d9e..55efac5 100644 --- a/domain/service/group_s/group_op.go +++ b/domain/service/group_s/group_op.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "git.hilo.cn/hilo-common/domain" + "git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/resource/config" "git.hilo.cn/hilo-common/resource/mysql" @@ -120,6 +121,7 @@ func (s *GroupService) LeaveGroupMember(model *domain.Model, groupId string, use func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid string, password, imei, ip string, provider group_e.GroupProvider) (string, string, error) { var channelId string var token string + var rideId uint64 err := s.svc.Transactional(func() error { //检查群组是否存在, 没有真正的domel,直接service上怼 model := domain.CreateModel(s.svc.CtxAndDb) @@ -245,6 +247,7 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin NobleLevel: nobleLevel, Svip: rpc.CopySimpleSvip(svip), } + rideId = r.RideId buf, err := json.Marshal(r) if err == nil { @@ -276,6 +279,7 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin if err != nil { return "", "", err } else { + go dealActDataAfterEnterRoom(s.svc.MyContext, userId, rideId) return channelId, token, nil } } @@ -453,3 +457,11 @@ func (s *GroupService) GroupClearScreenByMgr(groupId string, userId uint64) erro signal_s.SendSignalMsg(model, groupId, systemMsg, false) return nil } + +func dealActDataAfterEnterRoom(myContext *mycontext.MyContext, userId, rideId uint64) { + defer utils.CheckGoPanic() + if rideId == 1241 { + // 处理活动数据 + go rpc.AddActPoint(domain.CreateModelContext(myContext), userId, 5) + } +} -- 2.22.0 From 3e2a6206253ad5ef648cb828e9dcb57ebbbab8c0 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Tue, 18 Apr 2023 17:27:51 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=BC=80=E6=96=8B=E8=8A=82=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/event_s/event_init.go | 2 +- domain/service/group_s/group_op.go | 8 ++++---- route/group_r/group_op.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/domain/service/event_s/event_init.go b/domain/service/event_s/event_init.go index ca3d376..5a79f0f 100644 --- a/domain/service/event_s/event_init.go +++ b/domain/service/event_s/event_init.go @@ -554,7 +554,7 @@ func OnMic() { model.Log.Infof("cron micIn IncrUserOnMic success,userId:%v", event.UserId) } // 处理活动数据 - go rpc.AddActPoint(model, event.UserId, 1) + go rpc.AddActPoint(model, event.UserId, 1, 0) return nil }) } diff --git a/domain/service/group_s/group_op.go b/domain/service/group_s/group_op.go index 55efac5..cbf7148 100644 --- a/domain/service/group_s/group_op.go +++ b/domain/service/group_s/group_op.go @@ -118,7 +118,7 @@ func (s *GroupService) LeaveGroupMember(model *domain.Model, groupId string, use } //进入房间, 返回channelId, err -func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid string, password, imei, ip string, provider group_e.GroupProvider) (string, string, error) { +func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid string, password, imei, ip string, provider group_e.GroupProvider, roomId int64) (string, string, error) { var channelId string var token string var rideId uint64 @@ -279,7 +279,7 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin if err != nil { return "", "", err } else { - go dealActDataAfterEnterRoom(s.svc.MyContext, userId, rideId) + go dealActDataAfterEnterRoom(s.svc.MyContext, userId, rideId, roomId) return channelId, token, nil } } @@ -458,10 +458,10 @@ func (s *GroupService) GroupClearScreenByMgr(groupId string, userId uint64) erro return nil } -func dealActDataAfterEnterRoom(myContext *mycontext.MyContext, userId, rideId uint64) { +func dealActDataAfterEnterRoom(myContext *mycontext.MyContext, userId, rideId uint64, roomId int64) { defer utils.CheckGoPanic() if rideId == 1241 { // 处理活动数据 - go rpc.AddActPoint(domain.CreateModelContext(myContext), userId, 5) + go rpc.AddActPoint(domain.CreateModelContext(myContext), userId, 5, roomId) } } diff --git a/route/group_r/group_op.go b/route/group_r/group_op.go index f1d7d60..f3839ac 100644 --- a/route/group_r/group_op.go +++ b/route/group_r/group_op.go @@ -1777,7 +1777,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { } } - if channelId, token, err := group_s.NewGroupService(myContext).GroupIn(userId, externalId, groupId, password, imei, ip, provider); err != nil { + if channelId, token, err := group_s.NewGroupService(myContext).GroupIn(userId, externalId, groupId, password, imei, ip, provider, gi.Id); err != nil { return myContext, err } else { // 加入房间缓存 -- 2.22.0 From d02c433b22314a764be719915ac149c640d54430 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 20 Apr 2023 18:41:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=BC=80=E6=96=8B=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/group_s/group_op.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/service/group_s/group_op.go b/domain/service/group_s/group_op.go index cbf7148..433e0b8 100644 --- a/domain/service/group_s/group_op.go +++ b/domain/service/group_s/group_op.go @@ -460,7 +460,7 @@ func (s *GroupService) GroupClearScreenByMgr(groupId string, userId uint64) erro func dealActDataAfterEnterRoom(myContext *mycontext.MyContext, userId, rideId uint64, roomId int64) { defer utils.CheckGoPanic() - if rideId == 1241 { + if rideId == 1261 { // 处理活动数据 go rpc.AddActPoint(domain.CreateModelContext(myContext), userId, 5, roomId) } -- 2.22.0