import { Router } from 'express';
import { designService } from '../services/design.service';

const router = Router();

// 直接在这里实现端点逻辑
router.get('/color-statistics', async (req, res) => {
  try {
    const stats = await designService.getAllColorsStatistics();
    res.json({
      success: true,
      data: stats
    });
  } catch (error) {
    console.error('获取颜色统计失败:', error);
    res.status(500).json({
      success: false,
      error: '获取颜色统计数据失败'
    });
  }
});

export default router;