.order.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports = {
  2. create: {
  3. requestBody: ['plus_goods', 'inviter', 'type', 'group', 'customer', 'address', 'goods', 'total_detail', 'buy_time', 'pay', 'no', 'status', 'coupon'],
  4. },
  5. destroy: {
  6. params: ['!id'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['plus_goods', 'type', 'group', 'customer', 'address', 'goods', 'buy_time', 'pay', 'no', '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. customer: 'customer',
  25. 'buy_time@start': 'buy_time@start',
  26. 'buy_time@end': 'buy_time@end',
  27. 'pay_time@start': 'pay.pay_time@start',
  28. 'pay_time@end': 'pay.pay_time@end',
  29. shop: 'goods.shop',
  30. no: 'no',
  31. status: 'status',
  32. type: 'type',
  33. group: 'group',
  34. goods: '%goods.goods.goods.name%',
  35. },
  36. // options: {
  37. // "meta.state": 0 // 默认条件
  38. // },
  39. },
  40. service: 'query',
  41. options: {
  42. query: ['skip', 'limit'],
  43. sort: ['meta.createdAt'],
  44. desc: true,
  45. count: true,
  46. },
  47. },
  48. toMakeOrder: {
  49. requestBody: ['!key'],
  50. },
  51. fromGoodsToOrder: {
  52. requestBody: ['!shop', '!goods', '!goodsSpec', '!num'],
  53. },
  54. cancel: {
  55. requestBody: ['!order_id'],
  56. },
  57. };