Files
nxxmdata/government-backend/routes/vaccine.js

40 lines
850 B
JavaScript
Raw Normal View History

const express = require('express')
const router = express.Router()
const {
getVaccines,
getVaccineById,
createVaccine,
updateVaccine,
deleteVaccine,
batchDeleteVaccines,
stockIn,
stockOut
} = require('../controllers/VaccineController')
const auth = require('../middleware/auth')
// 获取疫苗列表
router.get('/list', auth, getVaccines)
// 获取疫苗详情
router.get('/detail/:id', auth, getVaccineById)
// 创建疫苗
router.post('/create', auth, createVaccine)
// 更新疫苗
router.put('/update/:id', auth, updateVaccine)
// 删除疫苗
router.delete('/delete/:id', auth, deleteVaccine)
// 批量删除疫苗
router.delete('/batch-delete', auth, batchDeleteVaccines)
// 疫苗入库
router.post('/stock-in/:id', auth, stockIn)
// 疫苗出库
router.post('/stock-out/:id', auth, stockOut)
module.exports = router