personal.interface.ts 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. import { Rule, RuleType } from '@midwayjs/validate';
  2. import { ApiProperty } from '@midwayjs/swagger';
  3. import { SearchBase } from 'free-midway-component';
  4. import get = require('lodash/get');
  5. const dealVO = (cla, data) => {
  6. for (const key in cla) {
  7. const val = get(data, key);
  8. if (val || val === 0) cla[key] = val;
  9. }
  10. };
  11. export class FVO_personal {
  12. constructor(data: object) {
  13. dealVO(this, data);
  14. }
  15. @ApiProperty({ description: '数据id' })
  16. _id: string = undefined;
  17. @ApiProperty({ description: '用户类型' })
  18. 'type': string = undefined;
  19. @ApiProperty({ description: '邀请码' })
  20. 'code': string = undefined;
  21. @ApiProperty({ description: '账号' })
  22. 'account': string = undefined;
  23. @ApiProperty({ description: '密码' })
  24. 'password': string = undefined;
  25. @ApiProperty({ description: '姓名' })
  26. 'name': string = undefined;
  27. @ApiProperty({ description: '手机号' })
  28. 'phone': string = undefined;
  29. @ApiProperty({ description: '电子邮箱' })
  30. 'email': string = undefined;
  31. @ApiProperty({ description: '联系地址' })
  32. 'address': string = undefined;
  33. @ApiProperty({ description: '办公电话' })
  34. 'work_phone': string = undefined;
  35. @ApiProperty({ description: '所属行业' })
  36. 'industry': string = undefined;
  37. @ApiProperty({ description: '所属辖区' })
  38. 'area': string = undefined;
  39. @ApiProperty({ description: '身份证号' })
  40. 'card': string = undefined;
  41. @ApiProperty({ description: '职务职称' })
  42. 'zwzc': string = undefined;
  43. @ApiProperty({ description: '所在院系' })
  44. 'school': string = undefined;
  45. @ApiProperty({ description: '所学专业' })
  46. 'major': string = undefined;
  47. @ApiProperty({ description: '状态' })
  48. 'status': string = undefined;
  49. }
  50. export class QDTO_personal extends SearchBase {
  51. constructor() {
  52. const like_prop = [];
  53. const props = [
  54. 'type',
  55. 'code',
  56. 'account',
  57. 'password',
  58. 'name',
  59. 'phone',
  60. 'email',
  61. 'address',
  62. 'work_phone',
  63. 'industry',
  64. 'area',
  65. 'card',
  66. 'zwzc',
  67. 'school',
  68. 'major',
  69. 'status',
  70. ];
  71. const mapping = [];
  72. super({ like_prop, props, mapping });
  73. }
  74. @ApiProperty({ description: '用户类型' })
  75. 'type': string = undefined;
  76. @ApiProperty({ description: '邀请码' })
  77. 'code': string = undefined;
  78. @ApiProperty({ description: '账号' })
  79. 'account': string = undefined;
  80. @ApiProperty({ description: '密码' })
  81. 'password': string = undefined;
  82. @ApiProperty({ description: '姓名' })
  83. 'name': string = undefined;
  84. @ApiProperty({ description: '手机号' })
  85. 'phone': string = undefined;
  86. @ApiProperty({ description: '电子邮箱' })
  87. 'email': string = undefined;
  88. @ApiProperty({ description: '联系地址' })
  89. 'address': string = undefined;
  90. @ApiProperty({ description: '办公电话' })
  91. 'work_phone': string = undefined;
  92. @ApiProperty({ description: '所属行业' })
  93. 'industry': string = undefined;
  94. @ApiProperty({ description: '所属辖区' })
  95. 'area': string = undefined;
  96. @ApiProperty({ description: '身份证号' })
  97. 'card': string = undefined;
  98. @ApiProperty({ description: '职务职称' })
  99. 'zwzc': string = undefined;
  100. @ApiProperty({ description: '所在院系' })
  101. 'school': string = undefined;
  102. @ApiProperty({ description: '所学专业' })
  103. 'major': string = undefined;
  104. @ApiProperty({ description: '状态' })
  105. 'status': string = undefined;
  106. }
  107. export class QVO_personal extends FVO_personal {
  108. constructor(data: object) {
  109. super(data);
  110. dealVO(this, data);
  111. }
  112. }
  113. export class CDTO_personal {
  114. @ApiProperty({ description: '用户类型' })
  115. @Rule(RuleType['string']().empty(''))
  116. 'type': string = undefined;
  117. @ApiProperty({ description: '邀请码' })
  118. @Rule(RuleType['string']().empty(''))
  119. 'code': string = undefined;
  120. @ApiProperty({ description: '账号' })
  121. @Rule(RuleType['string']().empty(''))
  122. 'account': string = undefined;
  123. @ApiProperty({ description: '密码' })
  124. @Rule(RuleType['string']().empty(''))
  125. 'password': string = undefined;
  126. @ApiProperty({ description: '姓名' })
  127. @Rule(RuleType['string']().empty(''))
  128. 'name': string = undefined;
  129. @ApiProperty({ description: '手机号' })
  130. @Rule(RuleType['string']().empty(''))
  131. 'phone': string = undefined;
  132. @ApiProperty({ description: '电子邮箱' })
  133. @Rule(RuleType['string']().empty(''))
  134. 'email': string = undefined;
  135. @ApiProperty({ description: '联系地址' })
  136. @Rule(RuleType['string']().empty(''))
  137. 'address': string = undefined;
  138. @ApiProperty({ description: '办公电话' })
  139. @Rule(RuleType['string']().empty(''))
  140. 'work_phone': string = undefined;
  141. @ApiProperty({ description: '所属行业' })
  142. @Rule(RuleType['string']().empty(''))
  143. 'industry': string = undefined;
  144. @ApiProperty({ description: '所属辖区' })
  145. @Rule(RuleType['string']().empty(''))
  146. 'area': string = undefined;
  147. @ApiProperty({ description: '身份证号' })
  148. @Rule(RuleType['string']().empty(''))
  149. 'card': string = undefined;
  150. @ApiProperty({ description: '职务职称' })
  151. @Rule(RuleType['string']().empty(''))
  152. 'zwzc': string = undefined;
  153. @ApiProperty({ description: '所在院系' })
  154. @Rule(RuleType['string']().empty(''))
  155. 'school': string = undefined;
  156. @ApiProperty({ description: '所学专业' })
  157. @Rule(RuleType['string']().empty(''))
  158. 'major': string = undefined;
  159. @ApiProperty({ description: '状态' })
  160. @Rule(RuleType['string']().empty(''))
  161. 'status': string = undefined;
  162. }
  163. export class CVO_personal extends FVO_personal {
  164. constructor(data: object) {
  165. super(data);
  166. dealVO(this, data);
  167. }
  168. }
  169. export class UDTO_personal extends CDTO_personal {
  170. @ApiProperty({ description: '数据id' })
  171. @Rule(RuleType['string']().empty(''))
  172. _id: string = undefined;
  173. }
  174. export class UVAO_personal extends FVO_personal {
  175. constructor(data: object) {
  176. super(data);
  177. dealVO(this, data);
  178. }
  179. }
  180. export class LoginVO {
  181. constructor(data: object) {
  182. for (const key of Object.keys(this)) {
  183. this[key] = get(data, key);
  184. }
  185. this.type = '4';
  186. }
  187. @ApiProperty({ description: '数据id' })
  188. _id: string = undefined;
  189. @ApiProperty({ description: '用户类型' })
  190. 'type': string = undefined;
  191. @ApiProperty({ description: '邀请码' })
  192. 'code': string = undefined;
  193. @ApiProperty({ description: '账号' })
  194. 'account': string = undefined;
  195. @ApiProperty({ description: '密码' })
  196. 'password': string = undefined;
  197. @ApiProperty({ description: '姓名' })
  198. 'name': string = undefined;
  199. @ApiProperty({ description: '手机号' })
  200. 'phone': string = undefined;
  201. @ApiProperty({ description: '电子邮箱' })
  202. 'email': string = undefined;
  203. @ApiProperty({ description: '联系地址' })
  204. 'address': string = undefined;
  205. @ApiProperty({ description: '办公电话' })
  206. 'work_phone': string = undefined;
  207. @ApiProperty({ description: '所属行业' })
  208. 'industry': string = undefined;
  209. @ApiProperty({ description: '所属辖区' })
  210. 'area': string = undefined;
  211. @ApiProperty({ description: '身份证号' })
  212. 'card': string = undefined;
  213. @ApiProperty({ description: '职务职称' })
  214. 'zwzc': string = undefined;
  215. @ApiProperty({ description: '所在院系' })
  216. 'school': string = undefined;
  217. @ApiProperty({ description: '所学专业' })
  218. 'major': string = undefined;
  219. @ApiProperty({ description: '状态' })
  220. 'status': string = undefined;
  221. }
  222. export class LoginDTO {
  223. @ApiProperty({ description: '账号', example: 'test' })
  224. @Rule(RuleType['string']().empty(''))
  225. 'account': string = undefined;
  226. @ApiProperty({ description: '密码', example: '111111' })
  227. @Rule(RuleType['string']().empty(''))
  228. 'password': string = undefined;
  229. }
  230. export class ResetPasswordDTO {
  231. @ApiProperty({ description: '密码', example: '123456' })
  232. @Rule(RuleType['string']().required())
  233. 'password': string = undefined;
  234. }