.news.js 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. '!column_id',
  5. '!title',
  6. '!orgin',
  7. '!publish',
  8. '!content',
  9. 'picture'
  10. ]
  11. },
  12. destroy: {
  13. params: ['!id'],
  14. service: 'delete'
  15. },
  16. update: {
  17. params: ['!id'],
  18. requestBody: [
  19. 'column_id',
  20. 'title',
  21. 'orgin',
  22. 'publish',
  23. 'content',
  24. 'picture'
  25. ]
  26. },
  27. show: {
  28. parameters: {
  29. params: ['!id']
  30. },
  31. service: 'fetch'
  32. },
  33. index: {
  34. parameters: {
  35. query: {
  36. column_id : 'column_id',
  37. title : 'title',
  38. orgin : 'orgin',
  39. publish: 'publish',
  40. content : 'content',
  41. picture : 'picture'
  42. }
  43. },
  44. service: 'query',
  45. options: {
  46. query: ['skip', 'limit'],
  47. sort: ['meta.createdAt'],
  48. desc: true,
  49. count: true
  50. }
  51. },
  52. };