.mechanism.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module.exports = {
  2. create: {
  3. requestBody: ['name', 'contacts', 'phone', 'passwd', 'email', 'address', 'juris', 'industry'],
  4. },
  5. destroy: {
  6. params: ['!id'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['name', 'contacts', 'phone', 'email', 'address', 'industry', 'juris', 'status'],
  12. },
  13. show: {
  14. parameters: {
  15. params: ['!id'],
  16. },
  17. service: 'fetch',
  18. },
  19. index: {
  20. parameters: {
  21. query: {
  22. name: 'name',
  23. industry: 'industry',
  24. juris: 'juris',
  25. 'create_time@start': 'create_time@start',
  26. 'create_time@end': 'create_time@end',
  27. },
  28. // options: {
  29. // "meta.state": 0 // 默认条件
  30. // },
  31. options: {
  32. isdel: '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. //修改密码
  44. password: {
  45. params: ['!id'],
  46. requestBody: ['passwd'],
  47. service: 'password',
  48. },
  49. // 登陆
  50. login: {
  51. requestBody: ['phone', 'passwd'],
  52. service: 'login',
  53. },
  54. };