123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- 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_record {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '用户id' })
- 'user_id': string = undefined;
- @ApiProperty({ description: '视频id' })
- 'video_id': string = undefined;
- @ApiProperty({ description: '观看时长' })
- 'time': string = undefined;
- @ApiProperty({ description: '开始时间' })
- 'start_time': string = undefined;
- @ApiProperty({ description: '结束时间' })
- 'end_time': string = undefined;
- }
- export class QDTO_record extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = ['user_id', 'video_id', 'time'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '用户id' })
- 'user_id': string = undefined;
- @ApiProperty({ description: '视频id' })
- 'video_id': string = undefined;
- @ApiProperty({ description: '观看时长' })
- 'time': string = undefined;
- }
- export class QVO_record extends FVO_record {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_record {
- @ApiProperty({ description: '用户id' })
- @Rule(RuleType['string']().empty(''))
- 'user_id': string = undefined;
- @ApiProperty({ description: '视频id' })
- @Rule(RuleType['string']().empty(''))
- 'video_id': string = undefined;
- @ApiProperty({ description: '观看时长' })
- @Rule(RuleType['string']().empty(''))
- 'time': string = undefined;
- @ApiProperty({ description: '开始时间' })
- @Rule(RuleType['string']().empty(''))
- 'start_time': string = undefined;
- @ApiProperty({ description: '结束时间' })
- @Rule(RuleType['string']().empty(''))
- 'end_time': string = undefined;
- }
- export class CVO_record extends FVO_record {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_record extends CDTO_record {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_record extends FVO_record {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|