import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { Message } from '../pojo/Message'; import { ParamDefine } from '../pojo/ParamDefine'; const app_hierarchy = '/apps/hierarchy'; @Injectable({ providedIn: 'root' }) export class AppDefineService { constructor(private http: HttpClient) {} public getAppParamsDefine(app: string | undefined | null): Observable> { if (app === null || app === undefined) { console.log('getAppParamsDefine app can not null'); } const paramDefineUri = `/apps/${app}/params`; return this.http.get>(paramDefineUri); } public getAppDefine(app: string | undefined | null): Observable> { if (app === null || app === undefined) { console.log('getAppDefine app can not null'); } return this.http.get>(`/apps/${app}/define`); } public getAppHierarchy(): Observable> { let httpParams = new HttpParams().append('lang', 'zh-CN'); const options = { params: httpParams }; return this.http.get>(app_hierarchy, options); } }