备份数据支持选择模块,支持清除依赖缓存

This commit is contained in:
whyour
2025-06-22 14:25:19 +08:00
parent c9bd053fbd
commit ef9e38f167
7 changed files with 329 additions and 149 deletions
+24 -1
View File
@@ -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);
}
},
);
};