studio.interface.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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_studio {
  12. constructor(data: object) {
  13. dealVO(this, data);
  14. }
  15. @ApiProperty({ description: '数据id' })
  16. _id: string = undefined;
  17. @ApiProperty({ description: '绑定用户' })
  18. 'user_id': string = undefined;
  19. @ApiProperty({ description: '依托单位id' })
  20. 'company_id': string = undefined;
  21. @ApiProperty({ description: '依托单位名称' })
  22. 'company_name': string = undefined;
  23. @ApiProperty({ description: '专业领域' })
  24. 'zy_fields': Array<any> = undefined;
  25. @ApiProperty({ description: '申报日期' })
  26. 'apply_time': string = undefined;
  27. @ApiProperty({ description: '工作室名称(申报)' })
  28. 'apply_name': string = undefined;
  29. @ApiProperty({ description: '工作室名称(正式)' })
  30. 'name': string = undefined;
  31. @ApiProperty({ description: '科学家绑定用户' })
  32. 'scientist_id': string = undefined;
  33. @ApiProperty({ description: '科学家信息' })
  34. 'scientistinfo_id': string = undefined;
  35. @ApiProperty({ description: '科学家姓名' })
  36. 'scientist_name': string = undefined;
  37. @ApiProperty({ description: '合作领域' })
  38. 'hz_fields': Array<any> = undefined;
  39. @ApiProperty({ description: '合作方向' })
  40. 'hz_direction': Array<any> = undefined;
  41. @ApiProperty({ description: '入驻协议' })
  42. 'settle_file': Array<any> = undefined;
  43. @ApiProperty({ description: '科学家所在单位同意入驻证明材料' })
  44. 'unit_settle_file': Array<any> = undefined;
  45. @ApiProperty({ description: '建设方案' })
  46. 'build_file': Array<any> = undefined;
  47. @ApiProperty({ description: '状态' })
  48. 'status': string = undefined;
  49. @ApiProperty({ description: '记录' })
  50. 'record': Array<any> = undefined;
  51. }
  52. export class QDTO_studio extends SearchBase {
  53. constructor() {
  54. const like_prop = [];
  55. const props = ['user_id', 'company_id', 'company_name', 'apply_time', 'apply_name', 'name', 'scientist_id', 'scientistinfo_id', 'scientist_name', 'status'];
  56. const mapping = [];
  57. super({ like_prop, props, mapping });
  58. }
  59. @ApiProperty({ description: '绑定用户' })
  60. 'user_id': string = undefined;
  61. @ApiProperty({ description: '依托单位id' })
  62. 'company_id': string = undefined;
  63. @ApiProperty({ description: '依托单位名称' })
  64. 'company_name': string = undefined;
  65. @ApiProperty({ description: '申报日期' })
  66. 'apply_time': string = undefined;
  67. @ApiProperty({ description: '工作室名称(申报)' })
  68. 'apply_name': string = undefined;
  69. @ApiProperty({ description: '工作室名称(正式)' })
  70. 'name': string = undefined;
  71. @ApiProperty({ description: '科学家绑定用户' })
  72. 'scientist_id': string = undefined;
  73. @ApiProperty({ description: '科学家信息' })
  74. 'scientistinfo_id': string = undefined;
  75. @ApiProperty({ description: '科学家姓名' })
  76. 'scientist_name': string = undefined;
  77. @ApiProperty({ description: '状态' })
  78. 'status': string = undefined;
  79. }
  80. export class QVO_studio extends FVO_studio {
  81. constructor(data: object) {
  82. super(data);
  83. dealVO(this, data);
  84. }
  85. }
  86. export class CDTO_studio {
  87. @ApiProperty({ description: '绑定用户' })
  88. @Rule(RuleType['string']().empty(''))
  89. 'user_id': string = undefined;
  90. @ApiProperty({ description: '依托单位id' })
  91. @Rule(RuleType['string']().empty(''))
  92. 'company_id': string = undefined;
  93. @ApiProperty({ description: '依托单位名称' })
  94. @Rule(RuleType['string']().empty(''))
  95. 'company_name': string = undefined;
  96. @ApiProperty({ description: '专业领域' })
  97. @Rule(RuleType['array']().empty(''))
  98. 'zy_fields': Array<any> = undefined;
  99. @ApiProperty({ description: '申报日期' })
  100. @Rule(RuleType['string']().empty(''))
  101. 'apply_time': string = undefined;
  102. @ApiProperty({ description: '工作室名称(申报)' })
  103. @Rule(RuleType['string']().empty(''))
  104. 'apply_name': string = undefined;
  105. @ApiProperty({ description: '工作室名称(正式)' })
  106. @Rule(RuleType['string']().empty(''))
  107. 'name': string = undefined;
  108. @ApiProperty({ description: '科学家绑定用户' })
  109. @Rule(RuleType['string']().empty(''))
  110. 'scientist_id': string = undefined;
  111. @ApiProperty({ description: '科学家信息' })
  112. @Rule(RuleType['string']().empty(''))
  113. 'scientistinfo_id': string = undefined;
  114. @ApiProperty({ description: '科学家姓名' })
  115. @Rule(RuleType['string']().empty(''))
  116. 'scientist_name': string = undefined;
  117. @ApiProperty({ description: '合作领域' })
  118. @Rule(RuleType['array']().empty(''))
  119. 'hz_fields': Array<any> = undefined;
  120. @ApiProperty({ description: '合作方向' })
  121. @Rule(RuleType['array']().empty(''))
  122. 'hz_direction': Array<any> = undefined;
  123. @ApiProperty({ description: '入驻协议' })
  124. @Rule(RuleType['array']().empty(''))
  125. 'settle_file': Array<any> = undefined;
  126. @ApiProperty({ description: '科学家所在单位同意入驻证明材料' })
  127. @Rule(RuleType['array']().empty(''))
  128. 'unit_settle_file': Array<any> = undefined;
  129. @ApiProperty({ description: '建设方案' })
  130. @Rule(RuleType['array']().empty(''))
  131. 'build_file': Array<any> = undefined;
  132. @ApiProperty({ description: '状态' })
  133. @Rule(RuleType['string']().empty(''))
  134. 'status': string = undefined;
  135. @ApiProperty({ description: '记录' })
  136. @Rule(RuleType['array']().empty(''))
  137. 'record': Array<any> = undefined;
  138. }
  139. export class CVO_studio extends FVO_studio {
  140. constructor(data: object) {
  141. super(data);
  142. dealVO(this, data);
  143. }
  144. }
  145. export class UDTO_studio extends CDTO_studio {
  146. @ApiProperty({ description: '数据id' })
  147. @Rule(RuleType['string']().empty(''))
  148. _id: string = undefined;
  149. }
  150. export class UVAO_studio extends FVO_studio {
  151. constructor(data: object) {
  152. super(data);
  153. dealVO(this, data);
  154. }
  155. }