mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
备份数据支持选择模块,支持清除依赖缓存
This commit is contained in:
+24
-1
@@ -316,10 +316,15 @@ export default (app: Router) => {
|
||||
|
||||
route.put(
|
||||
'/data/export',
|
||||
celebrate({
|
||||
body: Joi.object({
|
||||
type: Joi.array().items(Joi.string()).optional(),
|
||||
}),
|
||||
}),
|
||||
async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const systemService = Container.get(SystemService);
|
||||
await systemService.exportData(res);
|
||||
await systemService.exportData(res, req.body.type);
|
||||
} catch (e) {
|
||||
return next(e);
|
||||
}
|
||||
@@ -416,4 +421,22 @@ export default (app: Router) => {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
route.put(
|
||||
'/config/dependence-clean',
|
||||
celebrate({
|
||||
body: Joi.object({
|
||||
type: Joi.string().allow(''),
|
||||
}),
|
||||
}),
|
||||
async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const systemService = Container.get(SystemService);
|
||||
const result = await systemService.cleanDependence(req.body.type);
|
||||
res.send(result);
|
||||
} catch (e) {
|
||||
return next(e);
|
||||
}
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user