.news.js 786 B

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