From 24885902af889db722bb4bcfd7257779b9c397cf Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 25 Aug 2022 11:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=20=E5=90=AF=E5=8A=A8=E6=8E=A5=E5=8F=A3=E8=A2=AB?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E6=89=A7=E8=A1=8C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/chat/api_chanagechannel.go | 3 +++ modules/chat/api_crosschannel.go | 3 +++ modules/chat/api_getlist.go | 5 +++++ modules/equipment/api_upgrade.go | 1 - modules/equipment/module.go | 5 ++--- sys/configure/configure.go | 3 +-- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/chat/api_chanagechannel.go b/modules/chat/api_chanagechannel.go index fa90696c0..c755eaca9 100644 --- a/modules/chat/api_chanagechannel.go +++ b/modules/chat/api_chanagechannel.go @@ -9,6 +9,9 @@ import ( //参数校验 func (this *apiComp) ChanageChannelCheck(session comm.IUserSession, req *pb.ChatChanageChannelReq) (code pb.ErrorCode) { + if req.ChannelId < 0 { + code = pb.ErrorCode_ReqParameterError + } return } diff --git a/modules/chat/api_crosschannel.go b/modules/chat/api_crosschannel.go index 02d78f264..261921a15 100644 --- a/modules/chat/api_crosschannel.go +++ b/modules/chat/api_crosschannel.go @@ -19,6 +19,9 @@ func (this *apiComp) CrossChannel(session comm.IUserSession, req *pb.ChatCrossCh channel int32 err error ) + if code = this.CrossChannelCheck(session, req); code != pb.ErrorCode_Success { + return + } if channel, err = this.module.modelChat.AddCrossChannelMember(session); err != nil { code = pb.ErrorCode_DBError return diff --git a/modules/chat/api_getlist.go b/modules/chat/api_getlist.go index 9eb274e7e..4159c5e78 100644 --- a/modules/chat/api_getlist.go +++ b/modules/chat/api_getlist.go @@ -22,6 +22,11 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq) result *pb.DBUserExpand list []*pb.DBChat ) + + if code = this.GetListCheck(session, req); code != pb.ErrorCode_Success { + return + } + switch req.Channel { case pb.ChatChannel_World: if list, err = this.module.modelChat.getChatQueue(req.Channel, session.GetServiecTag(), "", 0); err != nil { diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index e656c36e0..8fcb06091 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -16,7 +16,6 @@ import ( func (this *apiComp) UpgradeCheck(session comm.IUserSession, req *pb.EquipmentUpgradeReq) (code pb.ErrorCode) { if req.EquipmentId == "" { - this.module.Errorf("Upgrade 请求参数错误 req:%v", req) code = pb.ErrorCode_ReqParameterError return } diff --git a/modules/equipment/module.go b/modules/equipment/module.go index 0635a5984..c2c2901e9 100644 --- a/modules/equipment/module.go +++ b/modules/equipment/module.go @@ -8,7 +8,6 @@ import ( "go_dreamfactory/pb" "github.com/go-redis/redis/v8" - "github.com/smallnest/rpcx/log" ) /* @@ -68,7 +67,7 @@ func (this *Equipment) EventUserOffline(session comm.IUserSession) { func (this *Equipment) QueryEquipment(source *comm.ModuleCallSource, uid string, id string) (equipment *pb.DB_Equipment, code pb.ErrorCode) { var err error if uid == "" || id == "" { - log.Errorf("请求参数错误 uid:%s Id:%s", uid, id) + this.Errorf("请求参数错误 uid:%s Id:%s", uid, id) code = pb.ErrorCode_ReqParameterError return } @@ -95,7 +94,7 @@ func (this *Equipment) AddNewEquipments(source *comm.ModuleCallSource, session c change []*pb.DB_Equipment ) if change, err = this.modelEquipment.AddEquipments(session.GetUserId(), cIds); err != nil { - log.Errorf("err%v", err) + this.Errorf("err%v", err) code = pb.ErrorCode_SystemError return } diff --git a/sys/configure/configure.go b/sys/configure/configure.go index 6c5557f99..71b2b36a3 100644 --- a/sys/configure/configure.go +++ b/sys/configure/configure.go @@ -31,7 +31,6 @@ func newSys(options Options) (sys *Configure, err error) { configure: make(map[string]interface{}), fileinfos: make(map[string]*FileInfo), } - sys.Start() return } @@ -193,7 +192,7 @@ func (this *Configure) checkConfigure() { } for _, v := range handle.events { if v != nil { - v() + go v() } } }