.modules.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. module.exports = {
  2. // 添加模块
  3. "create": {
  4. "parameters": {
  5. "query": ["!site"],
  6. },
  7. "requestBody": ["title", "type", "is_use","category"],
  8. },
  9. // 修改模块
  10. "update": {
  11. "parameters": {
  12. "params": ["!id"],
  13. },
  14. "requestBody": ["title", "type", "is_use", "category"],
  15. // "options": {
  16. // "projection": "+name",
  17. // },
  18. },
  19. // 获取模块详情
  20. "fetch": {
  21. "parameters": {
  22. "params": ["!id"],
  23. },
  24. // "options": {
  25. // "projection": "+content",
  26. // },
  27. },
  28. // 删除模块
  29. "delete": {
  30. "parameters": {
  31. "params": ["!id"],
  32. },
  33. },
  34. // 恢复模块
  35. "restore": {
  36. "parameters": {
  37. "params": ["!id"],
  38. },
  39. },
  40. // 后台查询模块列表
  41. "query": {
  42. "parameters": {
  43. "query": ["!site", "is_use"],
  44. "options": {
  45. "meta.state": 0, // 只显示未删除数据
  46. },
  47. },
  48. "service": "query",
  49. "options": {
  50. "query": ["skip", "limit"],
  51. "sort": ["meta.createdAt"],
  52. "desc": true,
  53. "count": true,
  54. "projection": {
  55. "attachment": 0
  56. }
  57. }
  58. },
  59. // 前台加载模块列表
  60. "list": {
  61. "parameters": {
  62. "query": ["!site"],
  63. "options": {
  64. "meta.state": 0, // 只显示未删除数据
  65. },
  66. },
  67. "service": "query",
  68. "options": {
  69. "query": ["skip", "limit"],
  70. "sort": ["meta.createdAt"],
  71. "desc": true,
  72. "count": true,
  73. "projection": {
  74. "attachment": 0
  75. }
  76. }
  77. },
  78. };