.expert.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. module.exports = {
  2. create: {
  3. requestBody: [
  4. 'name',
  5. 'phone',
  6. 'password',
  7. 'card',
  8. 'birth',
  9. 'qqwx',
  10. 'email',
  11. 'zwzc',
  12. 'education',
  13. 'school',
  14. 'major',
  15. 'company',
  16. 'icon',
  17. 'expertise',
  18. 'workexperience',
  19. 'scientific',
  20. 'undertakingproject',
  21. 'scienceaward',
  22. 'social',
  23. 'status',
  24. ],
  25. },
  26. destroy: {
  27. params: ['!id'],
  28. service: 'delete',
  29. },
  30. update: {
  31. params: ['!id'],
  32. requestBody: [
  33. 'name',
  34. 'phone',
  35. 'card',
  36. 'birth',
  37. 'qqwx',
  38. 'email',
  39. 'zwzc',
  40. 'education',
  41. 'school',
  42. 'major',
  43. 'company',
  44. 'icon',
  45. 'expertise',
  46. 'workexperience',
  47. 'scientific',
  48. 'undertakingproject',
  49. 'scienceaward',
  50. 'social',
  51. 'status',
  52. ],
  53. },
  54. show: {
  55. parameters: {
  56. params: ['!id'],
  57. },
  58. service: 'fetch',
  59. },
  60. index: {
  61. parameters: {
  62. query: {
  63. name: 'name',
  64. phone: 'phone',
  65. card: 'card',
  66. education: 'education',
  67. status: 'status',
  68. 'meta.createdAt@start': 'meta.createdAt@start',
  69. 'meta.createdAt@end': 'meta.createdAt@end',
  70. },
  71. // options: {
  72. // "meta.state": 0 // 默认条件
  73. // },
  74. },
  75. service: 'query',
  76. options: {
  77. query: ['skip', 'limit'],
  78. sort: ['meta.createdAt'],
  79. desc: true,
  80. count: true,
  81. },
  82. },
  83. login: {
  84. requestBody: ['!phone', '!password'],
  85. },
  86. updatePwd: {
  87. params: ['!id'],
  88. requestBody: ['!password'],
  89. },
  90. };