mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
兼容脚本、日志、配置文件详情接口
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { Service, Inject } from 'typedi';
|
||||
import winston from 'winston';
|
||||
import path from 'path';
|
||||
import path, { join } from 'path';
|
||||
import SockService from './sock';
|
||||
import CronService from './cron';
|
||||
import ScheduleService, { TaskCallbacks } from './schedule';
|
||||
import config from '../config';
|
||||
import { TASK_COMMAND } from '../config/const';
|
||||
import { getPid, killTask, rmPath } from '../config/util';
|
||||
import { getFileContentByName, getPid, killTask, rmPath } from '../config/util';
|
||||
|
||||
@Service()
|
||||
export default class ScriptService {
|
||||
@@ -61,4 +61,10 @@ export default class ScriptService {
|
||||
|
||||
return { code: 200 };
|
||||
}
|
||||
|
||||
public async getFile(filePath: string, fileName: string) {
|
||||
const _filePath = join(config.scriptPath, filePath, fileName);
|
||||
const content = await getFileContentByName(_filePath);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user