.declare.js 1.3 KB

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