Files

15 lines
699 B
JavaScript
Raw Permalink Normal View History

2026-05-26 09:18:48 +08:00
const Router = require('koa-router')
const pointsGoodsController = require('../controllers/points-goods')
2026-06-03 14:15:55 +08:00
const { requireAuth, requireStaffAuth, requireAdminAuth } = require('../middleware/auth')
2026-05-26 09:18:48 +08:00
const router = new Router()
router.get('/', pointsGoodsController.getPointsGoods)
router.get('/:id', pointsGoodsController.getPointsGoodsById)
2026-06-04 18:43:38 +08:00
router.post('/', requireStaffAuth(), pointsGoodsController.createPointsGoods)
router.put('/:id', requireStaffAuth(), pointsGoodsController.updatePointsGoods)
router.delete('/:id', requireStaffAuth(), pointsGoodsController.deletePointsGoods)
2026-06-03 14:15:55 +08:00
router.post('/exchange', requireAuth(), pointsGoodsController.exchangePointsGoods)
2026-05-26 09:18:48 +08:00
module.exports = router.routes()