.answer.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. "questionnaire_id",
  5. "answer",
  6. "user_id",
  7. "phone",
  8. "contacts",
  9. "company",
  10. "create_user",
  11. "address",
  12. "attribute",
  13. "category",
  14. ],
  15. },
  16. destroy: {
  17. params: ["!id"],
  18. service: "delete",
  19. },
  20. update: {
  21. params: ["!id"],
  22. requestBody: [
  23. "questionnaire_id",
  24. "answer",
  25. "user_id",
  26. "phone",
  27. "contacts",
  28. "company",
  29. "address",
  30. "attribute",
  31. "category",
  32. ],
  33. },
  34. show: {
  35. parameters: {
  36. params: ["!id"],
  37. },
  38. service: "fetch",
  39. },
  40. index: {
  41. parameters: {
  42. query: {
  43. questionnaire_id: "questionnaire_id",
  44. answer: "answer",
  45. user_id: "user_id",
  46. phone: "phone",
  47. contacts: "contacts",
  48. company: "company",
  49. "create_time@start": "create_time@start",
  50. "create_time@end": "create_time@end",
  51. },
  52. // options: {
  53. // "meta.state": 0 // 默认条件
  54. // },
  55. },
  56. service: "query",
  57. options: {
  58. query: ["skip", "limit"],
  59. sort: ["meta.createdAt"],
  60. desc: true,
  61. count: true,
  62. },
  63. },
  64. getAnswer: {
  65. parameters: {
  66. query: {
  67. questionnaire_id: "questionnaire_id",
  68. user_id: "user_id",
  69. },
  70. },
  71. service: "findOne",
  72. },
  73. };