const express = require('express');
const router = express.Router();
const assetController = require('../controllers/assetController');
const { authenticate } = require('../middleware/authenticate');
const upload = require('../middleware/upload');

// Upload
router.post('/upload', authenticate, upload.single('file'), assetController.upload);
router.post('/upload-multiple', authenticate, upload.array('files', 10), assetController.uploadMultiple);

// AI Generation
router.post('/generate-ai', authenticate, assetController.generateAi);

// CRUD
router.get('/', authenticate, assetController.list);
router.get('/:id', assetController.getById);
router.get('/:id/file', assetController.getFile);
router.get('/:id/thumbnail', assetController.getThumbnail);
router.delete('/:id', authenticate, assetController.delete);

module.exports = router;