From 0e9bdc3d873f51ef55d3a92b3af13f9825e3b678 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Fri, 14 Aug 2020 08:25:10 -0400 Subject: [PATCH] Added the core frontend module [#424] This module will be used to capture shared code needed by all other modules in the project. --- comixed-frontend/src/app/core/core.module.ts | 31 +++++++++++++++++++ comixed-frontend/src/app/core/index.ts | 19 ++++++++++++ .../src/app/core/models/api-response.ts | 28 +++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 comixed-frontend/src/app/core/core.module.ts create mode 100644 comixed-frontend/src/app/core/index.ts create mode 100644 comixed-frontend/src/app/core/models/api-response.ts diff --git a/comixed-frontend/src/app/core/core.module.ts b/comixed-frontend/src/app/core/core.module.ts new file mode 100644 index 000000000..175803448 --- /dev/null +++ b/comixed-frontend/src/app/core/core.module.ts @@ -0,0 +1,31 @@ +/* + * ComiXed - A digital comic book library management application. + * Copyright (C) 2020, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +/** + * The core module contains code that is shared between all other modules. + * + * @author Darryl L. Pierce + */ +@NgModule({ + declarations: [], + imports: [CommonModule] +}) +export class CoreModule {} diff --git a/comixed-frontend/src/app/core/index.ts b/comixed-frontend/src/app/core/index.ts new file mode 100644 index 000000000..c60d7ce46 --- /dev/null +++ b/comixed-frontend/src/app/core/index.ts @@ -0,0 +1,19 @@ +/* + * ComiXed - A digital comic book library management application. + * Copyright (C) 2020, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +export * from './models/api-response'; diff --git a/comixed-frontend/src/app/core/models/api-response.ts b/comixed-frontend/src/app/core/models/api-response.ts new file mode 100644 index 000000000..599666dd4 --- /dev/null +++ b/comixed-frontend/src/app/core/models/api-response.ts @@ -0,0 +1,28 @@ +/* + * ComiXed - A digital comic book library management application. + * Copyright (C) 2020, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +/** + * Represents the standard API response body. + * + * @author Darryl L. Pierce + */ +export interface ApiResponse { + success: boolean; + error?: string; + result: T; +}