Upkeep.interface.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. import { Rule, RuleType } from '@midwayjs/validate';
  2. import { ApiProperty } from '@midwayjs/swagger';
  3. import {
  4. FrameworkErrorEnum,
  5. SearchBase,
  6. ServiceError,
  7. } from 'free-midway-component';
  8. import get = require('lodash/get');
  9. const dealVO = (cla, data) => {
  10. for (const key in cla) {
  11. const val = get(data, key);
  12. if (val || val === 0) cla[key] = val;
  13. }
  14. };
  15. export class FVO_upkeep {
  16. constructor(data: object) {
  17. dealVO(this, data);
  18. }
  19. @ApiProperty({ description: '数据id' })
  20. _id: string = undefined;
  21. @ApiProperty({ description: '订单id' })
  22. 'order_id': string = undefined;
  23. @ApiProperty({ description: '用户id' })
  24. 'user': string = undefined;
  25. @ApiProperty({ description: '用户名称' })
  26. 'user_name': string = undefined;
  27. @ApiProperty({ description: '供应商id' })
  28. 'supplier': string = undefined;
  29. @ApiProperty({ description: '供应商名称' })
  30. 'supplier_name': string = undefined;
  31. @ApiProperty({ description: '商品id' })
  32. 'good': string = undefined;
  33. @ApiProperty({ description: '商品名称' })
  34. 'good_name': string = undefined;
  35. @ApiProperty({ description: '规格id' })
  36. 'spec': string = undefined;
  37. @ApiProperty({ description: '规格名称' })
  38. 'spec_name': string = undefined;
  39. @ApiProperty({ description: '维修地址' })
  40. 'address': string = undefined;
  41. @ApiProperty({ description: '商品图片' })
  42. 'good_file': Array<any> = undefined;
  43. @ApiProperty({ description: '规格图片' })
  44. 'spec_file': Array<any> = undefined;
  45. @ApiProperty({ description: '申请时间' })
  46. 'apply_time': string = undefined;
  47. @ApiProperty({ description: '状态' })
  48. 'status': string = undefined;
  49. }
  50. export class QDTO_upkeep extends SearchBase {
  51. constructor() {
  52. const like_prop = ['good_name', 'user_name', 'spec_name'];
  53. const props = [
  54. 'order_id',
  55. 'user',
  56. 'user_name',
  57. 'supplier',
  58. 'supplier_name',
  59. 'good',
  60. 'good_name',
  61. 'spec',
  62. 'spec_name',
  63. 'status',
  64. ];
  65. const mapping = [];
  66. super({ like_prop, props, mapping });
  67. }
  68. @ApiProperty({ description: '订单id' })
  69. 'order_id': string = undefined;
  70. @ApiProperty({ description: '用户id' })
  71. 'user': string = undefined;
  72. @ApiProperty({ description: '用户名称' })
  73. 'user_name': string = undefined;
  74. @ApiProperty({ description: '供应商id' })
  75. 'supplier': string = undefined;
  76. @ApiProperty({ description: '供应商名称' })
  77. 'supplier_name': string = undefined;
  78. @ApiProperty({ description: '商品id' })
  79. 'good': string = undefined;
  80. @ApiProperty({ description: '商品名称' })
  81. 'good_name': string = undefined;
  82. @ApiProperty({ description: '规格id' })
  83. 'spec': string = undefined;
  84. @ApiProperty({ description: '规格名称' })
  85. 'spec_name': string = undefined;
  86. @ApiProperty({ description: '状态' })
  87. 'status': string = undefined;
  88. }
  89. export class QVO_upkeep extends FVO_upkeep {
  90. constructor(data: object) {
  91. super(data);
  92. dealVO(this, data);
  93. }
  94. }
  95. export class CDTO_upkeep {
  96. @ApiProperty({ description: '订单id' })
  97. @Rule(RuleType['string']().empty(''))
  98. 'order_id': string = undefined;
  99. @ApiProperty({ description: '用户id' })
  100. @Rule(RuleType['string']().empty(''))
  101. 'user': string = undefined;
  102. @ApiProperty({ description: '用户名称' })
  103. @Rule(RuleType['string']().empty(''))
  104. 'user_name': string = undefined;
  105. @ApiProperty({ description: '供应商id' })
  106. @Rule(RuleType['string']().empty(''))
  107. 'supplier': string = undefined;
  108. @ApiProperty({ description: '供应商名称' })
  109. @Rule(RuleType['string']().empty(''))
  110. 'supplier_name': string = undefined;
  111. @ApiProperty({ description: '商品id' })
  112. @Rule(RuleType['string']().empty(''))
  113. 'good': string = undefined;
  114. @ApiProperty({ description: '商品名称' })
  115. @Rule(RuleType['string']().empty(''))
  116. 'good_name': string = undefined;
  117. @ApiProperty({ description: '规格id' })
  118. @Rule(RuleType['string']().empty(''))
  119. 'spec': string = undefined;
  120. @ApiProperty({ description: '规格名称' })
  121. @Rule(RuleType['string']().empty(''))
  122. 'spec_name': string = undefined;
  123. @ApiProperty({ description: '商品图片' })
  124. @Rule(RuleType['array']().empty(''))
  125. 'good_file': Array<any> = undefined;
  126. @ApiProperty({ description: '规格图片' })
  127. @Rule(RuleType['array']().empty(''))
  128. 'spec_file': Array<any> = undefined;
  129. @ApiProperty({ description: '维修地址' })
  130. @Rule(RuleType['string']().empty(''))
  131. 'address': string = undefined;
  132. @ApiProperty({ description: '申请时间' })
  133. @Rule(RuleType['string']().empty(''))
  134. 'apply_time': string = undefined;
  135. @ApiProperty({ description: '状态' })
  136. @Rule(RuleType['string']().empty(''))
  137. 'status': string = undefined;
  138. }
  139. export class CVO_upkeep extends FVO_upkeep {
  140. constructor(data: object) {
  141. super(data);
  142. dealVO(this, data);
  143. }
  144. }
  145. export class UDTO_upkeep extends CDTO_upkeep {
  146. @ApiProperty({ description: '数据id' })
  147. @Rule(RuleType['string']().empty(''))
  148. _id: string = undefined;
  149. }
  150. export class UVAO_upkeep extends FVO_upkeep {
  151. constructor(data: object) {
  152. super(data);
  153. dealVO(this, data);
  154. }
  155. }