石墨消解仪后端用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.

64 lines
1.2 KiB

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
2 years ago
2 years ago
2 years ago
  1. const { DataTypes } = require("sequelize");
  2. const seq = require("../db/seq");
  3. const Environment = seq.define("chicken_environment", {
  4. // id 会被sequelize自动创建, 管理
  5. house_id: {
  6. type: DataTypes.INTEGER,
  7. allowNull: false,
  8. comment: "鸡舍id",
  9. },
  10. coop_id: {
  11. type: DataTypes.INTEGER,
  12. allowNull: false,
  13. unique: true,
  14. comment: "鸡舍id",
  15. },
  16. temperature: {
  17. type: DataTypes.STRING,
  18. allowNull: true,
  19. comment: "温度",
  20. },
  21. humidity: {
  22. type: DataTypes.STRING,
  23. allowNull: true,
  24. comment: "湿度",
  25. },
  26. co2: {
  27. type: DataTypes.STRING,
  28. allowNull: true,
  29. comment: "co2",
  30. },
  31. nh3: {
  32. type: DataTypes.STRING,
  33. allowNull: true,
  34. comment: "nh3",
  35. },
  36. illumination: {
  37. type: DataTypes.STRING,
  38. allowNull: true,
  39. comment: "光照强度",
  40. },
  41. wind_speed: {
  42. type: DataTypes.STRING,
  43. allowNull: true,
  44. comment: "风速",
  45. },
  46. h2s: {
  47. type: DataTypes.STRING,
  48. allowNull: true,
  49. comment: "h2s",
  50. },
  51. log_time: {
  52. type: DataTypes.DATE,
  53. allowNull: false,
  54. defaultValue: DataTypes.NOW,
  55. comment: "记录时间",
  56. },
  57. });
  58. // 强制同步数据库(创建数据表)
  59. // Environment.sync({ force: true });
  60. module.exports = Environment;