app-define.service.ts 949 B

123456789101112131415161718192021222324252627282930
  1. import { Injectable } from '@angular/core';
  2. import {HttpClient, HttpParams} from '@angular/common/http';
  3. import {Message} from "../pojo/Message";
  4. import {Observable} from "rxjs";
  5. import {ParamDefine} from "../pojo/ParamDefine";
  6. const app_hierarchy = '/apps/hierarchy';
  7. @Injectable({
  8. providedIn: 'root'
  9. })
  10. export class AppDefineService {
  11. constructor(private http : HttpClient) { }
  12. public getAppParamsDefine(app: string | undefined | null) : Observable<Message<ParamDefine[]>> {
  13. if (app === null || app === undefined) {
  14. console.log("getAppParamsDefine app can not null");
  15. }
  16. const paramDefineUri = `/apps/${app}/params`;
  17. return this.http.get<Message<ParamDefine[]>>(paramDefineUri);
  18. }
  19. public getAppHierarchy() : Observable<Message<any>> {
  20. let httpParams = new HttpParams().append("lang",'zh-CN');
  21. const options = { params: httpParams };
  22. return this.http.get<Message<any>>(app_hierarchy,options);
  23. }
  24. }