.service.js 995 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. "create_time@start": "create_time@start",
  45. "create_time@end": "create_time@end",
  46. },
  47. // options: {
  48. // "meta.state": 0 // 默认条件
  49. // },
  50. },
  51. service: "query",
  52. options: {
  53. query: ["skip", "limit"],
  54. sort: ["meta.createdAt"],
  55. desc: true,
  56. count: true,
  57. },
  58. },
  59. };