import { Injectable } from '@angular/core';
import {environment} from '../../environments/environment';
import {HttpClient} from '../../../node_modules/@angular/common/http';
import {CommonsService} from './commons.service';

@Injectable({
  providedIn: 'root'
})
export class CmsService {

  constructor(
    private http: HttpClient,
    private commonsService: CommonsService
  ) { }

  /**
   * 获取cms内容
   * @param paramObject
   * @param callBack
   */
  getListContent(paramObject: object, callBack) {
    this.http.get(environment.baseUrl + 'cmsContent/getListContent?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => {
      callBack(data);
    });
  }

}
