Skip to content
infomation.service.ts 1.69 KiB
Newer Older
wangqinghua's avatar
wangqinghua committed
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs/Rx';
import {Injectable} from '@angular/core';
wangqinghua's avatar
wangqinghua committed
import {SERVER_API_URL} from '../app.constants';
wangqinghua's avatar
wangqinghua committed
import {CommonService} from '../shared/common/common.service';
import {LocalStorageService, SessionStorageService} from 'ngx-webstorage';

@Injectable()
export class InfomationService {

    headers;
    options;

    constructor(private http: HttpClient, private commonSer: CommonService,
                private localStorage: LocalStorageService, private sessionStorage: SessionStorageService) {
    }

    //分页查询
    propertyPage(data): Observable<any> {
wangqinghua's avatar
wangqinghua committed
        return this.http.post(SERVER_API_URL + '/property/page', data);
wangqinghua's avatar
wangqinghua committed
    }

    //数据导入
    importE(data): Observable<any> {
wangqinghua's avatar
wangqinghua committed
        return this.http.post(SERVER_API_URL + '/property/importE', data);
wangqinghua's avatar
wangqinghua committed
    }

    //数据导出
wangqinghua's avatar
wangqinghua committed
    propertyExport(): Observable<any> {
wangqinghua's avatar
wangqinghua committed
        return this.http.get(SERVER_API_URL + '/property/export',{responseType: 'blob'});
wangqinghua's avatar
wangqinghua committed
    }

    //根据id查询详情
    propertyFind(params): Observable<any> {
wangqinghua's avatar
wangqinghua committed
        return this.http.get(SERVER_API_URL + '/property/find/' + params);
wangqinghua's avatar
wangqinghua committed
    }

    //删除
    propertyDelete(data): Observable<any> {
wangqinghua's avatar
wangqinghua committed
        return this.http.post(SERVER_API_URL + '/property/delete', data);
wangqinghua's avatar
wangqinghua committed
    }
wangqinghua's avatar
wangqinghua committed

    //新增
    propertyAdd(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/property/add', data);
    }

    //更新
    propertyUpdate(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/property/update', data);
    }

    //根据id查询详情
    propertyFindById(params): Observable<any> {
        return this.http.get(SERVER_API_URL + '/property/find/'+ params);
    }
wangqinghua's avatar
wangqinghua committed
}