import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { BaseResponse } from 'app/entity/baseResponse'; import { Result } from 'app/entity/Result'; import { ContractFile } from 'app/entity/contract-management/contract-file'; @Injectable({ providedIn: 'root' }) /** * 合同主表 */ export class ContractFileService { constructor(private http:HttpClient) { } //分页查询 async getList(body: any): Promise>> { return await this.http .get>>('contract.file/contractFile/list', { params: body }) .toPromise(); } //分页查询 async getPageList(body: any): Promise>> { return await this.http .get>>('contract.file/contractFile/getPageList', { params: body }) .toPromise(); } //新增 async add(body: ContractFile): Promise> { return await this.http.post>('contract.file/contractFile/add', body).toPromise(); } //主表和子表数据一起保存 async saveMainAndChild(body: ContractFile): Promise> { return await this.http.post>('contract.file/contractFile/saveMainAndChild', body).toPromise(); } //根据id查询 async queryById(id: string): Promise> { return await this.http .get>('contract.file/contractFile/queryById', { params: { id: id } }) .toPromise(); } //根据主表id查询主子表数据 async queryMainAndChildById(id: string): Promise> { return await this.http .get>('contract.file/contractFile/queryMainAndChildById', { params: { id: id } }) .toPromise(); } //删除 async delete(body:any):Promise>{ return await this.http.delete>('contract.file/contractFile/delete',{params:body}).toPromise(); } //主表与子表一起删除 async deleteMainAndChild(id:any):Promise>{ return await this.http.delete>('contract.file/contractFile/deleteMainAndChild',{params:{id:id}}).toPromise(); } //修改 async update(body: ContractFile): Promise> { return await this.http.put>('contract.file/contractFile/edit', body).toPromise(); } //主表和子表一起修改 async updateMainAndChild(body: ContractFile): Promise> { return await this.http.put>('contract.file/contractFile/updateMainAndChild', body).toPromise(); } }