From 65c1643c9520dcd60b253f4d25c84377ba1dcd0a Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Tue, 3 Nov 2020 13:05:59 +0100 Subject: [PATCH] AW-1649 Remove codelistitem --- .../common/src/fm/common-service.module.ts | 2 - projects/common/src/fm/common.module.ts | 2 - .../common/src/fm/models/code.list.item.ts | 30 -------------- .../src/fm/services/codelistitem.service.ts | 41 ------------------- 4 files changed, 75 deletions(-) delete mode 100644 projects/common/src/fm/models/code.list.item.ts delete mode 100644 projects/common/src/fm/services/codelistitem.service.ts diff --git a/projects/common/src/fm/common-service.module.ts b/projects/common/src/fm/common-service.module.ts index 2b3be13..7a340be 100644 --- a/projects/common/src/fm/common-service.module.ts +++ b/projects/common/src/fm/common-service.module.ts @@ -23,7 +23,6 @@ import { appConfigFactory } from "./shared/app.config.factory"; import { AuthGuard } from './services/auth-guard.service'; import { NavBarGuard } from './services/nav-bar-guard.service'; import { FullScreenGuard } from './services/full-screen-guard.service'; -import { CodeListItemService } from './services/codelistitem.service'; import { AuthCallbackGuard } from './components/auth-callback/auth-callback.guard'; import { ResumableFileUploadService } from './components/resumable-file-upload/resumable-file-upload.service'; import { NgbDateNativeAdapter } from './services/date-adapter.service' @@ -42,7 +41,6 @@ export { TypeaheadService, UserService, WeatherService, - CodeListItemService, AppConfig, AccessTokenInterceptor, AuthGuard, diff --git a/projects/common/src/fm/common.module.ts b/projects/common/src/fm/common.module.ts index 56cb8d2..2bbebee 100644 --- a/projects/common/src/fm/common.module.ts +++ b/projects/common/src/fm/common.module.ts @@ -47,7 +47,6 @@ import { ISenMLItem } from './models/senml-item'; import { IPackage,IPackages } from './models/package'; import { IUser } from './models/user'; import { IQueryState } from './models/query.state'; -import { ICodeListItem } from './models/code.list.item'; import { IDataLayer } from './models/data.layer'; import { IColor,IGradientstop} from './models/gradient'; import * as commonActions from './actions/app-common.actions'; @@ -82,7 +81,6 @@ export { IListItem, ITypeaheadItem, IUser, - ICodeListItem, IQueryState, IPackage, IPackages, diff --git a/projects/common/src/fm/models/code.list.item.ts b/projects/common/src/fm/models/code.list.item.ts deleted file mode 100644 index be796db..0000000 --- a/projects/common/src/fm/models/code.list.item.ts +++ /dev/null @@ -1,30 +0,0 @@ -export interface ICodeListItem { - codeList: string; - code: string; - codeGroup?: string; - unit?: string; - description?: string; - validFrom?: Date; - validTo?: Date; - created?: Date; - updated?: Date; - data?:any; - readWrite?: boolean; -} - -export class CodeListItem implements ICodeListItem { - public codeList: string; - public code: string; - public codeGroup?: string; - public unit?: string; - public description:string; - public validFrom?: Date; - public validTo?: Date; - public created?: Date; - public updated?: Date; - public data?:any; - public readWrite?: boolean; - - constructor() { - } -} diff --git a/projects/common/src/fm/services/codelistitem.service.ts b/projects/common/src/fm/services/codelistitem.service.ts deleted file mode 100644 index 54c3cfe..0000000 --- a/projects/common/src/fm/services/codelistitem.service.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { HttpClient, HttpParams } from "@angular/common/http"; -import { AppConfig } from "../shared/app.config"; -import { ICodeListItem } from '../models/code.list.item'; - -@Injectable({ - providedIn: 'root', -}) -export class CodeListItemService { - constructor(public httpClient: HttpClient, public appConfig: AppConfig) { - } - - ApiEndpoint() { - return this.appConfig.getConfig("apiEndPoint"); - } - - getCodeListItems(codelist: string[]): Observable { - var params = new HttpParams(); - for (const cl of codelist) { - params = params.append('cl', cl); - } - return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/codelistitems/`, { params: params }); - } - - getCodeListItem(codeList: string, code: string): Observable { - return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeList}/${code}`); - } - - postCodeListItem(codeListItem: ICodeListItem): Observable { - return this.httpClient.post(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeListItem.codeList}`, codeListItem); - } - - putCodeListItem(codeListItem: ICodeListItem): Observable { - return this.httpClient.put(`${this.ApiEndpoint()}/api/v1/codelistitems/${codeListItem.codeList}`, codeListItem); - } - - deleteCodeListItem(codelist: string, code: string): Observable { - return this.httpClient.delete(`${this.ApiEndpoint()}/api/v1/codelistitems/${codelist}/${code}`); - } -}