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() } } }