.user.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. "phone",
  5. "password",
  6. "type",
  7. "icon",
  8. "nickname",
  9. "gender",
  10. "work",
  11. "mechanism",
  12. "email",
  13. "status",
  14. ],
  15. },
  16. destroy: {
  17. params: ["!id"],
  18. service: "delete",
  19. },
  20. update: {
  21. params: ["!id"],
  22. requestBody: [
  23. "phone",
  24. "password",
  25. "type",
  26. "icon",
  27. "nickname",
  28. "gender",
  29. "work",
  30. "mechanism",
  31. "email",
  32. "status",
  33. ],
  34. },
  35. show: {
  36. parameters: {
  37. params: ["!id"],
  38. },
  39. service: "fetch",
  40. },
  41. index: {
  42. parameters: {
  43. query: {
  44. phone: "phone",
  45. type: "type",
  46. nickname: "nickname",
  47. gender: "gender",
  48. work: "work",
  49. mechanism:"mechanism",
  50. email: "email",
  51. status: "status",
  52. "meta.createdAt@start": "meta.createdAt@start",
  53. "meta.createdAt@end": "meta.createdAt@end",
  54. },
  55. // options: {
  56. // "meta.state": 0 // 默认条件
  57. // },
  58. },
  59. service: "query",
  60. options: {
  61. query: ["skip", "limit"],
  62. sort: ["meta.createdAt"],
  63. desc: true,
  64. count: true,
  65. },
  66. },
  67. login: {
  68. requestBody: ["!phone", "!password"],
  69. },
  70. updatePwd: {
  71. params: ["!id"],
  72. requestBody: ["!password"],
  73. },
  74. };