mirror of
https://github.com/laochan-eacnet/backend.git
synced 2026-10-02 19:47:59 +03:00
add js object to kxml decorator
add config warpper around environment variables
This commit is contained in:
@@ -1,16 +1,41 @@
|
||||
import { kxml } from '../../decorators/render-kxml.js';
|
||||
import { ILaochanService } from '../../types.js';
|
||||
import { singleton } from 'tsyringe';
|
||||
import config from '../../utils/config.js';
|
||||
import { kxml } from '../../decorators/to-kxml.js';
|
||||
|
||||
@singleton()
|
||||
export default class implements ILaochanService {
|
||||
@kxml('services/get')
|
||||
async process(): Promise<object> {
|
||||
@kxml()
|
||||
async process() {
|
||||
const selfServices = [
|
||||
'services', 'dlstatus', 'cardmng',
|
||||
'eacoin', 'userdata', 'userid', 'pcbtracker', 'pcbevent',
|
||||
'message', 'facility', 'apsmanager', 'sidmgr', 'package',
|
||||
'uploaders', 'local', 'local2', 'lobby',
|
||||
]
|
||||
|
||||
return {
|
||||
keepaliveUrl:
|
||||
'ping://127.0.0.1/?pa=127.0.0.1&ia=127.0.0.1&ga=127.0.0.1ma=127.0.0.1&t1=2&t2=15&rt=2',
|
||||
ntpUrl: 'ntp://pool.ntp.org',
|
||||
selfUrl: 'http://localhost:10573',
|
||||
};
|
||||
services: {
|
||||
$expire: 43200,
|
||||
$method: 'get',
|
||||
$mode: 'operation',
|
||||
$product_domain: 1,
|
||||
$statuc: 0,
|
||||
item: [
|
||||
{
|
||||
$name: 'keepalive',
|
||||
$url: 'ping://127.0.0.1/?pa=127.0.0.1&ia=127.0.0.1&ga=127.0.0.1ma=127.0.0.1&t1=2&t2=15&rt=2',
|
||||
},
|
||||
{
|
||||
$name: 'ntp',
|
||||
$url: config.ntpUrl,
|
||||
},
|
||||
...selfServices.map(v => ({
|
||||
$name: v,
|
||||
$url: config.selfUrl,
|
||||
}))
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user