import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs/Rx';
import {Injectable} from '@angular/core';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../app.constants';
import {CommonService} from '../shared/common/common.service';
import {LocalStorageService, SessionStorageService} from 'ngx-webstorage';
import {Http, RequestOptions, ResponseContentType, ResponseOptions} from '@angular/http';

@Injectable()
export class ProjectService {

    headers;
    options;

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

    //修改运维公司
    updateMaintainCompany(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainCompany/updateMaintainCompany', data);
    }

    //删除运维公司
    deleteMaintainCompany(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainCompany/deleteMaintainCompany', data);
    }

    //增加运维公司
    addMaintainCompany(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainCompany/addMaintainCompany', data);
    }

    //查询运维公司
    selectMaintainCompany(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainCompany/selectMaintainCompany', data);
    }

    //查询运维公司
    selectMaintainCompanyCountsById(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainCompany/selectMaintainCompanyCountsById', data);
    }

    //修改运维团队
    updateMaintainTeam(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeam/updateMaintainTeam', data);
    }

    //创建运维团队
    addMaintainTeam(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeam/addMaintainTeam', data);
    }

    //删除运维团队
    deleteMaintainTeam(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeam/deleteMaintainTeam', data);
    }

    //查询运维团队数量
    selectTeamCountById(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeam/selectTeamCountById', data);
    }

    //查询运维团队
    selectMaintainTeam(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeam/selectMaintainTeam', data);
    }

    //修改运维团队成员
    updateMaintainTeamUser(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeamUser/updateMaintainTeamUser', data);
    }

    //创建运维成员
    addMaintainTeamUser(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeamUser/addMaintainTeamUser', data);
    }

    //删除运维团队成员
    deleteMaintainTeamUser(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeamUser/deleteMaintainTeamUser', data);
    }

    //查询运维团队成员数量
    selectTeamUserCount(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeamUser/selectTeamUserCount', data);
    }

    //查询运维成员
    selectMaintainTeamUser(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainTeamUser/selectMaintainTeamUser', data);
    }

    //修改运维项目
    updateMaintainProject(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/updateMaintainProject', data);
    }

    //创建运维项目
    addMaintainProject(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/addMaintainProject', data);
    }

    //删除运维项目
    deleteMaintainProject(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/deleteMaintainProject', data);
    }

    //查询运维项目
    selectMaintainProject(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/selectMaintainProject', data);
    }

    //查询运维项目数量
    selectProjectCount(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/selectProjectCount', data);
    }

    //跟踪记录查询
    selectProjectCount1(data): Observable<any> {
        return this.http.post(SERVER_API_URL_COMS + '/maintainProject/selectProjectCount', data);
    }
}
