diff --git a/modules/arena/api_buy.go b/modules/arena/api_buy.go index 75d8e48a1..61887fa82 100644 --- a/modules/arena/api_buy.go +++ b/modules/arena/api_buy.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.ArenaBuyReq) (errdata *pb.ErrorData) { if req.BuyNum == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/arena/api_challenge.go b/modules/arena/api_challenge.go index b65da8313..0fddb5ab0 100644 --- a/modules/arena/api_challenge.go +++ b/modules/arena/api_challenge.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.ArenaChallengeReq) (errdata *pb.ErrorData) { if (!req.Isai && req.Playerid == "") || (req.Isai && req.MformatId == 0) || req.Battle.Format == nil || len(req.Battle.Format) != 5 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/arena/api_delreward.go b/modules/arena/api_delreward.go index 5c835f81f..53e91fe41 100644 --- a/modules/arena/api_delreward.go +++ b/modules/arena/api_delreward.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) DelRewardCheck(session comm.IUserSession, req *pb.ArenaDelRewardReq) (errdata *pb.ErrorData) { if req.Bid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/arena/api_otherinfo.go b/modules/arena/api_otherinfo.go index b663c2f2a..4f302ee2a 100644 --- a/modules/arena/api_otherinfo.go +++ b/modules/arena/api_otherinfo.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) OtherInfoCheck(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (errdata *pb.ErrorData) { if req.OtherId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/arena/api_plotreward.go b/modules/arena/api_plotreward.go index 1714f8eb8..41ac57d46 100644 --- a/modules/arena/api_plotreward.go +++ b/modules/arena/api_plotreward.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) PlotRewardCheck(session comm.IUserSession, req *pb.ArenaPlotRewardReq) (errdata *pb.ErrorData) { if req.Pid == 0 || req.Report == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/atlas/api_atlasactivate.go b/modules/atlas/api_atlasactivate.go index b0ba82865..8d5f65c79 100644 --- a/modules/atlas/api_atlasactivate.go +++ b/modules/atlas/api_atlasactivate.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ActivateCheck(session comm.IUserSession, req *pb.AtlasActivateReq) (errdata *pb.ErrorData) { if req.Id == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index e3610f956..b6206b12d 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -748,7 +748,10 @@ func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (capt this.module.Error("on found battle req data", log.Field{Key: "HeroId", Value: v.Heroid}, ) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } else { roles[i] = &pb.BattleRole{ diff --git a/modules/battle/module.go b/modules/battle/module.go index acf5ceeda..6e69b438a 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -130,11 +130,17 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE return } if req.Format == nil || req.Format.Format == nil || len(req.Format.Format) != 5 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if req.Format.Friendformat != nil && len(req.Format.Friendformat) != 5 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } for _, v := range req.Format.Friendformat { if v != "" { @@ -170,7 +176,10 @@ func (this *Battle) CreatePvbBattle(session comm.IUserSession, req *pb.BattlePVB return } if req.Format == nil || len(req.Format) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if record, code = this.modelBattle.createpvb(session, conn, pb.BattleType_pvb, req); code != pb.ErrorCode_Success { @@ -243,11 +252,17 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP return } if req.Format == nil || req.Format.Format == nil || len(req.Format.Format) != 5 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if req.Format.Friendformat != nil && len(req.Format.Friendformat) != 5 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } for _, v := range req.Format.Friendformat { if v != "" { diff --git a/modules/buried/api_send.go b/modules/buried/api_send.go index 690777763..0920fd59c 100644 --- a/modules/buried/api_send.go +++ b/modules/buried/api_send.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) SendCheck(session comm.IUserSession, req *pb.BuriedInquireProgressReq) (errdata *pb.ErrorData) { if len(req.Conditions) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index be7b8b302..5823788c4 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) BuyOrSellCheck(session comm.IUserSession, req *pb.CaravanBuyOrSellReq) (errdata *pb.ErrorData) { if len(req.Items) == 0 || req.City == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/caravan/api_getstory.go b/modules/caravan/api_getstory.go index 55e20103b..9b814b5fc 100644 --- a/modules/caravan/api_getstory.go +++ b/modules/caravan/api_getstory.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) GetStoryCheck(session comm.IUserSession, req *pb.CaravanGetStoryReq) (errdata *pb.ErrorData) { if req.Cid == 0 || req.Citystory == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -37,7 +40,10 @@ func (this *apiComp) GetStory(session comm.IUserSession, req *pb.CaravanGetStory return } if list.Eventid != req.Cid { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if req.Citystory == conf.Citynormal { //接受剧情 diff --git a/modules/caravan/api_gotocity.go b/modules/caravan/api_gotocity.go index ea2bb4752..f29672420 100644 --- a/modules/caravan/api_gotocity.go +++ b/modules/caravan/api_gotocity.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) GotoCityCheck(session comm.IUserSession, req *pb.CaravanGotoCityReq) (errdata *pb.ErrorData) { if req.City == 0 || req.Ticket <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/chat/api_chanagechannel.go b/modules/chat/api_chanagechannel.go index 181a3bd57..6b03e02c7 100644 --- a/modules/chat/api_chanagechannel.go +++ b/modules/chat/api_chanagechannel.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ChanageChannelCheck(session comm.IUserSession, req *pb.ChatChanageChannelReq) (errdata *pb.ErrorData) { if req.ChannelId < 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/chat/api_getlist.go b/modules/chat/api_getlist.go index 8f0d9ab5b..e718ac2b1 100644 --- a/modules/chat/api_getlist.go +++ b/modules/chat/api_getlist.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ChatGetListReq) (errdata *pb.ErrorData) { if req.Channel == pb.ChatChannel_CrossServer && req.ChannelId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -68,7 +71,10 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq) return } if req.ChannelId != result.Chatchannel { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: fmt.Sprintf("req.ChannelId:%d != result.Chatchannel:%d", req.ChannelId, result.Chatchannel), @@ -97,7 +103,10 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq) default: this.module.Errorf("不存在的聊天频道类型channel:%d ", req.Channel) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: fmt.Sprintf("不存在的聊天频道类型 channel:%d ", req.Channel), diff --git a/modules/chat/api_send.go b/modules/chat/api_send.go index 4b0d41451..668c65c13 100644 --- a/modules/chat/api_send.go +++ b/modules/chat/api_send.go @@ -14,7 +14,10 @@ import ( //参数校验 func (this *apiComp) SendCheck(session comm.IUserSession, req *pb.ChatSendReq) (errdata *pb.ErrorData) { if (req.Channel == pb.ChatChannel_Union && req.TargetId == "") || (req.Channel == pb.ChatChannel_Private && req.TargetId == "") { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -116,7 +119,10 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (errda break default: this.module.Errorf("不存在的聊天频道类型channel:%d ", req.Channel) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: fmt.Sprintf("不存在的聊天频道类型 channel:%d ", req.Channel), diff --git a/modules/combat/api_ask.go b/modules/combat/api_ask.go index 552349202..48e7830ee 100644 --- a/modules/combat/api_ask.go +++ b/modules/combat/api_ask.go @@ -39,7 +39,10 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda if level, ok = info.Level[req.Level]; !ok { err = fmt.Errorf("没有初始化指定关卡数据:%d", req.Level) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: err.Error(), diff --git a/modules/combat/api_challengereceive.go b/modules/combat/api_challengereceive.go index f029163f5..37973dc22 100644 --- a/modules/combat/api_challengereceive.go +++ b/modules/combat/api_challengereceive.go @@ -43,7 +43,10 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC if lv, ok = info.Level[req.Level]; !ok { err = fmt.Errorf("没有目标关卡数据 req.Level: %d", req.Level) this.module.Errorln(err) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: err.Error(), @@ -60,7 +63,10 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC } for _, v := range lv.Passmanster { if v == req.Manster { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: fmt.Sprintf("req.Manster:%d 重复", code), diff --git a/modules/combat/api_drop.go b/modules/combat/api_drop.go index c08a7f843..40a2fc211 100644 --- a/modules/combat/api_drop.go +++ b/modules/combat/api_drop.go @@ -31,7 +31,10 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err return } if lv, ok = info.Level[req.Level]; !ok { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Errorf("no in Level:%s", req.Level) return } @@ -42,7 +45,10 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err } for _, v := range lv.Passdrop { if v == req.Drop { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } } diff --git a/modules/combat/api_updatelevel.go b/modules/combat/api_updatelevel.go index 67dc87f0b..e57112b3b 100644 --- a/modules/combat/api_updatelevel.go +++ b/modules/combat/api_updatelevel.go @@ -27,7 +27,10 @@ func (this *apiComp) UpdateLevel(session comm.IUserSession, req *pb.CombatUpdate return } if level, ok = info.Level[req.Level]; !ok { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Errorf("no in Level:%s", req.Level) return } diff --git a/modules/dispatch/api_do.go b/modules/dispatch/api_do.go index 6c7d5f0ce..3f407ff6a 100644 --- a/modules/dispatch/api_do.go +++ b/modules/dispatch/api_do.go @@ -12,13 +12,19 @@ import ( func (a *apiComp) DoCheck(session comm.IUserSession, req *pb.DispatchDoReq) (errdata *pb.ErrorData) { if len(req.HeroIds) == 0 || req.TaskId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for _, h := range req.HeroIds { if h == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } } diff --git a/modules/dispatch/api_receive.go b/modules/dispatch/api_receive.go index bb7dbf966..e2f0ba9c5 100644 --- a/modules/dispatch/api_receive.go +++ b/modules/dispatch/api_receive.go @@ -10,7 +10,10 @@ import ( func (a *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.DispatchReceiveReq) (errdata *pb.ErrorData) { if req.TaskId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/dispatch/api_week.go b/modules/dispatch/api_week.go index aebd7f045..0cb789da8 100644 --- a/modules/dispatch/api_week.go +++ b/modules/dispatch/api_week.go @@ -7,7 +7,10 @@ import ( func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (errdata *pb.ErrorData) { if req.Idx == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/enchant/api_buy.go b/modules/enchant/api_buy.go index 95e66934c..2ab66b313 100644 --- a/modules/enchant/api_buy.go +++ b/modules/enchant/api_buy.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.EnchantBuyReq) (errdata *pb.ErrorData) { if req.Count <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/enchant/api_challenge.go b/modules/enchant/api_challenge.go index 6cd81a532..e21dca8e8 100644 --- a/modules/enchant/api_challenge.go +++ b/modules/enchant/api_challenge.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.EnchantChallengeReq) (errdata *pb.ErrorData) { if req.BossType <= 0 || req.Battle == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/enchant/api_challengeover.go b/modules/enchant/api_challengeover.go index 2d3759ea7..28b442d6a 100644 --- a/modules/enchant/api_challengeover.go +++ b/modules/enchant/api_challengeover.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.EnchantChallengeOverReq) (errdata *pb.ErrorData) { if req.BossType <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/equipment/api_ench.go b/modules/equipment/api_ench.go index 21abc4092..79eb712e9 100644 --- a/modules/equipment/api_ench.go +++ b/modules/equipment/api_ench.go @@ -12,7 +12,10 @@ import ( //参数校验 func (this *apiComp) EnchCheck(session comm.IUserSession, req *pb.EquipmentEnchReq) (errdata *pb.ErrorData) { if req.Eid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -60,7 +63,10 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) ( return } if equip.AdverbEntry[req.Index] == nil || equip.AdverbEntry[req.Index].AttrName != conf.Attrkey { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: req.String(), diff --git a/modules/equipment/api_equip.go b/modules/equipment/api_equip.go index 04e6e6960..ba4768c9b 100644 --- a/modules/equipment/api_equip.go +++ b/modules/equipment/api_equip.go @@ -12,7 +12,10 @@ import ( //参数校验 func (this *apiComp) EquipCheck(session comm.IUserSession, req *pb.EquipmentEquipReq) (errdata *pb.ErrorData) { if len(req.EquipmentId) != 8 || req.HeroCardId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/equipment/api_forg.go b/modules/equipment/api_forg.go index f3fd0534d..4dded0d7c 100644 --- a/modules/equipment/api_forg.go +++ b/modules/equipment/api_forg.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ForgCheck(session comm.IUserSession, req *pb.EquipmentForgReq) (errdata *pb.ErrorData) { if req.Forgid == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/equipment/api_lock.go b/modules/equipment/api_lock.go index 07c1c9853..d4e3ada62 100644 --- a/modules/equipment/api_lock.go +++ b/modules/equipment/api_lock.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) LockCheck(session comm.IUserSession, req *pb.EquipmentLockReq) (errdata *pb.ErrorData) { if req.EquipmentId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/equipment/api_sellI.go b/modules/equipment/api_sellI.go index 7dc42cecf..2ec6bdc78 100644 --- a/modules/equipment/api_sellI.go +++ b/modules/equipment/api_sellI.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) SellCheck(session comm.IUserSession, req *pb.EquipmentSellReq) (errdata *pb.ErrorData) { if req.EquipIds == nil || len(req.EquipIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -28,7 +31,10 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.EquipmentSellReq) ( return } if equipments, err = this.module.modelEquipment.QueryUserEquipmentsByIds(session.GetUserId(), req.EquipIds); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: err.Error(), diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index 5b3bd07f1..fe30095c7 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -15,7 +15,10 @@ import ( //参数校验 func (this *apiComp) UpgradeCheck(session comm.IUserSession, req *pb.EquipmentUpgradeReq) (errdata *pb.ErrorData) { if req.EquipmentId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/equipment/api_wash.go b/modules/equipment/api_wash.go index 8e6ca6a23..c0a0ecf5a 100644 --- a/modules/equipment/api_wash.go +++ b/modules/equipment/api_wash.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) WashCheck(session comm.IUserSession, req *pb.EquipmentWashReq) (errdata *pb.ErrorData) { if req.Eid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/equipment/api_washconfirm.go b/modules/equipment/api_washconfirm.go index 1cf137ade..c80b05542 100644 --- a/modules/equipment/api_washconfirm.go +++ b/modules/equipment/api_washconfirm.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) WashConfirmCheck(session comm.IUserSession, req *pb.EquipmentWashConfirmReq) (errdata *pb.ErrorData) { if req.Eid == "" || req.Pids == nil || len(req.Pids) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -39,7 +42,10 @@ func (this *apiComp) WashConfirm(session comm.IUserSession, req *pb.EquipmentWas return } if len(equip.AdverbEntry) != len(req.Pids) { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), } diff --git a/modules/equipment/module.go b/modules/equipment/module.go index 31607b97e..5b5fb5269 100644 --- a/modules/equipment/module.go +++ b/modules/equipment/module.go @@ -79,7 +79,10 @@ func (this *Equipment) QueryEquipment(uid string, id string) (equipment *pb.DB_E var err error if uid == "" || id == "" { this.Errorf("请求参数错误 uid:%s Id:%s", uid, id) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if equipment, err = this.modelEquipment.QueryUserEquipmentsById(uid, id); err != nil { @@ -97,7 +100,10 @@ func (this *Equipment) QueryEquipments(uid string) (equipment []*pb.DB_Equipment var err error if uid == "" { this.Errorf("请求参数错误 uid:%s ", uid) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if equipment, err = this.modelEquipment.QueryUserEquipments(uid); err != nil { @@ -229,7 +235,10 @@ func (this *Equipment) SellEquipments(session comm.IUserSession, equs []string) sale [][]*cfg.Gameatn ) if equipments, err = this.modelEquipment.QueryUserEquipmentsByIds(session.GetUserId(), equs); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } confs = make([]*cfg.GameEquipData, len(equipments)) @@ -283,7 +292,10 @@ func (this *Equipment) RecycleEquipments(session comm.IUserSession, equs []strin sale [][]*cfg.Gameatn ) if equipments, err = this.modelEquipment.QueryUserEquipmentsByIds(session.GetUserId(), equs); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } confs = make([]*cfg.GameEquipData, len(equipments)) diff --git a/modules/forum/api_getlist.go b/modules/forum/api_getlist.go index 4fd89635e..b08323b48 100644 --- a/modules/forum/api_getlist.go +++ b/modules/forum/api_getlist.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ForumGetListReq) (errdata *pb.ErrorData) { if req.Herocid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/forum/api_like.go b/modules/forum/api_like.go index 453c2e558..10d6e6e6e 100644 --- a/modules/forum/api_like.go +++ b/modules/forum/api_like.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) LikeCheck(session comm.IUserSession, req *pb.ForumLikeReq) (errdata *pb.ErrorData) { if req.Herocid == "" || req.Cid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/forum/api_releasecomment.go b/modules/forum/api_releasecomment.go index bf648bd94..6db12808f 100644 --- a/modules/forum/api_releasecomment.go +++ b/modules/forum/api_releasecomment.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) ReleaseCommentCheck(session comm.IUserSession, req *pb.ForumReleaseCommentReq) (errdata *pb.ErrorData) { if req.Herocid == "" || req.Herooid == "" || req.Content == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/forum/api_watchhero.go b/modules/forum/api_watchhero.go index 66585acca..0ec91a08f 100644 --- a/modules/forum/api_watchhero.go +++ b/modules/forum/api_watchhero.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) WatchHeroCheck(session comm.IUserSession, req *pb.ForumWatchHeroReq) (errdata *pb.ErrorData) { if req.Uid == "" || req.HerocId == "" || req.HerooId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/friend/api_cross_accept.go b/modules/friend/api_cross_accept.go index 55daa30ca..4d8e18f1c 100644 --- a/modules/friend/api_cross_accept.go +++ b/modules/friend/api_cross_accept.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) AcceptCheck(session comm.IUserSession, req *pb.FriendAcceptReq) (errdata *pb.ErrorData) { if req.Uid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/friend/api_cross_addblack.go b/modules/friend/api_cross_addblack.go index 022a37849..3a845a204 100644 --- a/modules/friend/api_cross_addblack.go +++ b/modules/friend/api_cross_addblack.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.FriendAddBlackReq) (errdata *pb.ErrorData) { if req.FriendId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("加入黑名单参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_agree.go b/modules/friend/api_cross_agree.go index 8df12366a..36932903b 100644 --- a/modules/friend/api_cross_agree.go +++ b/modules/friend/api_cross_agree.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.FriendAgreeReq) (errdata *pb.ErrorData) { if len(req.FriendIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("好友审批同意参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } diff --git a/modules/friend/api_cross_apply.go b/modules/friend/api_cross_apply.go index d3739453e..3c9894df7 100644 --- a/modules/friend/api_cross_apply.go +++ b/modules/friend/api_cross_apply.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.FriendApplyReq) (errdata *pb.ErrorData) { if req.FriendId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("好友申请参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_assisthero.go b/modules/friend/api_cross_assisthero.go index 506826172..07419bec2 100644 --- a/modules/friend/api_cross_assisthero.go +++ b/modules/friend/api_cross_assisthero.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) AssistheroCheck(session comm.IUserSession, req *pb.FriendAssistheroReq) (errdata *pb.ErrorData) { if req.HeroObjId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("设置助战英雄参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_del.go b/modules/friend/api_cross_del.go index d9f7e4de3..7ce7bb495 100644 --- a/modules/friend/api_cross_del.go +++ b/modules/friend/api_cross_del.go @@ -10,7 +10,10 @@ import ( // 删除好友 func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.FriendDelReq) (errdata *pb.ErrorData) { if req.FriendId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("删除好友参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_delblack.go b/modules/friend/api_cross_delblack.go index 624c60657..346926d02 100644 --- a/modules/friend/api_cross_delblack.go +++ b/modules/friend/api_cross_delblack.go @@ -10,7 +10,10 @@ import ( // 删除黑名单 func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.FriendDelBlackReq) (errdata *pb.ErrorData) { if req.FriendId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_getrelation.go b/modules/friend/api_cross_getrelation.go index 937d6090d..68fcc3101 100644 --- a/modules/friend/api_cross_getrelation.go +++ b/modules/friend/api_cross_getrelation.go @@ -10,7 +10,10 @@ import ( // 获取好友关系 func (this *apiComp) GetRelationCheck(session comm.IUserSession, req *pb.FriendGetRelationReq) (errdata *pb.ErrorData) { if req.TargetUid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_qiecuo.go b/modules/friend/api_cross_qiecuo.go index 963792c89..64dc1135d 100644 --- a/modules/friend/api_cross_qiecuo.go +++ b/modules/friend/api_cross_qiecuo.go @@ -9,7 +9,10 @@ import ( // 踢馆(熊猫武馆) func (this *apiComp) QiecuoCheck(session comm.IUserSession, req *pb.FriendQiecuoReq) (errdata *pb.ErrorData) { if req.TargetUid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/friend/api_cross_refuse.go b/modules/friend/api_cross_refuse.go index 46328e872..29d49c2fa 100644 --- a/modules/friend/api_cross_refuse.go +++ b/modules/friend/api_cross_refuse.go @@ -10,7 +10,10 @@ import ( // 好友审核-拒绝 func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.FriendRefuseReq) (errdata *pb.ErrorData) { if len(req.FriendIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } diff --git a/modules/friend/api_cross_zan.go b/modules/friend/api_cross_zan.go index 5f945710b..d42e213dd 100644 --- a/modules/friend/api_cross_zan.go +++ b/modules/friend/api_cross_zan.go @@ -10,7 +10,10 @@ import ( // 点赞 func (this *apiComp) ZanCheck(session comm.IUserSession, req *pb.FriendZanReq) (errdata *pb.ErrorData) { if len(req.FriendIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/friend/api_cross_zanreceive.go b/modules/friend/api_cross_zanreceive.go index 188d8c054..4fc02ae03 100644 --- a/modules/friend/api_cross_zanreceive.go +++ b/modules/friend/api_cross_zanreceive.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) ZanreceiveCheck(session comm.IUserSession, req *pb.FriendZanreceiveReq) (errdata *pb.ErrorData) { if len(req.FriendIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 66baa6776..63bb45f86 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -42,7 +42,10 @@ import ( //参数校验 func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) { if len(req.Cmod) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/gm/module.go b/modules/gm/module.go index e3c02e465..29b64a64d 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -72,7 +72,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er datas[0] == comm.HeroType || datas[0] == comm.EquipmentType || datas[0] == comm.VipType || datas[0] == comm.AtlasType || datas[0] == comm.PandaType || datas[0] == comm.MountsType) { num, err := strconv.Atoi(datas[2]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } code = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源 @@ -98,7 +101,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } code = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num)) @@ -214,7 +220,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num1, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } @@ -244,7 +253,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } module1.(comm.IArena).SetUserIntegral(session, int32(num)) @@ -260,7 +272,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } module1.(comm.ISociaty).BingoSetExp(session, int32(num)) @@ -276,7 +291,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } module1.(comm.ISociaty).BingoSetActivity(session, int32(num)) @@ -328,7 +346,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil { @@ -346,7 +367,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for i := 0; i < num; i++ { @@ -391,7 +415,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } else if len(datas) == 2 && (datas[0] == "chat") { // num, err := strconv.Atoi(datas[1]) // if err != nil { - // code = pb.ErrorCode_ReqParameterError + // errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } // return // } if module, err := this.service.GetModule(comm.ModuleChat); err == nil { @@ -407,12 +434,18 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } else if len(datas) == 3 && (datas[0] == "itemtype") { num1, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } num2, err := strconv.Atoi(datas[2]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } _data := this.configure.GetItemConfigureByType(int32(num1)) @@ -439,7 +472,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er } num, err := strconv.Atoi(datas[1]) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if err = module1.(comm.IUser).BingoSetUserVipLv(session, int32(num)); err == nil { diff --git a/modules/gourmet/api_activateatlas.go b/modules/gourmet/api_activateatlas.go index 7cc60687b..0259577a8 100644 --- a/modules/gourmet/api_activateatlas.go +++ b/modules/gourmet/api_activateatlas.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ActivateAtlasCheck(session comm.IUserSession, req *pb.GourmetActivateAtlasReq) (errdata *pb.ErrorData) { if req.Cid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return @@ -36,7 +39,10 @@ func (this *apiComp) ActivateAtlas(session comm.IUserSession, req *pb.GourmetAct return } if v, ok := _gourmet.Atlas[req.Cid]; !ok || v != -1 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } _gourmet.Atlas[req.Cid] = 1 diff --git a/modules/gourmet/api_createfood.go b/modules/gourmet/api_createfood.go index 8e880f9ed..9e7be8f51 100644 --- a/modules/gourmet/api_createfood.go +++ b/modules/gourmet/api_createfood.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) CreateFoodCheck(session comm.IUserSession, req *pb.GourmetCreateFoodReq) (errdata *pb.ErrorData) { if req.Cid == "" || len(req.Material) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -46,7 +49,10 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate }) } if len(res) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } // 构建消耗 diff --git a/modules/gourmet/api_getranduser.go b/modules/gourmet/api_getranduser.go index dcf16af7d..ca0f88197 100644 --- a/modules/gourmet/api_getranduser.go +++ b/modules/gourmet/api_getranduser.go @@ -16,7 +16,10 @@ import ( //参数校验 func (this *apiComp) GetRandUserCheck(session comm.IUserSession, req *pb.GourmetGetRandUserReq) (errdata *pb.ErrorData) { if req.People <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/growtask/api_advreceive.go b/modules/growtask/api_advreceive.go index 1d5d67d89..8729fde51 100644 --- a/modules/growtask/api_advreceive.go +++ b/modules/growtask/api_advreceive.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) AdvreceiveCheck(session comm.IUserSession, req *pb.GrowtaskAdvReceiveReq) (errdata *pb.ErrorData) { if req.TaskType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/growtask/api_receive.go b/modules/growtask/api_receive.go index c19b23ffb..3967d4b5d 100644 --- a/modules/growtask/api_receive.go +++ b/modules/growtask/api_receive.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.GrowtaskReceiveReq) (errdata *pb.ErrorData) { if req.TaskId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/growtask/api_tasklist.go b/modules/growtask/api_tasklist.go index fe593c25f..287ae2d00 100644 --- a/modules/growtask/api_tasklist.go +++ b/modules/growtask/api_tasklist.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.GrowtaskListReq) (errdata *pb.ErrorData) { if req.TaskType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 6c62b9767..e838bc61c 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) AwakenCheck(session comm.IUserSession, req *pb.HeroAwakenReq) (errdata *pb.ErrorData) { if req.HeroObjID == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/hero/api_buy.go b/modules/hero/api_buy.go index 3f6d40686..278e43f33 100644 --- a/modules/hero/api_buy.go +++ b/modules/hero/api_buy.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.HeroBuyReq) (errdata *pb.ErrorData) { if req.BuyType == 0 || req.BuyCount == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -67,7 +70,10 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (errdata totalCount = record.Tenbuy + req.BuyCount update["tenbuy"] = totalCount } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if totalCount > conf.Buymaxnum { // 购买达到上限 diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index c7d8a3bae..8604153a4 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) DrawCardCheck(session comm.IUserSession, req *pb.HeroDrawCardReq) (errdata *pb.ErrorData) { if req.DrawType < 0 && (req.DrawCount == 1 || req.DrawCount == 10) { // 只能是单抽或10抽 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index 4f90266af..44b79faf4 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) FusionCheck(session comm.IUserSession, req *pb.HeroFusionReq) (errdata *pb.ErrorData) { if req.HeroId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -41,7 +44,10 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (e totalCount += v } if totalCount != int32(len(conf.Pointhero)) { // 校验数量 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for k, v := range req.Heros { @@ -57,13 +63,19 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (e if _, ok := mapHero[v]; ok { mapHero[v] -= 1 } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } } for _, v := range mapHero { if v != 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } } diff --git a/modules/hero/api_info.go b/modules/hero/api_info.go index 996bfebcb..2ec1cfb32 100644 --- a/modules/hero/api_info.go +++ b/modules/hero/api_info.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.HeroInfoReq) (errdata *pb.ErrorData) { if len(req.HeroId) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/hero/api_lock.go b/modules/hero/api_lock.go index 177b0d0a1..a9d868297 100644 --- a/modules/hero/api_lock.go +++ b/modules/hero/api_lock.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) LockCheck(session comm.IUserSession, req *pb.HeroLockReq) (errdata *pb.ErrorData) { if req.Heroid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/hero/api_specified.go b/modules/hero/api_specified.go index 9645967db..eea560dfd 100644 --- a/modules/hero/api_specified.go +++ b/modules/hero/api_specified.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) GetSpecifiedCheck(session comm.IUserSession, req *pb.HeroGetSpecifiedReq) (errdata *pb.ErrorData) { if req.HeroCoinfigID == "" || req.Star <= 0 || req.Lv <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index ffeccf47d..864325d5a 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.HeroStrengthenUpSkillReq) (errdata *pb.ErrorData) { if req.HeroObjID == "" || len(req.Item) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 8e8062643..0109f73a0 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.HeroStrengthenUpStarReq) (errdata *pb.ErrorData) { if req.HeroObjID == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return diff --git a/modules/hero/api_strengthenUplv.go b/modules/hero/api_strengthenUplv.go index ca3551244..8c15dbb00 100644 --- a/modules/hero/api_strengthenUplv.go +++ b/modules/hero/api_strengthenUplv.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.HeroStrengthenUplvReq) (errdata *pb.ErrorData) { if req.HeroObjID == "" || len(req.Item) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 7ae1d255a..24894bb83 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) TalentLearnCheck(session comm.IUserSession, req *pb.HeroTalentLearnReq) (errdata *pb.ErrorData) { if req.TalentID <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -38,7 +41,10 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe } else { if req.Heroid == "" { // 英雄id不能为空 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } // 数据校验 diff --git a/modules/hero/api_talentreset.go b/modules/hero/api_talentreset.go index abe433801..35ac0b316 100644 --- a/modules/hero/api_talentreset.go +++ b/modules/hero/api_talentreset.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) TalentResetCheck(session comm.IUserSession, req *pb.HeroTalentResetReq) (errdata *pb.ErrorData) { if req.ObjId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/hero/module.go b/modules/hero/module.go index a28b84cca..7fbc17924 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -215,14 +215,20 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, // 等级校验 conf, _ := this.configure.GetHeroConfig(heroConfId) if conf == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } cid := heroConfId maxStar := conf.Star starConf, _ := this.configure.GetHeroStarupConfig(cid, conf.Star) if starConf == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } // 获取最大星级 @@ -230,7 +236,10 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, maxLv := this.configure.GetHeroMaxLv(maxStar) // 最大等级 if star > maxStar || lv > maxLv { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } hero, err := this.modelHero.createSpecialHero(session.GetUserId(), heroConfId) diff --git a/modules/horoscope/api_upgrade.go b/modules/horoscope/api_upgrade.go index fff6c23bd..65614c0d0 100644 --- a/modules/horoscope/api_upgrade.go +++ b/modules/horoscope/api_upgrade.go @@ -45,7 +45,10 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.HoroscopeUpgrade } } } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if code = this.module.ConsumeRes(session, conf.CostItem, true); code != pb.ErrorCode_Success { diff --git a/modules/hunting/api_buy.go b/modules/hunting/api_buy.go index c6226fcff..1ea409640 100644 --- a/modules/hunting/api_buy.go +++ b/modules/hunting/api_buy.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.HuntingBuyReq) (errdata *pb.ErrorData) { if req.Count <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/hunting/api_challenge.go b/modules/hunting/api_challenge.go index 1bd219d3b..b9cefdcec 100644 --- a/modules/hunting/api_challenge.go +++ b/modules/hunting/api_challenge.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.HuntingChallengeReq) (errdata *pb.ErrorData) { if req.BossType <= 0 && req.Difficulty > 0 || req.Battle == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index 507a56b7c..a59ea46e0 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.HuntingChallengeOverReq) (errdata *pb.ErrorData) { if req.BossType <= 0 && req.Difficulty > 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/items/api_buyphysical.go b/modules/items/api_buyphysical.go index 7ee28f3ad..98fc04510 100644 --- a/modules/items/api_buyphysical.go +++ b/modules/items/api_buyphysical.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) BuyPhysicalCheck(session comm.IUserSession, req *pb.ItemsBuyPhysicalReq) (errdata *pb.ErrorData) { if req.Amount <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -33,7 +36,10 @@ func (this *apiComp) BuyPhysical(session comm.IUserSession, req *pb.ItemsBuyPhys return } if user, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: req.String(), diff --git a/modules/items/api_buyunifiedticket.go b/modules/items/api_buyunifiedticket.go index f532194cf..908728d5c 100644 --- a/modules/items/api_buyunifiedticket.go +++ b/modules/items/api_buyunifiedticket.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) BuyUnifiedTicketCheck(session comm.IUserSession, req *pb.ItemsBuyUnifiedTicketReq) (errdata *pb.ErrorData) { if req.BuyNum <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/items/api_decompose.go b/modules/items/api_decompose.go index dc51b51c5..c44c103cf 100644 --- a/modules/items/api_decompose.go +++ b/modules/items/api_decompose.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) DecomposeCheck(session comm.IUserSession, req *pb.ItemsDecomposeReq) (errdata *pb.ErrorData) { if req.GridId == "" || req.Amount <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -27,7 +30,10 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose return } if item, err = this.module.modelItems.QueryUserPackByGridId(session.GetUserId(), req.GridId); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: err.Error(), @@ -68,7 +74,10 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose if req.Amount > item.Amount { this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: code.ToString(), Message: fmt.Sprintf("道具数量不足! 道具数量:%s", item.Amount), diff --git a/modules/items/api_sellItem.go b/modules/items/api_sellItem.go index ce6048767..b8d96d1bf 100644 --- a/modules/items/api_sellItem.go +++ b/modules/items/api_sellItem.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) SellItemCheck(session comm.IUserSession, req *pb.ItemsSellItemReq) (errdata *pb.ErrorData) { if req.GridId == "" || req.Amount <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -26,7 +29,10 @@ func (this *apiComp) SellItem(session comm.IUserSession, req *pb.ItemsSellItemRe return } if item, err = this.module.modelItems.QueryUserPackByGridId(session.GetUserId(), req.GridId); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if itemcf, err = this.module.configure.GetItemConfigure(item.ItemId); err != nil { @@ -38,7 +44,10 @@ func (this *apiComp) SellItem(session comm.IUserSession, req *pb.ItemsSellItemRe return } if req.Amount > item.Amount { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount) return } diff --git a/modules/items/api_sellinbulk.go b/modules/items/api_sellinbulk.go index b0ee5ec4a..1930252fd 100644 --- a/modules/items/api_sellinbulk.go +++ b/modules/items/api_sellinbulk.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) SellinbulkCheck(session comm.IUserSession, req *pb.ItemsSellinbulkReq) (errdata *pb.ErrorData) { if req.Grids == nil || req.Amount == nil || len(req.Grids) != len(req.Amount) { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -28,7 +31,10 @@ func (this *apiComp) Sellinbulk(session comm.IUserSession, req *pb.ItemsSellinbu return } if items, err = this.module.modelItems.QueryUserPackByGridIds(session.GetUserId(), req.Grids); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } cids = make([]string, len(items)) diff --git a/modules/items/api_useItem.go b/modules/items/api_useItem.go index e966711f6..dee5e3aa3 100644 --- a/modules/items/api_useItem.go +++ b/modules/items/api_useItem.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) UseitemCheck(session comm.IUserSession, req *pb.ItemsUseItemReq) (errdata *pb.ErrorData) { if req.GridId == "" || req.Amount <= 0 || req.Select < 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -26,7 +29,10 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq) return } if item, err = this.module.modelItems.QueryUserPackByGridId(session.GetUserId(), req.GridId); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if itemcf, err = this.module.configure.GetItemConfigure(item.ItemId); err != nil { @@ -73,7 +79,10 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq) } if sale == nil { this.module.Errorf("no found target sale:%v", req.Select) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/library/api_activationfetter.go b/modules/library/api_activationfetter.go index 8aad698b7..8cf4fa33f 100644 --- a/modules/library/api_activationfetter.go +++ b/modules/library/api_activationfetter.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ActivationFetterCheck(session comm.IUserSession, req *pb.LibraryActivationFetterReq) (errdata *pb.ErrorData) { if req.Oid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/library/api_getstoryreward.go b/modules/library/api_getstoryreward.go index c525a62ed..e471a9dbd 100644 --- a/modules/library/api_getstoryreward.go +++ b/modules/library/api_getstoryreward.go @@ -13,7 +13,10 @@ import ( //参数校验 func (this *apiComp) GetStoryRewardCheck(session comm.IUserSession, req *pb.LibraryGetStoryRewardReq) (errdata *pb.ErrorData) { if req.Oid == "" || req.History == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -30,7 +33,10 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe } _heroFetter := this.module.modelFetter.getOneHeroFetter(session.GetUserId(), req.Oid) if _heroFetter == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } favorConf, err := this.module.configure.GetFavorability(_heroFetter.Heroid, 1) // 取1级的就可以 diff --git a/modules/library/api_lvreward.go b/modules/library/api_lvreward.go index 3bfc650a9..69f1b274d 100644 --- a/modules/library/api_lvreward.go +++ b/modules/library/api_lvreward.go @@ -12,7 +12,10 @@ import ( //参数校验 func (this *apiComp) LvRewardCheck(session comm.IUserSession, req *pb.LibraryLvRewardReq) (errdata *pb.ErrorData) { if req.Oid == "" || req.Lv <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -27,7 +30,10 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward } _heroFetter := this.module.modelFetter.getOneHeroFetter(session.GetUserId(), req.Oid) if _heroFetter == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if _heroFetter.Lvprize == nil { @@ -40,7 +46,10 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward } confData, err := this.module.configure.GetFavorability(_heroFetter.Heroid, req.Lv) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: pb.GetErrorCodeMsg(code), Message: err.Error(), diff --git a/modules/library/api_lvup.go b/modules/library/api_lvup.go index e782d488c..c2768467d 100644 --- a/modules/library/api_lvup.go +++ b/modules/library/api_lvup.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) FetterLvUpCheck(session comm.IUserSession, req *pb.LibraryFetterLvUpReq) (errdata *pb.ErrorData) { if req.LibOid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/library/api_maintask.go b/modules/library/api_maintask.go index 0a688629b..b0fb891e2 100644 --- a/modules/library/api_maintask.go +++ b/modules/library/api_maintask.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) FetterstoryTaskCheck(session comm.IUserSession, req *pb.LibraryFetterstoryTaskReq) (errdata *pb.ErrorData) { if req.FetterId == 0 { this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 8bb59c112..05b486e70 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) UseGiftCheck(session comm.IUserSession, req *pb.LibraryUseGiftReq) (errdata *pb.ErrorData) { if req.Heroid == "" || req.Items == "" || req.Counts == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/linestory/api_maintask.go b/modules/linestory/api_maintask.go index 8d43df4ce..03fb90fde 100644 --- a/modules/linestory/api_maintask.go +++ b/modules/linestory/api_maintask.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) MaintaskCheck(session comm.IUserSession, req *pb.LinestoryMaintaskReq) (errdata *pb.ErrorData) { if req.ChapterId == 0 { this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/linestory/api_receive.go b/modules/linestory/api_receive.go index 5bfe8a9b1..d3d1c9a51 100644 --- a/modules/linestory/api_receive.go +++ b/modules/linestory/api_receive.go @@ -12,7 +12,10 @@ import ( func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.LinestoryReceiveReq) (errdata *pb.ErrorData) { if req.ChapterId == 0 { this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/mail/api_delallmail.go b/modules/mail/api_delallmail.go index 7d5b3ee85..5f4eceb38 100644 --- a/modules/mail/api_delallmail.go +++ b/modules/mail/api_delallmail.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) DelAllMailCheck(session comm.IUserSession, req *pb.MailDelAllMailReq) (errdata *pb.ErrorData) { if session.GetUserId() == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/mail/api_delmail.go b/modules/mail/api_delmail.go index dc5ef3932..408917d0b 100644 --- a/modules/mail/api_delmail.go +++ b/modules/mail/api_delmail.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) DelMailCheck(session comm.IUserSession, req *pb.MailDelMailReq) (errdata *pb.ErrorData) { if session.GetUserId() == "" || req.ObjID == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/mail/api_readmail.go b/modules/mail/api_readmail.go index 6099b865d..2384194f8 100644 --- a/modules/mail/api_readmail.go +++ b/modules/mail/api_readmail.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ReadMailCheck(session comm.IUserSession, req *pb.MailReadMailReq) (errdata *pb.ErrorData) { if session.GetUserId() == "" || req.ObjID == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return @@ -27,7 +30,10 @@ func (this *apiComp) ReadMail(session comm.IUserSession, req *pb.MailReadMailReq } mail, err = this.module.modelMail.MailReadOneMail(req.ObjID) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } this.module.Debugf("read mail %v", mail) diff --git a/modules/mline/api_challenge.go b/modules/mline/api_challenge.go index 6b7020219..6742bdd68 100644 --- a/modules/mline/api_challenge.go +++ b/modules/mline/api_challenge.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MlineChallengeReq) (errdata *pb.ErrorData) { if req.StageId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index 905ed0556..d4405d150 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.MlineChallengeOverReq) (errdata *pb.ErrorData) { if req.StageId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/mline/api_cleanstage.go b/modules/mline/api_cleanstage.go index 6149c5611..85c815bec 100644 --- a/modules/mline/api_cleanstage.go +++ b/modules/mline/api_cleanstage.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) CleanStageCheck(session comm.IUserSession, req *pb.MlineCleanStageReq) (errdata *pb.ErrorData) { if req.StageId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/mline/api_getReward.go b/modules/mline/api_getReward.go index 9cfd48ac4..416d550cd 100644 --- a/modules/mline/api_getReward.go +++ b/modules/mline/api_getReward.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MlineGetRewardReq) (errdata *pb.ErrorData) { if req.CId == 0 || req.Star == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/mline/api_getlist.go b/modules/mline/api_getlist.go index abc732544..bcea6ce6f 100644 --- a/modules/mline/api_getlist.go +++ b/modules/mline/api_getlist.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MlineGetListReq) (errdata *pb.ErrorData) { if req.CType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/moonfantasy/api_buy.go b/modules/moonfantasy/api_buy.go index 9db08e9e2..6be63d6d7 100644 --- a/modules/moonfantasy/api_buy.go +++ b/modules/moonfantasy/api_buy.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.MoonfantasyBuyReq) (errdata *pb.ErrorData) { if req.BuyNum == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/moonfantasy/api_receive.go b/modules/moonfantasy/api_receive.go index d4cd1c648..3f0bd7d6c 100644 --- a/modules/moonfantasy/api_receive.go +++ b/modules/moonfantasy/api_receive.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.MoonfantasyReceiveReq) (errdata *pb.ErrorData) { if req.Bid == "" || req.Mid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/oldtimes/api_receive.go b/modules/oldtimes/api_receive.go index 1c0dadf37..2546fb37f 100644 --- a/modules/oldtimes/api_receive.go +++ b/modules/oldtimes/api_receive.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (errdata *pb.ErrorData) { if req.ChapterId <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/pagoda/api_challenge.go b/modules/pagoda/api_challenge.go index 5eb2f5e0c..a9057cf21 100644 --- a/modules/pagoda/api_challenge.go +++ b/modules/pagoda/api_challenge.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.PagodaChallengeReq) (errdata *pb.ErrorData) { if req.Cid <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index 04f524c0e..5ace083d3 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -14,7 +14,10 @@ import ( //参数校验 func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.PagodaChallengeOverReq) (errdata *pb.ErrorData) { if req.Cid <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/pagoda/api_getReward.go b/modules/pagoda/api_getReward.go index 462837c5e..5b137ba25 100644 --- a/modules/pagoda/api_getReward.go +++ b/modules/pagoda/api_getReward.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.PagodaGetRewardReq) (errdata *pb.ErrorData) { if req.Id <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/parkour/api_avoid.go b/modules/parkour/api_avoid.go index 52833491b..42198c4b7 100644 --- a/modules/parkour/api_avoid.go +++ b/modules/parkour/api_avoid.go @@ -24,7 +24,10 @@ func (this *apiComp) Avoid(session comm.IUserSession, req *pb.ParkourAvoidReq) ( if ok { go this.module.avoid(req.Battleid, session.GetUserId(), req.Distance) } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } session.SendMsg(string(this.module.GetType()), "avoid", &pb.ParkourAvoidResp{}) diff --git a/modules/parkour/api_changemts.go b/modules/parkour/api_changemts.go index c33c438c9..116bf073a 100644 --- a/modules/parkour/api_changemts.go +++ b/modules/parkour/api_changemts.go @@ -27,7 +27,10 @@ func (this *apiComp) ChangeMts(session comm.IUserSession, req *pb.ParkourChangeM return } if _, ok := info.Mounts[req.Mtsid]; !ok { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } info.Dfmount = req.Mtsid diff --git a/modules/parkour/api_invite.go b/modules/parkour/api_invite.go index fe03c17e4..3ae852c78 100644 --- a/modules/parkour/api_invite.go +++ b/modules/parkour/api_invite.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) InviteCheck(session comm.IUserSession, req *pb.ParkourInviteReq) (errdata *pb.ErrorData) { if req.Uid == session.GetUserId() { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -40,7 +43,10 @@ func (this *apiComp) Invite(session comm.IUserSession, req *pb.ParkourInviteReq) return } if len(info.Member) > 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if tuser = this.module.ModuleUser.GetUser(session.GetUserId()); tuser == nil { diff --git a/modules/parkour/api_jointeam.go b/modules/parkour/api_jointeam.go index bd3480d74..5fa2b46bf 100644 --- a/modules/parkour/api_jointeam.go +++ b/modules/parkour/api_jointeam.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) JoinTeamCheck(session comm.IUserSession, req *pb.ParkourJoinTeamReq) (errdata *pb.ErrorData) { if session.GetUserId() == req.Uid { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return diff --git a/modules/parkour/api_quitteam.go b/modules/parkour/api_quitteam.go index 0b99e639c..3081e3b0c 100644 --- a/modules/parkour/api_quitteam.go +++ b/modules/parkour/api_quitteam.go @@ -37,7 +37,10 @@ func (this *apiComp) QuitTeam(session comm.IUserSession, req *pb.ParkourQuitTeam } } if !ok { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if req.Captainid == session.GetUserId() { //自己是队长 diff --git a/modules/parkour/api_racematch.go b/modules/parkour/api_racematch.go index 1ffa16719..3a9a3334f 100644 --- a/modules/parkour/api_racematch.go +++ b/modules/parkour/api_racematch.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) RaceMatchCheck(session comm.IUserSession, req *pb.ParkourRaceMatchReq) (errdata *pb.ErrorData) { if session.GetUserId() != req.Captainid { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -31,7 +34,10 @@ func (this *apiComp) RaceMatch(session comm.IUserSession, req *pb.ParkourRaceMat return } if team.Captainid != "" && team.Captainid != session.GetUserId() { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if team.Captainid == "" { //为组队情况 diff --git a/modules/parkour/api_racematchcancel.go b/modules/parkour/api_racematchcancel.go index 16517fce6..6e276f909 100644 --- a/modules/parkour/api_racematchcancel.go +++ b/modules/parkour/api_racematchcancel.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) RaceMatchCancelCheck(session comm.IUserSession, req *pb.ParkourRaceMatchCancelReq) (errdata *pb.ErrorData) { if session.GetUserId() != req.Captainid { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -28,7 +31,10 @@ func (this *apiComp) RaceMatchCancel(session comm.IUserSession, req *pb.ParkourR return } if team.Captainid != session.GetUserId() { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/parkour/api_ready.go b/modules/parkour/api_ready.go index 580898dad..dfde9d68f 100644 --- a/modules/parkour/api_ready.go +++ b/modules/parkour/api_ready.go @@ -48,7 +48,10 @@ func (this *apiComp) Ready(session comm.IUserSession, req *pb.ParkourReadyReq) ( } } if !ok { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } race.lock.Unlock() return } @@ -60,7 +63,10 @@ func (this *apiComp) Ready(session comm.IUserSession, req *pb.ParkourReadyReq) ( go this.module.startbattle(req.Battleid) } } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } session.SendMsg(string(this.module.GetType()), "ready", &pb.ParkourReadyResp{}) diff --git a/modules/parkour/api_recoverhp.go b/modules/parkour/api_recoverhp.go index 074957fa8..b39d287e2 100644 --- a/modules/parkour/api_recoverhp.go +++ b/modules/parkour/api_recoverhp.go @@ -42,7 +42,10 @@ func (this *apiComp) RecoverHp(session comm.IUserSession, req *pb.ParkourRecover //恢复hp go this.module.recoverhp(req.Battleid, 1, users...) } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } session.SendMsg(string(this.module.GetType()), "recoverhp", &pb.ParkourRecoverHpResp{}) diff --git a/modules/parkour/api_shot.go b/modules/parkour/api_shot.go index b4fd796f1..b7fd9a65e 100644 --- a/modules/parkour/api_shot.go +++ b/modules/parkour/api_shot.go @@ -24,7 +24,10 @@ func (this *apiComp) Shot(session comm.IUserSession, req *pb.ParkourShotReq) (er if ok { go this.module.shot(req.Battleid, session.GetUserId()) } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } session.SendMsg(string(this.module.GetType()), "shot", &pb.ParkourShotResp{}) diff --git a/modules/pay/api_dailybuy.go b/modules/pay/api_dailybuy.go index 000b831ed..ef865ee60 100644 --- a/modules/pay/api_dailybuy.go +++ b/modules/pay/api_dailybuy.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) DailyBuyCheck(session comm.IUserSession, req *pb.PayDailyBuyReq) (errdata *pb.ErrorData) { if req.Id == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/practice/api_accept.go b/modules/practice/api_accept.go index 7bc881411..e5ba3463f 100644 --- a/modules/practice/api_accept.go +++ b/modules/practice/api_accept.go @@ -12,7 +12,10 @@ import ( func (this *apiComp) AcceptCheck(session comm.IUserSession, req *pb.PracticeAcceptReq) (errdata *pb.ErrorData) { if req.Uid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -52,7 +55,10 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.PracticeAcceptReq } } if !keep { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/practice/api_enrolled.go b/modules/practice/api_enrolled.go index 7522da3e8..8b9810d96 100644 --- a/modules/practice/api_enrolled.go +++ b/modules/practice/api_enrolled.go @@ -34,7 +34,10 @@ func (this *apiComp) Enrolled(session comm.IUserSession, req *pb.PracticeEnrolle } else { if hero, err = this.module.ModuleHero.QueryCrossMultipleHeroinfo(req.Hero); err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/practice/api_loot.go b/modules/practice/api_loot.go index bf8a32341..6e8110de3 100644 --- a/modules/practice/api_loot.go +++ b/modules/practice/api_loot.go @@ -34,7 +34,10 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (e return } if froom.Pillarf.Hero != "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } if pillarconfigure, err = this.module.configure.getGamePandamasMz(froom.Pillarf.Lv); err != nil { code = pb.ErrorCode_ConfigNoFound @@ -45,7 +48,10 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (e } if req.Teacher != "" { if room.Knapsack[req.Teacher] == 1 { //已经被使用 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } room.Knapsack[req.Teacher] = 1 @@ -58,7 +64,10 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (e } if req.Prop != "" { if room.Knapsack[req.Prop] == 1 { //已经被使用 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } room.Knapsack[req.Prop] = 1 diff --git a/modules/practice/api_npcbattklefinish.go b/modules/practice/api_npcbattklefinish.go index e613fd402..a8e500d73 100644 --- a/modules/practice/api_npcbattklefinish.go +++ b/modules/practice/api_npcbattklefinish.go @@ -25,7 +25,10 @@ func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.Practic return } if room.Npcstate == 2 || room.Npcstate == 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/practice/api_npcdialog.go b/modules/practice/api_npcdialog.go index 763749258..81ebb95a7 100644 --- a/modules/practice/api_npcdialog.go +++ b/modules/practice/api_npcdialog.go @@ -23,7 +23,10 @@ func (this *apiComp) NPCDialog(session comm.IUserSession, req *pb.PracticeNPCDia // return // } // if room.Npcstate != 2 { - // code = pb.ErrorCode_ReqParameterError + // errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } // return // } // // if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil { diff --git a/modules/practice/api_practice.go b/modules/practice/api_practice.go index 26e745b80..cd558e9b2 100644 --- a/modules/practice/api_practice.go +++ b/modules/practice/api_practice.go @@ -50,7 +50,10 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic break } if pillar.Isunlock != 2 { //柱子未解锁 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } @@ -61,7 +64,10 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic if req.Teacher != "" { if room.Knapsack[req.Teacher] == 1 { //已经被使用 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } room.Knapsack[req.Teacher] = 1 @@ -74,7 +80,10 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic } if req.Prop != "" { if room.Knapsack[req.Prop] == 1 { //已经被使用 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } room.Knapsack[req.Prop] = 1 diff --git a/modules/practice/api_qiecuo.go b/modules/practice/api_qiecuo.go index 6a6814947..314dfcc6d 100644 --- a/modules/practice/api_qiecuo.go +++ b/modules/practice/api_qiecuo.go @@ -11,7 +11,10 @@ import ( // 踢馆(熊猫武馆) func (this *apiComp) QiecuoCheck(session comm.IUserSession, req *pb.PracticeQiecuoReq) (errdata *pb.ErrorData) { if req.Fid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/practice/api_receive.go b/modules/practice/api_receive.go index 169aa9c9c..3591b7773 100644 --- a/modules/practice/api_receive.go +++ b/modules/practice/api_receive.go @@ -67,7 +67,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR } } if pillar == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/practice/api_refuse.go b/modules/practice/api_refuse.go index a22575aa3..5af488ab1 100644 --- a/modules/practice/api_refuse.go +++ b/modules/practice/api_refuse.go @@ -36,7 +36,10 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.PracticeRefuseReq } if !keep { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } diff --git a/modules/practice/api_unLock.go b/modules/practice/api_unLock.go index 2b7d1585c..c17328394 100644 --- a/modules/practice/api_unLock.go +++ b/modules/practice/api_unLock.go @@ -42,7 +42,10 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq break } if pillar.Isunlock != 1 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } pillar.Isunlock = 2 diff --git a/modules/practice/api_upgrade.go b/modules/practice/api_upgrade.go index 1ec8a8f73..f4497f56d 100644 --- a/modules/practice/api_upgrade.go +++ b/modules/practice/api_upgrade.go @@ -44,7 +44,10 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.PracticeUpgradeR break } if pillar.Hero != "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if pillarconfigure, err = this.module.configure.getGamePandamasMz(pillar.Lv); err != nil || len(pillarconfigure.UpLvConsume) == 0 { diff --git a/modules/privilege/api_buygift.go b/modules/privilege/api_buygift.go index b390e4af7..c19284421 100644 --- a/modules/privilege/api_buygift.go +++ b/modules/privilege/api_buygift.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) BuyGiftCheck(session comm.IUserSession, req *pb.PrivilegeBuyGiftReq) (errdata *pb.ErrorData) { if req.VipLv == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return diff --git a/modules/privilege/api_buyyueka.go b/modules/privilege/api_buyyueka.go index 068561fbb..859550e58 100644 --- a/modules/privilege/api_buyyueka.go +++ b/modules/privilege/api_buyyueka.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) BuyYuekaCheck(session comm.IUserSession, req *pb.PrivilegeBuyYuekaReq) (errdata *pb.ErrorData) { if req.CID == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return diff --git a/modules/reputation/api_reset.go b/modules/reputation/api_reset.go index e7d0719b6..6f7316d44 100644 --- a/modules/reputation/api_reset.go +++ b/modules/reputation/api_reset.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ResetCheck(session comm.IUserSession, req *pb.ReputationTalentresetReq) (errdata *pb.ErrorData) { if req.RaceType < 1 && req.RaceType > 4 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/rtask/api_tasktest.go b/modules/rtask/api_tasktest.go index 72de430a2..25331b98a 100644 --- a/modules/rtask/api_tasktest.go +++ b/modules/rtask/api_tasktest.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) RtestCheck(session comm.IUserSession, req *pb.RtaskTestReq) (errdata *pb.ErrorData) { if len(req.Params) < 1 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/shop/api_buy.go b/modules/shop/api_buy.go index a96520dce..13123d892 100644 --- a/modules/shop/api_buy.go +++ b/modules/shop/api_buy.go @@ -11,7 +11,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.ShopBuyReq) (errdata *pb.ErrorData) { if req.ShopType == 0 || req.GoodsId == 0 || req.BuyNum <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -88,7 +91,10 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata record = shopData.SmithyShop break default: - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if record == nil { diff --git a/modules/shop/api_getlist.go b/modules/shop/api_getlist.go index 48be01225..0eee20249 100644 --- a/modules/shop/api_getlist.go +++ b/modules/shop/api_getlist.go @@ -12,7 +12,10 @@ import ( //参数校验 func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) { if req.SType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } @@ -78,7 +81,10 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq) filed = "smithyShop" break default: - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } if sdata == nil { @@ -213,7 +219,10 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq) goods = transGoods(items, sdata) } } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{SType: req.SType, IsManualRefresh: req.IsManualRefresh, Goods: goods, SurplusRefreshNum: leftrefnum}) diff --git a/modules/smithy/api_atlasactivate.go b/modules/smithy/api_atlasactivate.go index 06e736f5f..57355ddea 100644 --- a/modules/smithy/api_atlasactivate.go +++ b/modules/smithy/api_atlasactivate.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) AtlasActivateCheck(session comm.IUserSession, req *pb.SmithyAtlasActivateReq) (errdata *pb.ErrorData) { if req.Id == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 1254220c4..ced0ead11 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -10,7 +10,10 @@ import ( //参数校验 func (this *apiComp) ForgeEquipCheck(session comm.IUserSession, req *pb.SmithyForgeEquipReq) (errdata *pb.ErrorData) { if req.ReelId == 0 || req.Lava < 0 || req.Quality < 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return @@ -48,7 +51,10 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq } reelcfg, err := this.module.configure.GetSmithyReelConfigData(req.ReelId) if err != nil { - code = pb.ErrorCode_ReqParameterError // 没有找到该类型的图纸信息 + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } // 没有找到该类型的图纸信息 return } // 校验图纸是否激活 @@ -166,7 +172,10 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq // 总次数校验 maxHitCount := this.module.ModuleTools.GetGlobalConf().GameMakeTunkNum if hitLen > maxHitCount { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Errorf("铁匠铺小游戏打造次数超过上限,当前打造次数:%d, 配置总次数:%d", hitLen, maxHitCount) } // 校验是否刷新最大记录 diff --git a/modules/smithy/api_refuse.go b/modules/smithy/api_refuse.go index d6ade785c..40575dc74 100644 --- a/modules/smithy/api_refuse.go +++ b/modules/smithy/api_refuse.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.SmithyRefuseReq) (errdata *pb.ErrorData) { if req.CustomerId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/smithy/api_rise.go b/modules/smithy/api_rise.go index a3c4336d6..36f580f22 100644 --- a/modules/smithy/api_rise.go +++ b/modules/smithy/api_rise.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) RiseCheck(session comm.IUserSession, req *pb.SmithyRiseReq) (errdata *pb.ErrorData) { if req.ItemId == "" || req.Count <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/smithy/api_toolsup.go b/modules/smithy/api_toolsup.go index e2734957f..b9d49a606 100644 --- a/modules/smithy/api_toolsup.go +++ b/modules/smithy/api_toolsup.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) ToolsUpCheck(session comm.IUserSession, req *pb.SmithyToolsUpReq) (errdata *pb.ErrorData) { if req.Id == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return @@ -27,7 +30,10 @@ func (this *apiComp) ToolsUp(session comm.IUserSession, req *pb.SmithyToolsUpReq } conf, err := this.module.configure.GetSmithyToolsData(req.Id) if err != nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } data = &pb.ErrorData{ Title: pb.GetErrorCodeMsg(code), Message: err.Error(), diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index 3ed997e8d..c4c35c050 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) SellCheck(session comm.IUserSession, req *pb.SmithySellReq) (errdata *pb.ErrorData) { if req.CustomerId == 0 || len(req.EquipIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_activityreceive.go b/modules/sociaty/api_cross_activityreceive.go index 58db3f8bb..8cf2b32bd 100644 --- a/modules/sociaty/api_cross_activityreceive.go +++ b/modules/sociaty/api_cross_activityreceive.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) ActivityreceiveCheck(session comm.IUserSession, req *pb.SociatyActivityReceiveReq) (errdata *pb.ErrorData) { if req.Id == 0 { this.module.Error("活跃度领取参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_agree.go b/modules/sociaty/api_cross_agree.go index e2352e438..6c3e57dcb 100644 --- a/modules/sociaty/api_cross_agree.go +++ b/modules/sociaty/api_cross_agree.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.SociatyAgreeReq) (errdata *pb.ErrorData) { if req.Uid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会申请-同意参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_apply.go b/modules/sociaty/api_cross_apply.go index e4e361b66..6e06be62e 100644 --- a/modules/sociaty/api_cross_apply.go +++ b/modules/sociaty/api_cross_apply.go @@ -13,7 +13,10 @@ import ( func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyReq) (errdata *pb.ErrorData) { if req.SociatyId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会申请参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_applycancel.go b/modules/sociaty/api_cross_applycancel.go index 24a8decba..57a04aec2 100644 --- a/modules/sociaty/api_cross_applycancel.go +++ b/modules/sociaty/api_cross_applycancel.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) ApplyCancelCheck(session comm.IUserSession, req *pb.SociatyApplyCancelReq) (errdata *pb.ErrorData) { if req.SociatyId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会申请取消参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_applylist.go b/modules/sociaty/api_cross_applylist.go index ae7e2fef3..dae078e8d 100644 --- a/modules/sociaty/api_cross_applylist.go +++ b/modules/sociaty/api_cross_applylist.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.SociatyApplyListReq) (errdata *pb.ErrorData) { if req.SociatyId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("申请列表参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_assign.go b/modules/sociaty/api_cross_assign.go index 7676c66e0..df0202f3e 100644 --- a/modules/sociaty/api_cross_assign.go +++ b/modules/sociaty/api_cross_assign.go @@ -10,7 +10,10 @@ import ( // 公会转让 func (this *apiComp) AssignCheck(session comm.IUserSession, req *pb.SociatyAssignReq) (errdata *pb.ErrorData) { if req.TargetId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会转让参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return @@ -23,7 +26,10 @@ func (this *apiComp) Assign(session comm.IUserSession, req *pb.SociatyAssignReq) data = &pb.ErrorData{} uid := session.GetUserId() if uid == req.TargetId { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("不能转让给自己", log.Field{Key: "uid", Value: uid}) return } diff --git a/modules/sociaty/api_cross_bossrank.go b/modules/sociaty/api_cross_bossrank.go index 7274c9d10..806c332c5 100644 --- a/modules/sociaty/api_cross_bossrank.go +++ b/modules/sociaty/api_cross_bossrank.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) BrankCheck(session comm.IUserSession, req *pb.SociatyBRankReq) (errdata *pb.ErrorData) { if req.RankType != 1 && req.RankType != 2 && req.RankType != 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_breceive.go b/modules/sociaty/api_cross_breceive.go index ac366474b..c3045901e 100644 --- a/modules/sociaty/api_cross_breceive.go +++ b/modules/sociaty/api_cross_breceive.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) BreceiveCheck(session comm.IUserSession, req *pb.SociatyBReceiveReq) (errdata *pb.ErrorData) { if req.TaskId <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_buy.go b/modules/sociaty/api_cross_buy.go index e595d9963..35733e7c4 100644 --- a/modules/sociaty/api_cross_buy.go +++ b/modules/sociaty/api_cross_buy.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.SociatyBuyReq) (errdata *pb.ErrorData) { if req.Atn != nil && req.Atn.N <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_create.go b/modules/sociaty/api_cross_create.go index 2d4f81965..0bd3a80db 100644 --- a/modules/sociaty/api_cross_create.go +++ b/modules/sociaty/api_cross_create.go @@ -17,7 +17,10 @@ import ( func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.SociatyCreateReq) (errdata *pb.ErrorData) { if len(req.Notice) > 150 || strings.TrimSpace(req.Name) == "" { this.module.Error("公会创建参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_discharge.go b/modules/sociaty/api_cross_discharge.go index f21c857bd..48f66e98d 100644 --- a/modules/sociaty/api_cross_discharge.go +++ b/modules/sociaty/api_cross_discharge.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) DischargeCheck(session comm.IUserSession, req *pb.SociatyDischargeReq) (errdata *pb.ErrorData) { if req.TargetId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("踢出公会参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_dismiss.go b/modules/sociaty/api_cross_dismiss.go index 059f65f13..c08072a08 100644 --- a/modules/sociaty/api_cross_dismiss.go +++ b/modules/sociaty/api_cross_dismiss.go @@ -11,7 +11,10 @@ import ( func (this *apiComp) DismissCheck(session comm.IUserSession, req *pb.SociatyDismissReq) (errdata *pb.ErrorData) { if req.Dismiss > 1 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会解散参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_list.go b/modules/sociaty/api_cross_list.go index e6764fd83..2f56ad29c 100644 --- a/modules/sociaty/api_cross_list.go +++ b/modules/sociaty/api_cross_list.go @@ -9,7 +9,10 @@ import ( // 公会列表 func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.SociatyListReq) (errdata *pb.ErrorData) { if req.Filter > 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会列表参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_receive.go b/modules/sociaty/api_cross_receive.go index d012f67f5..5c247228a 100644 --- a/modules/sociaty/api_cross_receive.go +++ b/modules/sociaty/api_cross_receive.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.SociatyReceiveReq) (errdata *pb.ErrorData) { if req.TaskId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会任务奖励领取参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_recommend.go b/modules/sociaty/api_cross_recommend.go index 02b106a45..d752471b4 100644 --- a/modules/sociaty/api_cross_recommend.go +++ b/modules/sociaty/api_cross_recommend.go @@ -8,7 +8,10 @@ import ( // 公会BOSS 推荐 func (this *apiComp) RecommendCheck(session comm.IUserSession, req *pb.SociatyRecommendReq) (errdata *pb.ErrorData) { if req.Cate != 1 && req.Cate != 2 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/sociaty/api_cross_refuse.go b/modules/sociaty/api_cross_refuse.go index 670faea4d..16aa61ac2 100644 --- a/modules/sociaty/api_cross_refuse.go +++ b/modules/sociaty/api_cross_refuse.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.SociatyRefuseReq) (errdata *pb.ErrorData) { if req.Uid == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会申请审核-拒绝参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_search.go b/modules/sociaty/api_cross_search.go index 3a41489b9..f6f5bd6da 100644 --- a/modules/sociaty/api_cross_search.go +++ b/modules/sociaty/api_cross_search.go @@ -9,7 +9,10 @@ import ( // 公会搜索 func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.SociatySearchReq) (errdata *pb.ErrorData) { if req.Name == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会搜索参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_setting.go b/modules/sociaty/api_cross_setting.go index dcb580b25..9d4255e89 100644 --- a/modules/sociaty/api_cross_setting.go +++ b/modules/sociaty/api_cross_setting.go @@ -10,7 +10,10 @@ import ( func (this *apiComp) SettingCheck(session comm.IUserSession, req *pb.SociatySettingReq) (errdata *pb.ErrorData) { if len(req.Notice) > 150 || req.ApplyLv == 0 || req.Icon == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会设置参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/sociaty/api_cross_settingjob.go b/modules/sociaty/api_cross_settingjob.go index 73ba49b3b..9bcda020f 100644 --- a/modules/sociaty/api_cross_settingjob.go +++ b/modules/sociaty/api_cross_settingjob.go @@ -9,7 +9,10 @@ import ( // 设置职位 func (this *apiComp) SettingJobCheck(session comm.IUserSession, req *pb.SociatySettingJobReq) (errdata *pb.ErrorData) { if req.TargetId == "" || req.Job == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } this.module.Error("公会设置职位参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } return diff --git a/modules/task/api_send.go b/modules/task/api_send.go index 77887d823..f2a8b7f28 100644 --- a/modules/task/api_send.go +++ b/modules/task/api_send.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) SendCheck(session comm.IUserSession, req *pb.TaskSendReq) (errdata *pb.ErrorData) { if len(req.Params) == 0 || req.TaskType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_initdata.go b/modules/user/api_initdata.go index a316792e0..4bb8c11da 100644 --- a/modules/user/api_initdata.go +++ b/modules/user/api_initdata.go @@ -8,7 +8,10 @@ import ( //初始化账号数据 恢复到创角前 func (this *apiComp) InitdataCheck(session comm.IUserSession, req *pb.UserInitdataReq) (errdata *pb.ErrorData) { if req.Code == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_login.go b/modules/user/api_login.go index a6e7dbb01..c330c6a32 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -13,7 +13,10 @@ import ( //参数校验 func (this *apiComp) LoginCheck(session comm.IUserSession, req *pb.UserLoginReq) (errdata *pb.ErrorData) { if req.Account == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_modifyavatar.go b/modules/user/api_modifyavatar.go index 47f338121..e8384efd8 100644 --- a/modules/user/api_modifyavatar.go +++ b/modules/user/api_modifyavatar.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) ModifyavatarCheck(session comm.IUserSession, req *pb.UserModifyavatarReq) (errdata *pb.ErrorData) { if req.AvatarId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_modifybgp.go b/modules/user/api_modifybgp.go index 024b9b96b..10e4f958e 100644 --- a/modules/user/api_modifybgp.go +++ b/modules/user/api_modifybgp.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ModifybgpCheck(session comm.IUserSession, req *pb.UserModifybgpReq) (errdata *pb.ErrorData) { if req.BgpId == "" { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_modifyfigure.go b/modules/user/api_modifyfigure.go index 31767b53c..6882a030b 100644 --- a/modules/user/api_modifyfigure.go +++ b/modules/user/api_modifyfigure.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ModifyfigureCheck(session comm.IUserSession, req *pb.UserModifyfigureReq) (errdata *pb.ErrorData) { if req.FigureId == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_modifyname.go b/modules/user/api_modifyname.go index cd0174f34..896154ee9 100644 --- a/modules/user/api_modifyname.go +++ b/modules/user/api_modifyname.go @@ -8,7 +8,10 @@ import ( func (this *apiComp) ModifynameCheck(session comm.IUserSession, req *pb.UserModifynameReq) (errdata *pb.ErrorData) { if strings.TrimSpace(req.Name) == "" || len(strings.TrimSpace(req.Name)) > 18 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_modifysign.go b/modules/user/api_modifysign.go index 1553825f3..a1e01c816 100644 --- a/modules/user/api_modifysign.go +++ b/modules/user/api_modifysign.go @@ -9,7 +9,10 @@ import ( func (this *apiComp) ModifysignCheck(session comm.IUserSession, req *pb.UserModifysignReq) (errdata *pb.ErrorData) { if req.Sign == "" || len(req.Sign) > 200 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_puzzleaward.go b/modules/user/api_puzzleaward.go index 9af7d36e6..b10662a20 100644 --- a/modules/user/api_puzzleaward.go +++ b/modules/user/api_puzzleaward.go @@ -23,7 +23,10 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw return } if sign.Puzzle[req.Index] != 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } _data := this.module.configure.GetSignConf(req.Index, sign.Group) diff --git a/modules/user/api_sellres.go b/modules/user/api_sellres.go index bbe56124f..36e3afe10 100644 --- a/modules/user/api_sellres.go +++ b/modules/user/api_sellres.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) SellResCheck(session comm.IUserSession, req *pb.UserSellResReq) (errdata *pb.ErrorData) { if len(req.Atno) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_settingteam.go b/modules/user/api_settingteam.go index afd5d50d8..c0ca967db 100644 --- a/modules/user/api_settingteam.go +++ b/modules/user/api_settingteam.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) SettingteamCheck(session comm.IUserSession, req *pb.UserSettingteamReq) (errdata *pb.ErrorData) { if len(req.HeroObjIds) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/user/api_switchdefper.go b/modules/user/api_switchdefper.go index 04b15c06d..a64dfdf7d 100644 --- a/modules/user/api_switchdefper.go +++ b/modules/user/api_switchdefper.go @@ -34,7 +34,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD return } if conf.Type != 1 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for _, v := range user.Skins { @@ -43,7 +46,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD } } if !keep { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } user.CurSkin = req.CurSkin @@ -58,7 +64,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD return } if conf.Type != 2 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for _, v := range user.Skins { @@ -67,7 +76,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD } } if !keep { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } user.CurAction = req.CurAction @@ -80,7 +92,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD return } if conf.Type != 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } for _, v := range user.Skins { @@ -89,7 +104,10 @@ func (this *apiComp) SwitchDefPer(session comm.IUserSession, req *pb.UserSwitchD } } if !keep { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } user.CurBg = req.CurBg diff --git a/modules/user/api_updatesetting.go b/modules/user/api_updatesetting.go index d591af0f8..c8d12240c 100644 --- a/modules/user/api_updatesetting.go +++ b/modules/user/api_updatesetting.go @@ -8,7 +8,10 @@ import ( func (this *apiComp) UpdatesettingCheck(session comm.IUserSession, req *pb.UserUpdateSettingReq) (errdata *pb.ErrorData) { if req.Setting.Huazhi > 3 || req.Setting.Kangjuchi > 3 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/viking/api_buy.go b/modules/viking/api_buy.go index b5756a23c..2c0267628 100644 --- a/modules/viking/api_buy.go +++ b/modules/viking/api_buy.go @@ -8,7 +8,10 @@ import ( //参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.VikingBuyReq) (errdata *pb.ErrorData) { if req.Count <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/viking/api_challenge.go b/modules/viking/api_challenge.go index 7a205d1d3..a6cc75d1c 100644 --- a/modules/viking/api_challenge.go +++ b/modules/viking/api_challenge.go @@ -9,7 +9,10 @@ import ( //参数校验 func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.VikingChallengeReq) (errdata *pb.ErrorData) { if req.BossId <= 0 && req.Difficulty > 0 || req.Battle == nil { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 212e063df..d42cc1c94 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -10,7 +10,10 @@ import ( // 参数校验 func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.VikingChallengeOverReq) (errdata *pb.ErrorData) { if req.BossId <= 0 && req.Difficulty > 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } return diff --git a/modules/viking/api_ranklist.go b/modules/viking/api_ranklist.go index d8155a38c..2bde1ff24 100644 --- a/modules/viking/api_ranklist.go +++ b/modules/viking/api_ranklist.go @@ -14,7 +14,10 @@ import ( //参数校验 func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.VikingRankListReq) (errdata *pb.ErrorData) { if req.BoosType == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/web/api_createnotify.go b/modules/web/api_createnotify.go index e5867c8bf..9c8a68fb3 100644 --- a/modules/web/api_createnotify.go +++ b/modules/web/api_createnotify.go @@ -32,7 +32,10 @@ func (this *Api_Comp) CreateNotify(c *engine.Context) { return } if len(req.Title) == 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } msg = pb.GetErrorCodeMsg(code) return } diff --git a/modules/web/api_creatmail.go b/modules/web/api_creatmail.go index b9acfb604..22a419749 100644 --- a/modules/web/api_creatmail.go +++ b/modules/web/api_creatmail.go @@ -35,7 +35,10 @@ func (this *Api_Comp) CreateMail(c *engine.Context) { data interface{} ) if db.IsCross() { // 跨服服务器不能发邮件 - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } msg = pb.GetErrorCodeMsg(code) return } diff --git a/modules/web/api_upload.go b/modules/web/api_upload.go index 5fdd9d59d..88f6eed83 100644 --- a/modules/web/api_upload.go +++ b/modules/web/api_upload.go @@ -28,20 +28,29 @@ func (this *Api_Comp) Upload(c *engine.Context) { if n, err := strconv.Atoi(filenum); err != nil { this.module.Errorln(err) msg = err.Error() - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } else { for i := 0; i < n; i++ { if fn, err := c.FormFile(fmt.Sprintf("file_%d", i)); err != nil { this.module.Errorln(err) msg = err.Error() - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } else { if err = c.SaveUploadedFile(fn, fmt.Sprintf("%s/%s", configure.ConfigurePath(), fn.Filename)); err != nil { this.module.Errorln(err) msg = err.Error() - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } return } } @@ -58,6 +67,9 @@ func (this *Api_Comp) Upload(c *engine.Context) { code = pb.ErrorCode_RpcFuncExecutionError } } else { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } } diff --git a/modules/worldtask/api_accept.go b/modules/worldtask/api_accept.go index 18006d075..5098bf4c9 100644 --- a/modules/worldtask/api_accept.go +++ b/modules/worldtask/api_accept.go @@ -10,7 +10,10 @@ import ( func (a *apiComp) AcceptCheck(session comm.IUserSession, req *pb.WorldtaskAcceptReq) (errdata *pb.ErrorData) { if req.TaskId <= 0 || req.GroupId <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/worldtask/api_battlefinish.go b/modules/worldtask/api_battlefinish.go index f1051aaca..e82df1979 100644 --- a/modules/worldtask/api_battlefinish.go +++ b/modules/worldtask/api_battlefinish.go @@ -16,7 +16,10 @@ func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.Worldt log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}, ) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/worldtask/api_battlestart.go b/modules/worldtask/api_battlestart.go index c4e1328ee..c4c1b7fbf 100644 --- a/modules/worldtask/api_battlestart.go +++ b/modules/worldtask/api_battlestart.go @@ -14,7 +14,10 @@ func (this *apiComp) BattlestartCheck(session comm.IUserSession, req *pb.Worldta log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}, ) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/worldtask/api_chapterreward.go b/modules/worldtask/api_chapterreward.go index 30e6f1072..c7c9ac50a 100644 --- a/modules/worldtask/api_chapterreward.go +++ b/modules/worldtask/api_chapterreward.go @@ -7,7 +7,10 @@ import ( func (this *apiComp) ChapterrewardCheck(session comm.IUserSession, req *pb.WorldtaskChapterrewardReq) (errdata *pb.ErrorData) { if req.GroupId <= 0 { - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return } diff --git a/modules/worldtask/api_finish.go b/modules/worldtask/api_finish.go index 93a0e70ce..36d5b960b 100644 --- a/modules/worldtask/api_finish.go +++ b/modules/worldtask/api_finish.go @@ -14,7 +14,10 @@ import ( func (this *apiComp) FinishCheck(session comm.IUserSession, req *pb.WorldtaskFinishReq) (errdata *pb.ErrorData) { if req.GroupId == 0 || req.TaskId == 0 { this.module.Error("世界任务完成参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) - code = pb.ErrorCode_ReqParameterError + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } } return }