.user.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. module.exports = {
  2. create: {
  3. requestBody: ['is_leader', 'name', 'phone', 'password', 'icon', 'birth', 'gender', 'email', 'openid', 'status'],
  4. },
  5. destroy: {
  6. requestBody: ['!key', '!target'],
  7. service: 'delete',
  8. },
  9. update: {
  10. params: ['!id'],
  11. requestBody: ['is_leader', 'name', 'phone', 'password', 'icon', 'birth', 'gender', 'email', 'openid', '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. name: '%name%',
  25. phone: 'phone',
  26. gender: 'gender',
  27. email: 'email',
  28. openid: 'openid',
  29. status: 'status',
  30. is_leader: 'is_leader',
  31. },
  32. // options: {
  33. // "meta.state": 0 // 默认条件
  34. // },
  35. },
  36. service: 'query',
  37. options: {
  38. query: ['skip', 'limit'],
  39. sort: ['meta.createdAt'],
  40. desc: true,
  41. count: true,
  42. },
  43. },
  44. resetPwd: {
  45. params: ['!id'],
  46. requestBody: ['!password'],
  47. },
  48. login: {
  49. requestBody: ['!phone', '!password'],
  50. },
  51. wxLogin: {
  52. requestBody: ['!openid'],
  53. },
  54. toBindEmail: {
  55. requestBody: ['!id', '!email'],
  56. },
  57. checkBindEmail: {
  58. requestBody: ['!code', '!id', '!email'],
  59. },
  60. toBindPhone: {
  61. requestBody: ['!id', '!phone'],
  62. },
  63. checkBindPhone: {
  64. requestBody: ['!code', '!id', '!phone'],
  65. },
  66. toLoginByCode: {
  67. requestBody: ['!phone'],
  68. },
  69. checkLoginCode: {
  70. requestBody: ['!code', '!phone'],
  71. },
  72. cct: {
  73. service: 'changeCacheToken',
  74. },
  75. };