achievement.interface.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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_achievement {
  12. constructor(data: object) {
  13. dealVO(this, data);
  14. }
  15. @ApiProperty({ description: '数据id' })
  16. _id: string = undefined;
  17. @ApiProperty({ description: '用户id' })
  18. 'user': string = undefined;
  19. @ApiProperty({ description: '专利号' })
  20. 'patent': string = undefined;
  21. @ApiProperty({ description: '名称' })
  22. 'name': string = undefined;
  23. @ApiProperty({ description: '属性' })
  24. 'attribute': string = undefined;
  25. @ApiProperty({ description: '出让方式' })
  26. 'sell': string = undefined;
  27. @ApiProperty({ description: '成熟度' })
  28. 'mature': string = undefined;
  29. @ApiProperty({ description: '行业领域' })
  30. 'field': string = undefined;
  31. @ApiProperty({ description: '技术分类' })
  32. 'technology': string = undefined;
  33. @ApiProperty({ description: '成果地区' })
  34. 'area': Array<any> = undefined;
  35. @ApiProperty({ description: '发布时间' })
  36. 'time': string = undefined;
  37. @ApiProperty({ description: '参考价格' })
  38. 'money': string = undefined;
  39. @ApiProperty({ description: '简介' })
  40. 'brief': string = undefined;
  41. @ApiProperty({ description: '附件' })
  42. 'file': Array<any> = undefined;
  43. @ApiProperty({ description: '成果状态' })
  44. 'achievement_status': string = undefined;
  45. @ApiProperty({ description: '是否公开' })
  46. 'is_use': string = undefined;
  47. @ApiProperty({ description: '状态' })
  48. 'status': string = undefined;
  49. }
  50. export class QDTO_achievement extends SearchBase {
  51. constructor() {
  52. const like_prop = ['name'];
  53. const props = ['user', 'patent', 'name', 'attribute', 'sell', 'mature', 'field', 'technology', 'money', 'status', 'achievement_status', 'is_use'];
  54. const mapping = [];
  55. super({ like_prop, props, mapping });
  56. }
  57. @ApiProperty({ description: '用户id' })
  58. 'user': string = undefined;
  59. @ApiProperty({ description: '专利号' })
  60. 'patent': string = undefined;
  61. @ApiProperty({ description: '名称' })
  62. 'name': string = undefined;
  63. @ApiProperty({ description: '属性' })
  64. 'attribute': string = undefined;
  65. @ApiProperty({ description: '出让方式' })
  66. 'sell': string = undefined;
  67. @ApiProperty({ description: '成熟度' })
  68. 'mature': string = undefined;
  69. @ApiProperty({ description: '行业领域' })
  70. 'field': string = undefined;
  71. @ApiProperty({ description: '技术分类' })
  72. 'technology': string = undefined;
  73. @ApiProperty({ description: '参考价格' })
  74. 'money': string = undefined;
  75. @ApiProperty({ description: '成果状态' })
  76. 'achievement_status': string = undefined;
  77. @ApiProperty({ description: '是否公开' })
  78. 'is_use': string = undefined;
  79. @ApiProperty({ description: '状态' })
  80. 'status': string = undefined;
  81. }
  82. export class QVO_achievement extends FVO_achievement {
  83. constructor(data: object) {
  84. super(data);
  85. dealVO(this, data);
  86. }
  87. }
  88. export class CDTO_achievement {
  89. @ApiProperty({ description: '用户id' })
  90. @Rule(RuleType['string']().empty(''))
  91. 'user': string = undefined;
  92. @ApiProperty({ description: '专利号' })
  93. @Rule(RuleType['string']().empty(''))
  94. 'patent': string = undefined;
  95. @ApiProperty({ description: '名称' })
  96. @Rule(RuleType['string']().empty(''))
  97. 'name': string = undefined;
  98. @ApiProperty({ description: '属性' })
  99. @Rule(RuleType['string']().empty(''))
  100. 'attribute': string = undefined;
  101. @ApiProperty({ description: '出让方式' })
  102. @Rule(RuleType['string']().empty(''))
  103. 'sell': string = undefined;
  104. @ApiProperty({ description: '成熟度' })
  105. @Rule(RuleType['string']().empty(''))
  106. 'mature': string = undefined;
  107. @ApiProperty({ description: '行业领域' })
  108. @Rule(RuleType['string']().empty(''))
  109. 'field': string = undefined;
  110. @ApiProperty({ description: '技术分类' })
  111. @Rule(RuleType['string']().empty(''))
  112. 'technology': string = undefined;
  113. @ApiProperty({ description: '成果地区' })
  114. @Rule(RuleType['array']().empty(''))
  115. 'area': Array<any> = undefined;
  116. @ApiProperty({ description: '发布时间' })
  117. @Rule(RuleType['string']().empty(''))
  118. 'time': string = undefined;
  119. @ApiProperty({ description: '参考价格' })
  120. @Rule(RuleType['string']().empty(''))
  121. 'money': string = undefined;
  122. @ApiProperty({ description: '简介' })
  123. @Rule(RuleType['string']().empty(''))
  124. 'brief': string = undefined;
  125. @ApiProperty({ description: '附件' })
  126. @Rule(RuleType['array']().empty(''))
  127. 'file': Array<any> = undefined;
  128. @ApiProperty({ description: 'achievement_status' })
  129. @Rule(RuleType['string']().empty(''))
  130. 'achievement_status': string = undefined;
  131. @ApiProperty({ description: '状态' })
  132. @Rule(RuleType['string']().empty(''))
  133. 'status': string = undefined;
  134. @ApiProperty({ description: '是否公开' })
  135. @Rule(RuleType['string']().empty(''))
  136. 'is_use': string = undefined;
  137. }
  138. export class CVO_achievement extends FVO_achievement {
  139. constructor(data: object) {
  140. super(data);
  141. dealVO(this, data);
  142. }
  143. }
  144. export class UDTO_achievement extends CDTO_achievement {
  145. @ApiProperty({ description: '数据id' })
  146. @Rule(RuleType['string']().empty(''))
  147. _id: string = undefined;
  148. }
  149. export class UVAO_achievement extends FVO_achievement {
  150. constructor(data: object) {
  151. super(data);
  152. dealVO(this, data);
  153. }
  154. }