From c119ef996479ca087b5076a0f608e6bbbb38af06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Stawujak?= Date: Wed, 5 Dec 2018 00:56:38 +0100 Subject: [PATCH] SKE-40 display competitionCategories --- .../angular/src/app/app-routing.module.ts | 4 +- .../4.2.1/angular/src/app/app.module.ts | 4 +- .../categories-list.component.css | 21 + .../categories-list.component.html | 5 + .../categories-list.component.ts | 31 ++ .../src/app/layout/sidebar-nav.component.ts | 2 + .../shared/service-proxies/service-proxies.ts | 440 +++++++++++------- .../service-proxies/service-proxy.module.ts | 1 + 8 files changed, 350 insertions(+), 158 deletions(-) create mode 100644 SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.css create mode 100644 SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.html create mode 100644 SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.ts diff --git a/SystemKonkursow/4.2.1/angular/src/app/app-routing.module.ts b/SystemKonkursow/4.2.1/angular/src/app/app-routing.module.ts index f30a4e7..e680c25 100644 --- a/SystemKonkursow/4.2.1/angular/src/app/app-routing.module.ts +++ b/SystemKonkursow/4.2.1/angular/src/app/app-routing.module.ts @@ -7,6 +7,7 @@ import { AboutComponent } from './about/about.component'; import { UsersComponent } from './users/users.component'; import { TenantsComponent } from './tenants/tenants.component'; import { RolesComponent } from 'app/roles/roles.component'; +import { CategoriesListComponent } from '@app/categories-list/categories-list.component'; @NgModule({ imports: [ @@ -19,7 +20,8 @@ import { RolesComponent } from 'app/roles/roles.component'; { path: 'users', component: UsersComponent, data: { permission: 'Pages.Users' }, canActivate: [AppRouteGuard] }, { path: 'roles', component: RolesComponent, data: { permission: 'Pages.Roles' }, canActivate: [AppRouteGuard] }, { path: 'tenants', component: TenantsComponent, data: { permission: 'Pages.Tenants' }, canActivate: [AppRouteGuard] }, - { path: 'about', component: AboutComponent } + { path: 'about', component: AboutComponent }, + { path: 'categories-list', component: CategoriesListComponent, canActivate: [AppRouteGuard] }, ] } ]) diff --git a/SystemKonkursow/4.2.1/angular/src/app/app.module.ts b/SystemKonkursow/4.2.1/angular/src/app/app.module.ts index aa4d055..5a80c6f 100644 --- a/SystemKonkursow/4.2.1/angular/src/app/app.module.ts +++ b/SystemKonkursow/4.2.1/angular/src/app/app.module.ts @@ -32,6 +32,7 @@ import { SideBarUserAreaComponent } from '@app/layout/sidebar-user-area.componen import { SideBarNavComponent } from '@app/layout/sidebar-nav.component'; import { SideBarFooterComponent } from '@app/layout/sidebar-footer.component'; import { RightSideBarComponent } from '@app/layout/right-sidebar.component'; +import { CategoriesListComponent } from '@app/categories-list/categories-list.component'; @NgModule({ declarations: [ @@ -52,7 +53,8 @@ import { RightSideBarComponent } from '@app/layout/right-sidebar.component'; SideBarUserAreaComponent, SideBarNavComponent, SideBarFooterComponent, - RightSideBarComponent + RightSideBarComponent, + CategoriesListComponent ], imports: [ diff --git a/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.css b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.css new file mode 100644 index 0000000..279678f --- /dev/null +++ b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.css @@ -0,0 +1,21 @@ +.flex-container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-items: center; +} + +.flex-item { + background-color: deepskyblue; + width: 200px; + margin: 10px; + text-align: center; + line-height: 90px; + font-size: 25px; + border-radius: 25px; + border: 1px solid gray; + color: darkolivegreen; + text-shadow: 2px 2px 6px ghostwhite; + font-weight: bold; +} diff --git a/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.html b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.html new file mode 100644 index 0000000..5d4e812 --- /dev/null +++ b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.html @@ -0,0 +1,5 @@ +
+
+ {{ category.name }} +
+
\ No newline at end of file diff --git a/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.ts b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.ts new file mode 100644 index 0000000..dac2a26 --- /dev/null +++ b/SystemKonkursow/4.2.1/angular/src/app/categories-list/categories-list.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit, Injector } from '@angular/core'; +import { appModuleAnimation } from '@shared/animations/routerTransition'; +import { CompetitionCategoryServiceProxy, CompetitionCategoryDto } from '@shared/service-proxies/service-proxies'; +import { List } from 'lodash'; + +@Component({ + templateUrl: './categories-list.component.html', + styleUrls: ['./categories-list.component.css'], + animations: [appModuleAnimation()] +}) +export class CategoriesListComponent implements OnInit { + + public competitionCategoriesList: List = []; + + constructor( + injector: Injector, + private _competitionCategoryService: CompetitionCategoryServiceProxy + ) { + } + + public ngOnInit(){ + this.getCompetitionCategories(); + } + + private getCompetitionCategories(): void { + this._competitionCategoryService.getAllCompetitionCategories() + .subscribe((result: List) => { + this.competitionCategoriesList = result; + }); + } +} \ No newline at end of file diff --git a/SystemKonkursow/4.2.1/angular/src/app/layout/sidebar-nav.component.ts b/SystemKonkursow/4.2.1/angular/src/app/layout/sidebar-nav.component.ts index c10fb87..7d2d594 100644 --- a/SystemKonkursow/4.2.1/angular/src/app/layout/sidebar-nav.component.ts +++ b/SystemKonkursow/4.2.1/angular/src/app/layout/sidebar-nav.component.ts @@ -12,6 +12,8 @@ export class SideBarNavComponent extends AppComponentBase { menuItems: MenuItem[] = [ new MenuItem(this.l("Strona domowa"), "", "home", "/app/home"), + new MenuItem(this.l("Konkursy"), "", "list", "/app/categories-list"), + new MenuItem(this.l("Tenants"), "Pages.Tenants", "business", "/app/tenants"), new MenuItem(this.l("Użytkownicy"), "Pages.Users", "people", "/app/users"), new MenuItem(this.l("Role"), "Pages.Roles", "local_offer", "/app/roles"), diff --git a/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxies.ts b/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxies.ts index e8f016c..f54d471 100644 --- a/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxies.ts +++ b/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxies.ts @@ -139,6 +139,74 @@ export class AccountServiceProxy { } } +@Injectable() +export class CompetitionCategoryServiceProxy { + private http: HttpClient; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) { + this.http = http; + this.baseUrl = baseUrl ? baseUrl : ""; + } + + /** + * @return Success + */ + getAllCompetitionCategories(): Observable { + let url_ = this.baseUrl + "/api/services/app/CompetitionCategory/GetAllCompetitionCategories"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ : any = { + observe: "response", + responseType: "blob", + headers: new HttpHeaders({ + "Content-Type": "application/json", + "Accept": "application/json" + }) + }; + + return this.http.request("get", url_, options_).pipe(_observableMergeMap((response_ : any) => { + return this.processGetAllCompetitionCategories(response_); + })).pipe(_observableCatch((response_: any) => { + if (response_ instanceof HttpResponseBase) { + try { + return this.processGetAllCompetitionCategories(response_); + } catch (e) { + return >_observableThrow(e); + } + } else + return >_observableThrow(response_); + })); + } + + protected processGetAllCompetitionCategories(response: HttpResponseBase): Observable { + const status = response.status; + const responseBlob = + response instanceof HttpResponse ? response.body : + (response).error instanceof Blob ? (response).error : undefined; + + let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }}; + if (status === 200) { + return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { + let result200: any = null; + let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); + if (resultData200 && resultData200.constructor === Array) { + result200 = []; + for (let item of resultData200) + result200.push(CompetitionCategoryDto.fromJS(item)); + } + return _observableOf(result200); + })); + } else if (status !== 200 && status !== 204) { + return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + })); + } + return _observableOf(null); + } +} + @Injectable() export class ConfigurationServiceProxy { private http: HttpClient; @@ -194,10 +262,6 @@ export class ConfigurationServiceProxy { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return _observableOf(null); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -266,14 +330,6 @@ export class RoleServiceProxy { result200 = resultData200 ? RoleDto.fromJS(resultData200) : new RoleDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -282,6 +338,61 @@ export class RoleServiceProxy { return _observableOf(null); } + /** + * @permission (optional) + * @return Success + */ + getRolesAsync(permission: string | null | undefined): Observable { + let url_ = this.baseUrl + "/api/services/app/Role/GetRolesAsync?"; + if (permission !== undefined) + url_ += "Permission=" + encodeURIComponent("" + permission) + "&"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ : any = { + observe: "response", + responseType: "blob", + headers: new HttpHeaders({ + "Content-Type": "application/json", + "Accept": "application/json" + }) + }; + + return this.http.request("get", url_, options_).pipe(_observableMergeMap((response_ : any) => { + return this.processGetRolesAsync(response_); + })).pipe(_observableCatch((response_: any) => { + if (response_ instanceof HttpResponseBase) { + try { + return this.processGetRolesAsync(response_); + } catch (e) { + return >_observableThrow(e); + } + } else + return >_observableThrow(response_); + })); + } + + protected processGetRolesAsync(response: HttpResponseBase): Observable { + const status = response.status; + const responseBlob = + response instanceof HttpResponse ? response.body : + (response).error instanceof Blob ? (response).error : undefined; + + let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }}; + if (status === 200) { + return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { + let result200: any = null; + let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); + result200 = resultData200 ? ListResultDtoOfRoleListDto.fromJS(resultData200) : new ListResultDtoOfRoleListDto(); + return _observableOf(result200); + })); + } else if (status !== 200 && status !== 204) { + return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + })); + } + return _observableOf(null); + } + /** * @input (optional) * @return Success @@ -330,14 +441,6 @@ export class RoleServiceProxy { result200 = resultData200 ? RoleDto.fromJS(resultData200) : new RoleDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -389,14 +492,6 @@ export class RoleServiceProxy { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return _observableOf(null); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -449,14 +544,6 @@ export class RoleServiceProxy { result200 = resultData200 ? ListResultDtoOfPermissionDto.fromJS(resultData200) : new ListResultDtoOfPermissionDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -512,14 +599,6 @@ export class RoleServiceProxy { result200 = resultData200 ? GetRoleForEditOutput.fromJS(resultData200) : new GetRoleForEditOutput(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -575,14 +654,6 @@ export class RoleServiceProxy { result200 = resultData200 ? RoleDto.fromJS(resultData200) : new RoleDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -641,14 +712,6 @@ export class RoleServiceProxy { result200 = resultData200 ? PagedResultDtoOfRoleDto.fromJS(resultData200) : new PagedResultDtoOfRoleDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -781,14 +844,6 @@ export class TenantServiceProxy { result200 = resultData200 ? TenantDto.fromJS(resultData200) : new TenantDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -840,14 +895,6 @@ export class TenantServiceProxy { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return _observableOf(null); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -903,14 +950,6 @@ export class TenantServiceProxy { result200 = resultData200 ? TenantDto.fromJS(resultData200) : new TenantDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -969,14 +1008,6 @@ export class TenantServiceProxy { result200 = resultData200 ? PagedResultDtoOfTenantDto.fromJS(resultData200) : new PagedResultDtoOfTenantDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1033,14 +1064,6 @@ export class TenantServiceProxy { result200 = resultData200 ? TenantDto.fromJS(resultData200) : new TenantDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1289,14 +1312,6 @@ export class UserServiceProxy { result200 = resultData200 ? UserDto.fromJS(resultData200) : new UserDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1353,14 +1368,6 @@ export class UserServiceProxy { result200 = resultData200 ? UserDto.fromJS(resultData200) : new UserDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1412,14 +1419,6 @@ export class UserServiceProxy { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return _observableOf(null); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1472,14 +1471,6 @@ export class UserServiceProxy { result200 = resultData200 ? ListResultDtoOfRoleDto.fromJS(resultData200) : new ListResultDtoOfRoleDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1532,14 +1523,6 @@ export class UserServiceProxy { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return _observableOf(null); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1595,14 +1578,6 @@ export class UserServiceProxy { result200 = resultData200 ? UserDto.fromJS(resultData200) : new UserDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1661,14 +1636,6 @@ export class UserServiceProxy { result200 = resultData200 ? PagedResultDtoOfUserDto.fromJS(resultData200) : new PagedResultDtoOfUserDto(); return _observableOf(result200); })); - } else if (status === 401) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); - } else if (status === 403) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("A server error occurred.", status, _responseText, _headers); - })); } else if (status !== 200 && status !== 204) { return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1874,6 +1841,53 @@ export interface IRegisterOutput { canLogin: boolean | undefined; } +export class CompetitionCategoryDto implements ICompetitionCategoryDto { + name: string | undefined; + id: number | undefined; + + constructor(data?: ICompetitionCategoryDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["name"]; + this.id = data["id"]; + } + } + + static fromJS(data: any): CompetitionCategoryDto { + data = typeof data === 'object' ? data : {}; + let result = new CompetitionCategoryDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["id"] = this.id; + return data; + } + + clone(): CompetitionCategoryDto { + const json = this.toJSON(); + let result = new CompetitionCategoryDto(); + result.init(json); + return result; + } +} + +export interface ICompetitionCategoryDto { + name: string | undefined; + id: number | undefined; +} + export class ChangeUiThemeInput implements IChangeUiThemeInput { theme: string; @@ -2063,6 +2077,120 @@ export interface IRoleDto { id: number | undefined; } +export class ListResultDtoOfRoleListDto implements IListResultDtoOfRoleListDto { + items: RoleListDto[] | undefined; + + constructor(data?: IListResultDtoOfRoleListDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["items"] && data["items"].constructor === Array) { + this.items = []; + for (let item of data["items"]) + this.items.push(RoleListDto.fromJS(item)); + } + } + } + + static fromJS(data: any): ListResultDtoOfRoleListDto { + data = typeof data === 'object' ? data : {}; + let result = new ListResultDtoOfRoleListDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.items && this.items.constructor === Array) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + return data; + } + + clone(): ListResultDtoOfRoleListDto { + const json = this.toJSON(); + let result = new ListResultDtoOfRoleListDto(); + result.init(json); + return result; + } +} + +export interface IListResultDtoOfRoleListDto { + items: RoleListDto[] | undefined; +} + +export class RoleListDto implements IRoleListDto { + name: string | undefined; + displayName: string | undefined; + isStatic: boolean | undefined; + isDefault: boolean | undefined; + creationTime: moment.Moment | undefined; + id: number | undefined; + + constructor(data?: IRoleListDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["name"]; + this.displayName = data["displayName"]; + this.isStatic = data["isStatic"]; + this.isDefault = data["isDefault"]; + this.creationTime = data["creationTime"] ? moment(data["creationTime"].toString()) : undefined; + this.id = data["id"]; + } + } + + static fromJS(data: any): RoleListDto { + data = typeof data === 'object' ? data : {}; + let result = new RoleListDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["displayName"] = this.displayName; + data["isStatic"] = this.isStatic; + data["isDefault"] = this.isDefault; + data["creationTime"] = this.creationTime ? this.creationTime.toISOString() : undefined; + data["id"] = this.id; + return data; + } + + clone(): RoleListDto { + const json = this.toJSON(); + let result = new RoleListDto(); + result.init(json); + return result; + } +} + +export interface IRoleListDto { + name: string | undefined; + displayName: string | undefined; + isStatic: boolean | undefined; + isDefault: boolean | undefined; + creationTime: moment.Moment | undefined; + id: number | undefined; +} + export class ListResultDtoOfPermissionDto implements IListResultDtoOfPermissionDto { items: PermissionDto[] | undefined; diff --git a/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxy.module.ts b/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxy.module.ts index c63fa4d..954dc3c 100644 --- a/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxy.module.ts +++ b/SystemKonkursow/4.2.1/angular/src/shared/service-proxies/service-proxy.module.ts @@ -13,6 +13,7 @@ import * as ApiServiceProxies from './service-proxies'; ApiServiceProxies.TokenAuthServiceProxy, ApiServiceProxies.AccountServiceProxy, ApiServiceProxies.ConfigurationServiceProxy, + ApiServiceProxies.CompetitionCategoryServiceProxy, { provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true } ] })