All files / src/app/platform/analysis analysis.service.ts

58.82% Statements 10/17
0% Branches 0/4
20% Functions 1/5
61.54% Lines 8/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 341x 1x 1x                 1x       1x                 1x       1x       1x  
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from '../../../environments/environment';
 
export interface Analysis {
  name: string;
  tableId: number;
  description: string;
}
 
@Injectable()
export class AnalysisService {
 
  constructor(private http: HttpClient) { }
 
  getAnalysisList(pageNum: number = 1, pageSize: number = 10) {
    const params = { pageNum: `${pageNum}`, pageSize: `${pageSize}` };
    return this.http.get(`${environment.url}/analysis/currentUser`,
    {
      responseType: 'text',
      params
    });
  }
 
  addAnalysis(body: Analysis) {
    return this.http.post(`${environment.url}/analysis`, body, { responseType: 'text' });
  }
 
  deleteAnalysis(ids: any) {
    return this.http.delete(`${environment.url}/analysis/${ids}`, { responseType: 'text' });
  }
 
}