123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- import { Rule, RuleType } from '@midwayjs/validate';
- import { ApiProperty } from '@midwayjs/swagger';
- import { SearchBase } from 'free-midway-component';
- import get = require('lodash/get');
- const dealVO = (cla, data) => {
- for (const key in cla) {
- const val = get(data, key);
- if (val || val === 0) cla[key] = val;
- }
- };
- export class FVO_new {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '标题' })
- 'title': string = undefined;
- @ApiProperty({ description: '类型' })
- 'type': string = undefined;
- @ApiProperty({ description: '发布时间' })
- 'time': string = undefined;
- @ApiProperty({ description: '内容' })
- 'content': string = undefined;
- @ApiProperty({ description: '是否使用' })
- 'is_use': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QDTO_new extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = ['title', 'type', 'is_use', 'status'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '标题' })
- 'title': string = undefined;
- @ApiProperty({ description: '类型' })
- 'type': string = undefined;
- @ApiProperty({ description: '是否使用' })
- 'is_use': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QVO_new extends FVO_new {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_new {
- @ApiProperty({ description: '标题' })
- @Rule(RuleType['string']().empty(''))
- 'title': string = undefined;
- @ApiProperty({ description: '类型' })
- @Rule(RuleType['string']().empty(''))
- 'type': string = undefined;
- @ApiProperty({ description: '发布时间' })
- @Rule(RuleType['string']().empty(''))
- 'time': string = undefined;
- @ApiProperty({ description: '内容' })
- @Rule(RuleType['string']().empty(''))
- 'content': string = undefined;
- @ApiProperty({ description: '是否使用' })
- @Rule(RuleType['string']().empty(''))
- 'is_use': string = undefined;
- @ApiProperty({ description: '状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': string = undefined;
- }
- export class CVO_new extends FVO_new {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_new extends CDTO_new {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_new extends FVO_new {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|