后台:上传资源
This commit is contained in:
@@ -16,6 +16,7 @@ import { nowSeconds } from '@pubUtils/timeUtil';
|
||||
import { WhiteListModel } from '@db/RegionWhiteList';
|
||||
import { RoleModel } from '@db/Role';
|
||||
import { SearchMarqueeParam } from '@domain/backEndField/search';
|
||||
import { DicServerName } from '@pubUtils/dictionary/DicServerName';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
@@ -278,6 +279,16 @@ export default class Game extends Service {
|
||||
})
|
||||
}
|
||||
|
||||
public async getServerName() {
|
||||
let list: DicServerName[] = [];
|
||||
for(let [_, serverName] of gameData.serverNames) {
|
||||
list.push(serverName);
|
||||
}
|
||||
return this.ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
list
|
||||
})
|
||||
}
|
||||
|
||||
public async getNoticeList(page: number, pageSize: number, sortField: string, sortOrder: string, form: { content?: string }) {
|
||||
const { ctx } = this;
|
||||
const list = await NoticeModel.findByCondition(page, pageSize, sortField, sortOrder, form);
|
||||
|
||||
@@ -72,4 +72,18 @@ export default class Utils extends Service {
|
||||
log.error(`${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async transmit(env: string, route: string, stream: any) {
|
||||
const { ctx } = this;
|
||||
console.log('****transmit', stream);
|
||||
const result = await ctx.curl(`http://127.0.0.1:7002${route}`, {
|
||||
method: 'POST',
|
||||
files: stream,
|
||||
|
||||
headers: {
|
||||
token: ctx.request.headers.token
|
||||
}
|
||||
});
|
||||
console.log(env, result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user