添加远征匹配玩家方法

This commit is contained in:
luying
2020-10-28 19:29:59 +08:00
parent 3377e0f99c
commit 222b9c6e12
11 changed files with 282 additions and 27 deletions

View File

@@ -30,7 +30,6 @@ export default class UserController extends Controller {
public async createRoleData() {
const { ctx } = this;
console.log(ctx.request.body)
const { hid, hlv, eid, elv, ecount, ehid, itemid, itemcount, selectedRowKeys: uids, optType } = ctx.request.body;
if(optType == 'hero') {
ctx.body = await ctx.service.users.createHero(uids, hid, hlv);
@@ -42,4 +41,28 @@ export default class UserController extends Controller {
ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);
}
}
public async getPveDefense() {
const { ctx } = this;
const { roleId } = ctx.request.body;
ctx.body = await ctx.service.users.getPvpDefense(roleId);
}
public async getHeroList() {
const { ctx } = this;
const { roleId } = ctx.request.body;
ctx.body = await ctx.service.users.getHeroList(roleId);
}
public async saveHeroToDefense() {
const { ctx } = this;
const { roleId, roleName, hid } = ctx.request.body;
ctx.body = await ctx.service.users.saveHeroToDefense(roleId, roleName, hid);
}
public async removeHeroFromDefense() {
const { ctx } = this;
const { roleId, hid } = ctx.request.body;
ctx.body = await ctx.service.users.removeHeroFromDefense(roleId, hid);
}
}