import _ from "lodash"; import type { IIllegalInfoItemResponse } from "./IIllegalInfoItemResponse"; export interface IIllegalInfoResponse { illegalInfoId: number; unitName: string; quantity: number; uploader: string; uploadDate: number; /** * 虚拟字段 */ illegalInfoItems: IIllegalInfoItemResponse[]; } export class TIllegalInfoResponse implements IIllegalInfoResponse { illegalInfoId: number = 0; unitName: string = ""; quantity: number = 0; uploader: string = ""; uploadDate: number = 0; illegalInfoItems: IIllegalInfoItemResponse[] = []; constructor(data: Partial = {}) { if (data) { _.merge(this, _.pick(data, Object.keys(this))); } } }