.admin.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module.exports = {
  2. create: {
  3. requestBody: ['email', 'account', 'password', 'name', 'role', 'shop'],
  4. },
  5. destroy: {
  6. params: ['!id'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['email', 'account', 'password', 'name', 'role', 'shop'],
  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. account: 'account',
  25. shop: 'shop',
  26. role: 'role',
  27. },
  28. // options: {
  29. // "meta.state": 0 // 默认条件
  30. // },
  31. },
  32. service: 'query',
  33. options: {
  34. query: ['skip', 'limit'],
  35. sort: ['meta.createdAt'],
  36. desc: true,
  37. count: true,
  38. },
  39. },
  40. login: {
  41. requestBody: ['!account', '!password'],
  42. },
  43. resetPwd: {
  44. params: ['!id'],
  45. requestBody: ['!password'],
  46. },
  47. emailResetPwd: {
  48. requestBody: ['!account'],
  49. },
  50. toMakeKey: {
  51. requestBody: ['!password', '!target'],
  52. },
  53. };