.purchase.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. "demand",
  5. "type",
  6. "purchase_type",
  7. "money",
  8. "contacts",
  9. "phone",
  10. "email",
  11. "user_id",
  12. "status",
  13. ],
  14. },
  15. destroy: {
  16. params: ["!id"],
  17. service: "delete",
  18. },
  19. update: {
  20. params: ["!id"],
  21. requestBody: [
  22. "demand",
  23. "type",
  24. "purchase_type",
  25. "money",
  26. "contacts",
  27. "phone",
  28. "email",
  29. "user_id",
  30. "status",
  31. ],
  32. },
  33. show: {
  34. parameters: {
  35. params: ["!id"],
  36. },
  37. service: "fetch",
  38. },
  39. index: {
  40. parameters: {
  41. query: {
  42. code: "code",
  43. user_id: "user_id",
  44. status: "status",
  45. type: "type",
  46. purchase_type: "purchase_type",
  47. contacts: "contacts",
  48. "money@start": "money@start",
  49. "money@end": "money@end",
  50. },
  51. // options: {
  52. // "meta.state": 0 // 默认条件
  53. // },
  54. },
  55. service: "query",
  56. options: {
  57. query: ["skip", "limit"],
  58. sort: ["meta.createdAt"],
  59. desc: true,
  60. count: true,
  61. },
  62. },
  63. };