.news.js 1.1 KB

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