pro-work-logic.service.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient } from '@angular/common/http';
  3. import { BaseResponse } from 'app/entity/baseResponse';
  4. import { Result } from 'app/entity/Result';
  5. import { ProWorkLogic } from 'app/entity/project-work/pro-work-logic';
  6. @Injectable({
  7. providedIn: 'root'
  8. })
  9. export class ProWorkLogicService {
  10. constructor(private http:HttpClient) { }
  11. //分页查询
  12. async getList(body: any): Promise<BaseResponse<Result<any>>> {
  13. return await this.http
  14. .get<BaseResponse<Result<any>>>('/prowork/proWorkLogic/list', { params: body })
  15. .toPromise();
  16. }
  17. //新增
  18. async add(body: ProWorkLogic): Promise<BaseResponse<any>> {
  19. return await this.http.post<BaseResponse<any>>('/prowork/proWorkLogic/add', body).toPromise();
  20. }
  21. //根据id查询
  22. async getListById(id: string): Promise<BaseResponse<any>> {
  23. return await this.http.get<BaseResponse<any>>("prowork/proWorkLogic/queryById", { params: { id: id } }).toPromise();
  24. }
  25. //修改
  26. async update(body: ProWorkLogic): Promise<BaseResponse<any>> {
  27. return await this.http.put<BaseResponse<any>>('prowork/proWorkLogic/edit', body).toPromise();
  28. }
  29. //删除
  30. async delete(body:any):Promise<BaseResponse<any>>{
  31. return await this.http.delete<BaseResponse<any>>('prowork/proWorkLogic/delete',{params:body}).toPromise();
  32. }
  33. }