.trainlive.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. "title",
  5. "province",
  6. "place",
  7. "sponsor",
  8. "brief",
  9. "user",
  10. "phone",
  11. "video_data",
  12. "user_data",
  13. "create_date",
  14. ],
  15. },
  16. destroy: {
  17. params: ["!id"],
  18. service: "delete",
  19. },
  20. update: {
  21. params: ["!id"],
  22. requestBody: [
  23. "title",
  24. "province",
  25. "place",
  26. "sponsor",
  27. "brief",
  28. "user",
  29. "phone",
  30. "video_data",
  31. "user_data",
  32. "create_date",
  33. ],
  34. },
  35. show: {
  36. parameters: {
  37. params: ["!id"],
  38. },
  39. service: "fetch",
  40. },
  41. index: {
  42. parameters: {
  43. query: {
  44. title: "title",
  45. province: "province",
  46. place: "place",
  47. sponsor: "sponsor",
  48. brief: "brief",
  49. user: "user",
  50. phone: "phone",
  51. "create_time@start": "create_time@start",
  52. "create_time@end": "create_time@end",
  53. },
  54. // options: {
  55. // "meta.status": 0 // 默认条件
  56. // },
  57. },
  58. service: "query",
  59. options: {
  60. query: ["skip", "limit"],
  61. sort: ["meta.createdAt"],
  62. desc: true,
  63. count: true,
  64. },
  65. },
  66. userData:{
  67. params: ["!id"],
  68. service: "userData",
  69. },
  70. addUser: {
  71. params: ["!id"],
  72. requestBody: ["users"],
  73. service: "addUser",
  74. },
  75. updateUser: {
  76. params: ["!id"],
  77. requestBody: ["users"],
  78. service: "updateUser",
  79. },
  80. deleteUser: {
  81. params: ["!id"],
  82. requestBody: ["users"],
  83. service: "deleteUser",
  84. },
  85. userLogin: {
  86. params: ["!id"],
  87. requestBody: ["user_phone", "user_password"],
  88. service: "userLogin",
  89. },
  90. userLogout: {
  91. params: ["!id"],
  92. service: "userLogout",
  93. },
  94. login:{
  95. requestBody: ["room_id", "password"],
  96. service: "login",
  97. },
  98. userLonger:{
  99. params: ["!id"],
  100. service: "userLonger",
  101. }
  102. };