diff --git a/game-server/app/servers/role/handler/friendHandler.ts b/game-server/app/servers/role/handler/friendHandler.ts index c367a3f4e..9560208c6 100644 --- a/game-server/app/servers/role/handler/friendHandler.ts +++ b/game-server/app/servers/role/handler/friendHandler.ts @@ -139,7 +139,7 @@ export class FriendHandler { str = getResStr(STATUS.FRIEND_YOURSELF); continue; } - let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, 50); + let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, FRIEND.FRIEND_MANAGE_APPLICATION); if(!incResult) { str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); continue; } diff --git a/game-server/test/friend.test.ts b/game-server/test/friend.test.ts index 52cc2b406..d4bb1c080 100644 --- a/game-server/test/friend.test.ts +++ b/game-server/test/friend.test.ts @@ -59,6 +59,39 @@ describe('好友测试测试', function() { }); }); + it('清空申请', function(done) { + pinusClientT.request('role.friendHandler.getApplyList', {}, (res) => { + + checkSuccessResponse(res); + expect(res.data.list).to.be.a('array'); + res.data.list.forEach(cur => { + checkFriendApplyParams(cur); + }); + + const applyCodes = res.data.list.map(apply => { + return apply.applyCode; + }); + pinusClientT.request('role.friendHandler.handleApply', { applyCodeList: applyCodes, isPass: false }, (res) => { + checkSuccessResponse(res); + expect(res.data.isSuccess).to.be.a('boolean'); + expect(res.data.msg).to.be.a('string'); + + expect(res.data.applyCodeList).to.be.a('array'); + res.data.applyCodeList.forEach(cur => { + expect(cur).to.be.a('string'); + }) + + expect(res.data.list).to.be.a('array'); + res.data.list.forEach(cur => { + checkFriendListParam(cur); + }); + + expect(res.data.friendCnt).to.be.a('number'); + done(); + }); + }); + }); + it('申请好友', function(done) { pinusClient.request('role.friendHandler.applyFriend', { roleIds: [roleInfoT.roleId] } , (res) => { checkSuccessResponse(res);