石墨消解仪后端用nodejs编写,与嵌入式端交互和前端交互均用ws
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
840 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. const Router = require("koa-router");
  2. const router = new Router({ prefix: "/chicken" });
  3. const { auth, hasAdminPermission } = require("../middleware/auth.middleware");
  4. const {
  5. verifyChickenNumberRightful,
  6. } = require("../middleware/chicken.middleware");
  7. const {
  8. add,
  9. info,
  10. all,
  11. batchs,
  12. batchnum,
  13. ratio,
  14. noratioCoops,
  15. allbatch,
  16. } = require("../controller/chicken.controller");
  17. router.post("/add", auth, verifyChickenNumberRightful, add);
  18. // 根据id获取新进鸡苗记录详情。
  19. router.get("/info", auth, info);
  20. router.get("/allbatch", auth, allbatch);
  21. // 根据条件查询新进记录
  22. router.post("/all", auth, all);
  23. router.get("/batchs", auth, batchs);
  24. router.get("/batchnum", auth, batchnum);
  25. router.post("/ratio", auth, ratio);
  26. router.post("/coops/noratio", auth, noratioCoops);
  27. module.exports = router;