const express = require('express');
const router = express.Router();

// 正确导入控制器
const designController = require('../controllers/design.controller');

// 验证控制器函数是否存在
if (!designController.getColorStatistics) {
  throw new Error('designController.getColorStatistics is undefined');
}

// 确保传递完整的函数引用
router.get('/color-statistics', designController.getColorStatistics);

// 添加其他端点
router.post('/record', designController.recordDesignUsage);

module.exports = router;