.service.js 1.0 KB

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