|
|
@@ -0,0 +1,65 @@
|
|
|
+import { DataModel, transformArrayDataModel } 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 IndexBanner extends DataModel<IndexBanner> {
|
|
|
+ constructor() {
|
|
|
+ super(IndexBanner, "首页轮播");
|
|
|
+ this.setNameMapperCase('Camel', 'Snake');
|
|
|
+ this._convertTable = {}
|
|
|
+ }
|
|
|
+
|
|
|
+ id = '';
|
|
|
+ title = '';
|
|
|
+ image = '';
|
|
|
+ typeText = '';
|
|
|
+ sceneText = '';
|
|
|
+ openTypeText = '';
|
|
|
+ statusText = '';
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class IndexContentApi extends CommonContentApi {
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super(undefined, 3, "闽南文化概况", 288);
|
|
|
+ }
|
|
|
+
|
|
|
+ async getStats() {
|
|
|
+ return (await this.get('/volunteer/statistics/webData', '闽南文化首页数据统计', {
|
|
|
+ }, IndexStats)).data as IndexStats
|
|
|
+ }
|
|
|
+ async getBanner() {
|
|
|
+ return transformArrayDataModel<IndexBanner>(
|
|
|
+ IndexBanner,
|
|
|
+ (await this.get('/content/banner_function/getotherBanner', '首页轮播图列表', {
|
|
|
+ open_type: 3,
|
|
|
+ })).data as any,
|
|
|
+ '首页轮播图列表'
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export default new IndexContentApi();
|