.goodsSpec.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. module.exports = {
  2. create: {
  3. requestBody: ['buy_limit', 'limit_num', 'leader_price', 'sort', 'file', 'can_group', 'group_config', 'sell_money', 'flow_money', 'freight', 'goods', 'name', 'num', 'status'],
  4. },
  5. destroy: {
  6. params: ['!id'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['buy_limit', 'limit_num', 'leader_price', 'sort', 'file', 'can_group', 'group_config', 'sell_money', 'flow_money', 'freight', 'goods', 'name', 'num', 'status'],
  12. },
  13. show: {
  14. parameters: {
  15. params: ['!id'],
  16. },
  17. service: 'fetch',
  18. },
  19. index: {
  20. parameters: {
  21. query: {
  22. 'meta.createdAt@start': 'meta.createdAt@start',
  23. 'meta.createdAt@end': 'meta.createdAt@end',
  24. goods: 'goods',
  25. name: '%name%',
  26. status: 'status',
  27. can_group: 'can_group',
  28. sort: 'sort',
  29. buy_limit: 'buy_limit',
  30. },
  31. // options: {
  32. // "meta.state": 0 // 默认条件
  33. // },
  34. },
  35. service: 'query',
  36. options: {
  37. query: ['skip', 'limit'],
  38. // sort: [{ sort: -1 }, { 'meta.createdAt': -1 }],
  39. sort: { sort: -1, 'meta.createdAt': -1 },
  40. desc: true,
  41. count: true,
  42. },
  43. },
  44. };