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