修改代码格式;

数据库查询加 lean 判断;
其它内容微调。
This commit is contained in:
liangtongchuan
2020-08-27 20:01:35 +08:00
parent 940879016f
commit c53db8634d
17 changed files with 710 additions and 323 deletions

View File

@@ -4,14 +4,14 @@ import { GameModel } from '../db/Game';
import { Controller } from 'egg';
export default class GameController extends Controller {
public async getServerList() {
const { ctx } = this;
const { serverType } = ctx.request.body;
let serverList: Array<any> = await GameModel.getServerListByType(serverType);
if (serverList && serverList.length > 0) {
ctx.body = {status: STATUS_SUC.code, data: { serverList }};
} else {
ctx.body = ctx.service.utils.exceptionResult(SERVER_NOT_FOUND);
}
public async getServerList() {
const { ctx } = this;
const { serverType } = ctx.request.body;
const serverList: Array<any> = await GameModel.getServerListByType(serverType);
if (serverList && serverList.length > 0) {
ctx.body = { status: STATUS_SUC.code, data: { serverList } };
} else {
ctx.body = ctx.service.utils.exceptionResult(SERVER_NOT_FOUND);
}
}
}
}