import { DataModel } from '@imengyu/js-request-transform';
import { CommonContentApi } from '../CommonContent';

export class IndexStats extends DataModel<IndexStats> {
  constructor() {
    super(IndexStats, "内容详情");
    this.setNameMapperCase('Camel', 'Snake');
    this._convertTable = {
      crData: { clientSide: 'forceArray' },
      minnanCr: { clientSide: 'forceArray' },
      historyData: { clientSide: 'forceArray' },
      inheritorData: { clientSide: 'forceArray' },
      ichData: { clientSide: 'forceArray' },
      ichCenter: { clientSide: 'forceArray' },
      villageData: { clientSide: 'forceArray' },
    }
  }

  crData: any;
  minnanCr: any;
  historyData: any;
  inheritorData: any;
  ichData: any;
  ichCenter: any;
  villageData: any;
}

export class IndexContentApi extends CommonContentApi {

  constructor() {
    super(undefined, 3, "闽南文化概况", 288);
  }
  async getStats() {
    return (await this.get('/volunteer/statistics/webData', '闽南文化首页数据统计', {
    }, IndexStats)).data as IndexStats
  }
}

export default new IndexContentApi();
