修改账号接口返回结构
修改部分账号接口逻辑
This commit is contained in:
liangtongchuan
2020-10-16 20:22:44 +08:00
parent f6509532ac
commit df2da73006
7 changed files with 39 additions and 48 deletions

View File

@@ -3,6 +3,9 @@ import BaseModel from './BaseModel';
import { index, getModelForClass, prop } from '@typegoose/typegoose';
class ServerInfo {
@prop({ required: true })
id: number;
@prop({ required: true })
name: string;
@@ -55,7 +58,7 @@ export default class Game extends BaseModel {
public static async getServerListByType(serverType: string) {
let game = await GameModel.findOne().lean();
if (!game) {
const serverInfo: ServerInfo = { name: '常山少年', host: 'pinus_test.trgame.cn', port: 3014, status: 1, createTime: new Date(), serverType: 'official' };
const serverInfo: ServerInfo = { id: 1, name: '常山少年', host: 'pinus_test.trgame.cn', port: 3014, status: 1, createTime: new Date(), serverType: 'official' };
const iconUrl = `https://download.tgamebox.cn/avatar/${APP_ID}/1.png`;
game = await GameModel.findOneAndUpdate(
{},