.agent_mech.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module.exports = {
  2. create: {
  3. requestBody: ['pid', 'pid_name', 'mech_name', 'name', '!phone', 'password', 'role', 'remark'],
  4. },
  5. destroy: {
  6. params: ['!id'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['pid', 'pid_name', 'mech_name', 'name', '!phone', 'password', 'role', 'remark'],
  12. },
  13. show: {
  14. parameters: {
  15. params: ['!id'],
  16. },
  17. service: 'fetch',
  18. },
  19. index: {
  20. parameters: {
  21. query: {
  22. pid: 'pid',
  23. pid_name: '%pid_name%',
  24. mech_name: '%mech_name%',
  25. name: '%name%',
  26. phone: 'phone',
  27. role: 'role',
  28. 'meta.createdAt@start': 'meta.createdAt@start',
  29. 'meta.createdAt@end': 'meta.createdAt@end',
  30. },
  31. // options: {
  32. // "meta.state": 0 // 默认条件
  33. // },
  34. },
  35. service: 'query',
  36. options: {
  37. query: ['skip', 'limit'],
  38. sort: ['meta.createdAt'],
  39. desc: true,
  40. count: true,
  41. },
  42. },
  43. login: {
  44. requestBody: ['!phone', '!password'],
  45. },
  46. };