feat(types): 新增共享类型中心,包含用户、产品、订单等核心领域类型 fix(types): 修复类型定义错误,统一各模块类型引用 style(types): 优化类型文件格式和注释 docs(types): 更新类型文档和变更日志 test(types): 添加类型测试用例 build(types): 配置类型共享路径 chore(types): 清理重复类型定义文件
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { Router } from 'express';
|
|
import { AISelfImprovementController } from '../controllers/AISelfImprovementController';
|
|
import { Container } from 'typedi';
|
|
|
|
const router = Router();
|
|
const aiSelfImprovementController = Container.get(AISelfImprovementController);
|
|
|
|
// 生成改进建议
|
|
router.get('/suggestions/generate', (req, res, next) => {
|
|
aiSelfImprovementController.generateSuggestions()
|
|
.then(result => res.json(result))
|
|
.catch(next);
|
|
});
|
|
|
|
// 获取所有改进建议
|
|
router.get('/suggestions', (req, res, next) => {
|
|
aiSelfImprovementController.getSuggestions()
|
|
.then(result => res.json(result))
|
|
.catch(next);
|
|
});
|
|
|
|
// 更新建议状态
|
|
router.put('/suggestions/:id/status', (req, res, next) => {
|
|
aiSelfImprovementController.updateSuggestionStatus(req.params.id, req.body.status)
|
|
.then(result => res.json(result))
|
|
.catch(next);
|
|
});
|
|
|
|
// 自动应用改进建议
|
|
router.get('/suggestions/apply', (req, res, next) => {
|
|
aiSelfImprovementController.applySuggestions()
|
|
.then(result => res.json(result))
|
|
.catch(next);
|
|
});
|
|
|
|
// 执行定期优化
|
|
router.get('/optimize', (req, res, next) => {
|
|
aiSelfImprovementController.performOptimization()
|
|
.then(result => res.json(result))
|
|
.catch(next);
|
|
});
|
|
|
|
export default router;
|