From 6adeb65a4411ca3e68b5c24817d24be3da3b8b19 Mon Sep 17 00:00:00 2001 From: ThomasFransolet Date: Sun, 18 Aug 2019 15:11:42 +0200 Subject: [PATCH] CP #2 S'inscrire, modifier profil et supprimer profil + Notifications service --- src/app/_api/models/user-info.ts | 3 +- src/app/_api/services/user.service.ts | 72 +++++++ src/app/_services/app.service.ts | 13 +- src/app/_services/notifications.service.ts | 23 ++ src/app/app.component.html | 123 ++++------- src/app/app.component.ts | 200 ++++++++++++++---- src/app/app.module.ts | 9 + .../control-panel/home/home.component.html | 2 +- src/app/control-panel/home/home.component.ts | 16 +- .../profile/config/config.component.html | 2 +- .../edit-profile/edit-profile.component.css | 9 + .../edit-profile/edit-profile.component.html | 105 ++++++++- .../edit-profile/edit-profile.component.ts | 159 +++++++++++++- .../profile/profile/profile.component.html | 2 +- .../profile/profile/profile.component.ts | 1 - src/assets/i18n/en.json | 46 +++- swagger.json | 2 +- 17 files changed, 648 insertions(+), 139 deletions(-) create mode 100644 src/app/_services/notifications.service.ts diff --git a/src/app/_api/models/user-info.ts b/src/app/_api/models/user-info.ts index c56d908..8f27136 100644 --- a/src/app/_api/models/user-info.ts +++ b/src/app/_api/models/user-info.ts @@ -2,7 +2,7 @@ import { ScreenConfiguration } from './screen-configuration'; import { Device } from './device'; export interface UserInfo { - address?: string; + dateCreation?: string; id?: string; email?: string; password?: string; @@ -11,6 +11,7 @@ export interface UserInfo { token?: string; birthday?: string; role?: string; + address?: string; city?: string; state?: string; language?: string; diff --git a/src/app/_api/services/user.service.ts b/src/app/_api/services/user.service.ts index 9a05a9e..b21066e 100644 --- a/src/app/_api/services/user.service.ts +++ b/src/app/_api/services/user.service.ts @@ -13,8 +13,10 @@ import { UserInfo } from '../models/user-info'; }) class UserService extends __BaseService { static readonly GetPath = '/api/user'; + static readonly UpdateUserPath = '/api/user'; static readonly CreateUserPath = '/api/user'; static readonly Get_1Path = '/api/user/{id}'; + static readonly DeleteUserPath = '/api/user/{id}'; constructor( config: __Configuration, @@ -56,6 +58,42 @@ class UserService extends __BaseService { ); } + /** + * @param updatedUser undefined + * @return Success + */ + UpdateUserResponse(updatedUser?: UserInfo): __Observable<__StrictHttpResponse> { + let __params = this.newParams(); + let __headers = new HttpHeaders(); + let __body: any = null; + __body = updatedUser; + let req = new HttpRequest( + 'PUT', + this.rootUrl + `/api/user`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); + + return this.http.request(req).pipe( + __filter(_r => _r instanceof HttpResponse), + __map((_r) => { + return _r as __StrictHttpResponse; + }) + ); + } + /** + * @param updatedUser undefined + * @return Success + */ + UpdateUser(updatedUser?: UserInfo): __Observable { + return this.UpdateUserResponse(updatedUser).pipe( + __map(_r => _r.body as UserInfo) + ); + } + /** * @param newUser undefined * @return Success @@ -127,6 +165,40 @@ class UserService extends __BaseService { __map(_r => _r.body as UserInfo) ); } + + /** + * @param id undefined + */ + DeleteUserResponse(id: string): __Observable<__StrictHttpResponse> { + let __params = this.newParams(); + let __headers = new HttpHeaders(); + let __body: any = null; + + let req = new HttpRequest( + 'DELETE', + this.rootUrl + `/api/user/${id}`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); + + return this.http.request(req).pipe( + __filter(_r => _r instanceof HttpResponse), + __map((_r) => { + return _r as __StrictHttpResponse; + }) + ); + } + /** + * @param id undefined + */ + DeleteUser(id: string): __Observable { + return this.DeleteUserResponse(id).pipe( + __map(_r => _r.body as null) + ); + } } module UserService { diff --git a/src/app/_services/app.service.ts b/src/app/_services/app.service.ts index ae5aab1..903f572 100644 --- a/src/app/_services/app.service.ts +++ b/src/app/_services/app.service.ts @@ -1,7 +1,8 @@ -import { Injectable } from '@angular/core'; +import { Injectable, EventEmitter } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { BooksService } from '../_api/services/books.service'; +import { DatePipe } from '@angular/common'; @Injectable({ @@ -14,8 +15,18 @@ export class AppService { private _bookService: BooksService ) { } + OpenSignInModal = new EventEmitter(); + public ConnectionTest(): Observable { return this._bookService.Get(); } + FormatDate(iDate: Date) { + const inputDate = new Date(iDate); + const formattedDate = inputDate.getFullYear() + '-' + (inputDate.getMonth() + 1) + '-' + inputDate.getDate(); + const datePipe = new DatePipe('en'); + + return datePipe.transform(formattedDate, 'yyyy-MM-dd'); + } + } diff --git a/src/app/_services/notifications.service.ts b/src/app/_services/notifications.service.ts new file mode 100644 index 0000000..d1167df --- /dev/null +++ b/src/app/_services/notifications.service.ts @@ -0,0 +1,23 @@ +import { Injectable, EventEmitter, Component } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { BooksService } from '../_api/services/books.service'; +import { DatePipe } from '@angular/common'; +import { MessageService } from 'primeng/api'; + + +@Injectable({ + providedIn: 'root' +}) + +export class NotificationsService { + constructor( + private messageService: MessageService + ) { } + + addMessage(severity, summary, detail) { + console.log('hello from notifications', severity, summary, detail); + this.messageService.add({severity: severity, summary: summary, detail: detail}); + } + +} diff --git a/src/app/app.component.html b/src/app/app.component.html index a748151..b3297d1 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,126 +1,97 @@ - + +
- MyMirror + MyMirror
- - - - - - + + + + + +
-
+ - + + + + + - App.Home.Login + App.Home.Login.Label -
+
- +
-
+
- + +
+
+
+ - + - - - Sign In + + + + + + + App.Home.SignIn.Label
- -
+ +
- -
-
-
-
- - +
-
- -
-
- -
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - +
- +
- - +
- +
+ +
- + - - - - + + + + + \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5241a76..c29c8f2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -4,9 +4,10 @@ import { AppService } from './_services/app.service'; import { TranslateService } from '@ngx-translate/core'; import { AuthenticationService } from './_services/authentication.service'; import { Router } from '@angular/router'; -import { first } from 'rxjs/operators'; +import { first, catchError } from 'rxjs/operators'; import { UserInfo } from './_api/models'; import { UserService } from './_api/services'; +import { throwError } from 'rxjs'; @Component({ @@ -29,15 +30,37 @@ export class AppComponent implements OnInit { // Login public Email: string = null; public Password: string = null; - - public birthday: Date; + public ErrorTextLogin = ''; public CreateUser: UserInfo = {}; + public ConfirmPassword: string; public UserTryingToLogin: UserInfo = {}; - // Label - public LabelDropDownLogout: string; - public LabelDropDownModifyUser: string; + // Sign in + public ErrorTextSignIn = ''; + + // Form Label + public LabelFormLastName: string; + public LabelFormFirstName: string; + public LabelFormEmail: string; + public LabelFormPassword: string; + public LabelFormConfirmPassword: string; + public LabelFormCreate: string; + + // Labels + // Headers + public LabelHeaderLogIn: string; + public LabelHeaderSignIn: string; + public LabelHeaderAbout: string; + public LabelHeaderTeam: string; + public LabelHeaderContact: string; + // LogIn + public LabelLoginIdentify: string; + // SignIn + public LabelSignInCreateProfile: string; + // DropDown + public LabelDropDownLogout: string; + public LabelDropDownModifyUser: string; constructor( private _appService: AppService, @@ -52,13 +75,23 @@ export class AppComponent implements OnInit { // To Include in a fonction of a dropdown language chose this._translateService.setDefaultLang('en'); + this.InitLabels(); + + this._appService.OpenSignInModal.subscribe( + value => { + if (value) { + this.DisplaySignInModal = true; + } + } + ); + // To test this._translateService.get('App.Home.UserDropDown.ModifyUser').subscribe(modifyLabel => { this._translateService.get('App.Home.UserDropDown.Logout').subscribe(logoutLabel => { this.itemsUserDropDown = [ {label: modifyLabel, icon: 'fa fa-edit', command: () => { // route get param => navigate vers profile - this._router.navigate(['/profile/01']); + this._router.navigate(['/profile/' + this.ConnectedUser.id + '/edit']); }}, {label: logoutLabel, icon: 'fa fa-sign-out', command: () => { this.Logout(); @@ -68,7 +101,7 @@ export class AppComponent implements OnInit { }); const currentUser = this._authService.currentUserValue; - console.log(currentUser); + console.log('currentUser', currentUser); if (currentUser && currentUser.token) { this.ConnectedUser = currentUser; @@ -81,23 +114,9 @@ export class AppComponent implements OnInit { } - public LogIn() { - /*this._appService.GetToken(this.Username, this.Password) - .subscribe(res => { - console.log(res.Token); - this.Connected = true; - this.DisplayLoginModal = false; - this.Username = null; - this.Password = null; - this._authService.IsLoggedIn = true; - - this._router.navigate(['/profile/01']); - }, () => { - console.log('ERROR'); - });*/ - - this.UserTryingToLogin.email = this.Email; - this.UserTryingToLogin.password = this.Password; + public LogIn(email, password) { + this.UserTryingToLogin.email = email; + this.UserTryingToLogin.password = password; this._authService.Login(this.UserTryingToLogin) .pipe(first()) .subscribe( @@ -109,10 +128,13 @@ export class AppComponent implements OnInit { this.Email = null; this.Password = null; this._authService.IsLoggedIn = true; - this._router.navigate(['/profile/01']); + this._router.navigate(['/profile/' + this.ConnectedUser.id]); + this.ErrorTextLogin = ''; }, error => { - console.log('ERROR'); + this._translateService.get('App.Home.Login.ErrorText').subscribe(loginErrorText => { + this.ErrorTextLogin = loginErrorText; + }); }); // change route -> /config view @@ -136,25 +158,111 @@ export class AppComponent implements OnInit { } public CreateProfile() { - // ADD FIELDS VERIFICATION - console.log('GHelfoudlkfhj'); - this.CreateUser.deviceIds = []; - this._userService.CreateUser(this.CreateUser) - .subscribe( - data => { - // TO CHANGE - console.log(data); - this.ConnectedUser = data; - this.Connected = true; - this.DisplayLoginModal = false; - this.Email = null; - this.Password = null; - this._authService.IsLoggedIn = true; - // this._router.navigate(['/profile/01']); - }, - error => { - console.log('ERROR'); - }); + if (this.CorrectForm()) { + this.CreateUser.deviceIds = []; + this._userService.CreateUser(this.CreateUser) + + .subscribe( + data => { + // TO CHANGE + this.ErrorTextSignIn = ''; + this.UserTryingToLogin.email = data.email; + this.UserTryingToLogin.password = data.password; + this.DisplaySignInModal = false; + /*this.ConnectedUser = data; + this.Connected = true;*/ + this.LogIn(data.email, data.password); + }, + error => { + if (error !== null && error === 'Conflict') { + this._translateService.get('App.Home.SignIn.ErrorAlreadyExist').subscribe(text => { + this.ErrorTextSignIn = text; + }); + } else { + this._translateService.get('App.Home.SignIn.ErrorUnknown').subscribe(text => { + this.ErrorTextSignIn = text; + }); + } + }); + } } + public CorrectForm(): boolean { + if (this.CreateUser.firstName == null || this.CreateUser.lastName == null || + this.CreateUser.email == null || this.CreateUser.password == null) { + this._translateService.get('App.Home.SignIn.ErrorFieldsMissing').subscribe(text => { + this.ErrorTextSignIn = text; + }); + return false; + } + if (this.ConfirmPassword !== this.CreateUser.password) { + this._translateService.get('App.Home.SignIn.ErrorConfirmPassword').subscribe(text => { + this.ErrorTextSignIn = text; + }); + return false; + } + this.ErrorTextSignIn = ''; + return true; + } + + public ResetLogInModal() { + this.ErrorTextLogin = ''; + this.Email = ''; + this.Password = ''; + } + + public ResetSignInModal() { + this.ErrorTextSignIn = ''; + this.CreateUser = {}; + this.ConfirmPassword = ''; + } + + public InitLabels() { + // HEADERS + this._translateService.get('App.Home.Login.Header').subscribe(label => { + this.LabelHeaderLogIn = label; + }); + this._translateService.get('App.Home.SignIn.Header').subscribe(label => { + this.LabelHeaderSignIn = label; + }); + this._translateService.get('App.Home.About.Header').subscribe(label => { + this.LabelHeaderAbout = label; + }); + this._translateService.get('App.Home.Team.Header').subscribe(label => { + this.LabelHeaderTeam = label; + }); + this._translateService.get('App.Home.Contact.Header').subscribe(label => { + this.LabelHeaderContact = label; + }); + + // LOGIN + this._translateService.get('App.Home.Login.Identify').subscribe(label => { + this.LabelLoginIdentify = label; + }); + + // SIGN IN + this._translateService.get('App.Home.SignIn.CreateProfile').subscribe(label => { + this.LabelSignInCreateProfile = label; + }); + + // FORM + this._translateService.get('App.Common.Form.LastName').subscribe(label => { + this.LabelFormLastName = label; + }); + this._translateService.get('App.Common.Form.FirstName').subscribe(label => { + this.LabelFormFirstName = label; + }); + this._translateService.get('App.Common.Form.Email').subscribe(label => { + this.LabelFormEmail = label; + }); + this._translateService.get('App.Common.Form.Password').subscribe(label => { + this.LabelFormPassword = label; + }); + this._translateService.get('App.Common.Form.ConfirmPassword').subscribe(label => { + this.LabelFormConfirmPassword = label; + }); + this._translateService.get('App.Common.Form.Create').subscribe(label => { + this.LabelFormCreate = label; + }); + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 0ffcb0a..04647dc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -21,6 +21,8 @@ import { ApiConfiguration } from './_api/api-configuration'; import { AppService } from './_services/app.service'; import { FormsModule } from '@angular/forms'; import { CalendarModule } from 'primeng/calendar'; +import { ConfirmDialogModule } from 'primeng/confirmdialog'; +import { ConfirmationService, MessageService } from 'primeng/api'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; @@ -31,6 +33,8 @@ import { ProfileComponent } from './control-panel/profile/profile/profile.compon import { EditProfileComponent } from './control-panel/profile/edit-profile/edit-profile.component'; import { JwtInterceptor } from './_helpers/jwt.interceptor'; import { ErrorInterceptor } from './_helpers/error.interceptor'; +import { NotificationsService } from './_services/notifications.service'; +import { ToastModule } from 'primeng/toast'; @@ -80,6 +84,8 @@ export function HttpLoaderFactory(http: HttpClient) { HttpClientModule, FormsModule, CalendarModule, + ConfirmDialogModule, + ToastModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -92,6 +98,9 @@ export function HttpLoaderFactory(http: HttpClient) { INIT_API_CONFIGURATION, AppService, AuthenticationService, + ConfirmationService, + NotificationsService, + MessageService, { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }, ], diff --git a/src/app/control-panel/home/home.component.html b/src/app/control-panel/home/home.component.html index 0785ad5..6060661 100644 --- a/src/app/control-panel/home/home.component.html +++ b/src/app/control-panel/home/home.component.html @@ -33,7 +33,7 @@

Still not registered?

Sign in now to access to your configuration panel

- diff --git a/src/app/control-panel/home/home.component.ts b/src/app/control-panel/home/home.component.ts index 76b5d6a..6df1bd9 100644 --- a/src/app/control-panel/home/home.component.ts +++ b/src/app/control-panel/home/home.component.ts @@ -1,5 +1,6 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router' +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { Router } from '@angular/router'; +import { AppService } from '../../_services/app.service'; @@ -9,11 +10,16 @@ import { Router } from '@angular/router' styleUrls: ['./home.component.css'] }) export class HomeComponent implements OnInit { - - constructor() { } + @Output() someEvent = new EventEmitter(); + constructor( + private _appService: AppService) { } ngOnInit() { - + } + public OpenSignInModal() { + this.someEvent.next('someExample'); + this._appService.OpenSignInModal.emit(true); + } } diff --git a/src/app/control-panel/profile/config/config.component.html b/src/app/control-panel/profile/config/config.component.html index 9f99914..8c4851e 100644 --- a/src/app/control-panel/profile/config/config.component.html +++ b/src/app/control-panel/profile/config/config.component.html @@ -1,3 +1,3 @@

- config works! + This is the config page. => Existing one.

diff --git a/src/app/control-panel/profile/edit-profile/edit-profile.component.css b/src/app/control-panel/profile/edit-profile/edit-profile.component.css index e69de29..53fb97f 100644 --- a/src/app/control-panel/profile/edit-profile/edit-profile.component.css +++ b/src/app/control-panel/profile/edit-profile/edit-profile.component.css @@ -0,0 +1,9 @@ +.ui-inputgroup{ + padding-top: 10px; + padding-bottom: 10px; +} + +.middleOfPage{ + width: 45%; + text-align: center; +} \ No newline at end of file diff --git a/src/app/control-panel/profile/edit-profile/edit-profile.component.html b/src/app/control-panel/profile/edit-profile/edit-profile.component.html index e4ae426..c7e35ff 100644 --- a/src/app/control-panel/profile/edit-profile/edit-profile.component.html +++ b/src/app/control-panel/profile/edit-profile/edit-profile.component.html @@ -1,3 +1,102 @@ -

- edit-profile works! -

+ +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+ +
+ + +
+ + + + \ No newline at end of file diff --git a/src/app/control-panel/profile/edit-profile/edit-profile.component.ts b/src/app/control-panel/profile/edit-profile/edit-profile.component.ts index 11ee186..2ebc3c6 100644 --- a/src/app/control-panel/profile/edit-profile/edit-profile.component.ts +++ b/src/app/control-panel/profile/edit-profile/edit-profile.component.ts @@ -1,4 +1,12 @@ import { Component, OnInit } from '@angular/core'; +import { AppService } from '../../../_services/app.service'; +import { TranslateService } from '@ngx-translate/core'; +import { AuthenticationService } from '../../../_services/authentication.service'; +import { UserService } from '../../../_api/services'; +import { Router } from '@angular/router'; +import { UserInfo } from '../../../_api/models'; +import { ConfirmationService } from 'primeng/api'; +import { NotificationsService } from '../../../_services/notifications.service'; @Component({ selector: 'app-edit-profile', @@ -7,9 +15,158 @@ import { Component, OnInit } from '@angular/core'; }) export class EditProfileComponent implements OnInit { - constructor() { } + public CurrentUser: UserInfo = {}; + public ErrorTextForm = ''; + public ConfirmPassword = ''; + + // Form Label + public LabelFormLastName: string; + public LabelFormFirstName: string; + public LabelFormEmail: string; + public LabelFormPassword: string; + public LabelFormConfirmPassword: string; + public LabelFormCreate: string; + + constructor( + private _appService: AppService, + private _translateService: TranslateService, + private _authService: AuthenticationService, + private _userService: UserService, + private _notifications: NotificationsService, + private _confirmationService: ConfirmationService, + private _router: Router) { } ngOnInit() { + this.LoadUser(this._authService.currentUserValue.id, false); + this.InitLabels(); + } + + public SubmitChange() { + if (this.CorrectForm()) { + this.CurrentUser.deviceIds = []; + this._userService.UpdateUser(this.CurrentUser) + .subscribe( + data => { + console.log('Update the user profile - success'); + this.CurrentUser = data; + const newDate = new Date(this.CurrentUser.birthday); + this.CurrentUser.birthday = this._appService.FormatDate(newDate); + this.ErrorTextForm = ''; + this._translateService.get('App.Common.Notifications.Update').subscribe(message => { + this._translateService.get('App.Profile.Edit.Notifications.ChangedSuccess').subscribe(detail => { + this._notifications.addMessage('success', message, detail); + }); + }); + }, + error => { + if (error !== null && error === 'Conflict') { + this._translateService.get('App.Home.SignIn.ErrorAlreadyExist').subscribe(text => { + this.ErrorTextForm = text; + }); + } else { + this._translateService.get('App.Home.SignIn.ErrorUnknown').subscribe(text => { + this.ErrorTextForm = text; + }); + } + }); + } + } + + public CorrectForm(): boolean { + if (this.CurrentUser.firstName == null || this.CurrentUser.lastName == null || + this.CurrentUser.email == null || this.CurrentUser.password == null) { + this._translateService.get('App.Home.SignIn.ErrorFieldsMissing').subscribe(text => { + this.ErrorTextForm = text; + }); + return false; + } + if (this.ConfirmPassword !== this.CurrentUser.password) { + this._translateService.get('App.Home.SignIn.ErrorConfirmPassword').subscribe(text => { + this.ErrorTextForm = text; + }); + return false; + } + this.ErrorTextForm = ''; + return true; + } + + public CancelChange() { + this.LoadUser(this._authService.currentUserValue.id, true); + } + + public DeleteProfil() { + console.log('delete profil'); + + this._translateService.get('App.Common.Form.DeleteConfirm').subscribe(confirmMessage => { + this._translateService.get('App.Common.Yes').subscribe(yes => { + this._translateService.get('App.Common.No').subscribe(no => { + this._confirmationService.confirm({ + message: confirmMessage, + acceptLabel: yes, + rejectLabel: no, + accept: () => { + this._userService.DeleteUser(this._authService.currentUserValue.id) + .subscribe( + data => { + this._authService.Logout(); + this._authService.IsLoggedIn = false; + location.reload(); + }, + error => { + this._translateService.get('App.Home.SignIn.ErrorUnknown').subscribe(text => { + this.ErrorTextForm = text; + }); + }); + } + }); + }); + }); + }); + } + + public LoadUser(id, cancelChange) { + this._userService.Get_1(id) + .subscribe( + data => { + console.log('Loading the user - success'); + this.CurrentUser = data; + const newDate = new Date(this.CurrentUser.birthday); + this.CurrentUser.birthday = this._appService.FormatDate(newDate); + + if (cancelChange) { + this._translateService.get('App.Common.Notifications.Update').subscribe(message => { + this._translateService.get('App.Profile.Edit.Notifications.CancelModification').subscribe(detail => { + this._notifications.addMessage('success', message, detail); + }); + }); + } + }, + error => { + + }); + } + + public InitLabels() { + // FORM + this._translateService.get('App.Common.Form.LastName').subscribe(label => { + this.LabelFormLastName = label; + }); + this._translateService.get('App.Common.Form.FirstName').subscribe(label => { + this.LabelFormFirstName = label; + }); + this._translateService.get('App.Common.Form.Email').subscribe(label => { + this.LabelFormEmail = label; + }); + this._translateService.get('App.Common.Form.Password').subscribe(label => { + this.LabelFormPassword = label; + }); + this._translateService.get('App.Common.Form.ConfirmPassword').subscribe(label => { + this.LabelFormConfirmPassword = label; + }); + this._translateService.get('App.Common.Form.Create').subscribe(label => { + this.LabelFormCreate = label; + }); + } } diff --git a/src/app/control-panel/profile/profile/profile.component.html b/src/app/control-panel/profile/profile/profile.component.html index cd8b801..b35ea0d 100644 --- a/src/app/control-panel/profile/profile/profile.component.html +++ b/src/app/control-panel/profile/profile/profile.component.html @@ -1,3 +1,3 @@

- profile works! + This is your profile view => You can see all your devices (the availability, params?), all your playlists, and links to create new configuration

diff --git a/src/app/control-panel/profile/profile/profile.component.ts b/src/app/control-panel/profile/profile/profile.component.ts index a6eceb3..5fada57 100644 --- a/src/app/control-panel/profile/profile/profile.component.ts +++ b/src/app/control-panel/profile/profile/profile.component.ts @@ -21,7 +21,6 @@ export class ProfileComponent implements OnInit { this._appService.ConnectionTest().subscribe( res => { console.log(res); - console.log('SUCCESS !!'); }, () => { console.log('error in test'); } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 760da50..a590a7a 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -1,7 +1,30 @@ { "App":{ "Home": { - "Login":"LOGIN", + "Login": { + "Header": "LOGIN", + "Label": "Login", + "ErrorText": "Wrong email and password combination", + "Identify": "Identify" + }, + "SignIn": { + "Header": "SIGN IN", + "Label": "Sign In", + "ErrorAlreadyExist": "This email is already used", + "ErrorConfirmPassword": "The passwords don't match", + "ErrorFieldsMissing": "Please fill all the fields", + "ErrorUnknown": "Unknown error occurred", + "CreateProfile": "Create profile" + }, + "About": { + "Header": "ABOUT" + }, + "Team": { + "Header": "TEAM" + }, + "Contact": { + "Header": "CONTACT" + }, "UserDropDown": { "Logout": "Logout", "ModifyUser": "Edit profile" @@ -11,6 +34,27 @@ }, "Profile": { "Edit": { + "Notifications": { + "ChangedSuccess": "The user profile has been successfully updated", + "CancelModification": "The modifications has been cancelled" + } + } + }, + "Common": { + "Ok": "Ok", + "Yes": "Yes", + "No": "No", + "Form": { + "LastName": "Last name", + "FirstName": "First name", + "Email": "Email", + "Password": "Password", + "ConfirmPassword": "Confirm password", + "Create": "Créer", + "DeleteConfirm": "Are you sure to delete this user?" + }, + "Notifications": { + "Update": "Updated" } } } diff --git a/swagger.json b/swagger.json index 72370b0..b0dc9b8 100644 --- a/swagger.json +++ b/swagger.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"v1","title":"MyCoreApi"},"paths":{"/azure":{"post":{"tags":["Azure"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/AzureADAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/books":{"get":{"tags":["Books"],"operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Book"}}}}},"post":{"tags":["Books"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"book","in":"body","required":false,"schema":{"$ref":"#/definitions/Book"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Book"}}}}},"/api/books/{id}":{"get":{"tags":["Books"],"operationId":"GetBook","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Book"}}}},"put":{"tags":["Books"],"operationId":"Update","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"string"},{"name":"bookIn","in":"body","required":false,"schema":{"$ref":"#/definitions/Book"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Books"],"operationId":"Delete","consumes":[],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success"}}}},"/api/device":{"get":{"tags":["Device"],"summary":"","operationId":"GetAllDevices","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Device"}}}}},"post":{"tags":["Device"],"summary":"","operationId":"CreateDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"query","required":false,"type":"integer","format":"int32"},{"name":"device","in":"body","required":false,"schema":{"$ref":"#/definitions/Device"}}],"responses":{"200":{"description":"Success"}}}},"/api/device/{idDevice}":{"get":{"tags":["Device"],"summary":"","operationId":"GetDeviceInfo","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"idDevice","in":"path","description":"Id of the device you want to get information","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Device"}}}},"put":{"tags":["Device"],"summary":"","operationId":"UpdateDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"device","in":"body","required":false,"schema":{"$ref":"#/definitions/Device"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Device"],"summary":"","operationId":"DeleteDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"deviceId","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/facebook":{"post":{"tags":["Facebook"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/FacebookAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/google":{"post":{"tags":["Google"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/GoogleAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/iot/smartprinter/{idDevice}":{"get":{"tags":["IOT"],"summary":"Retrieve all SmartPrinterMessage","operationId":"GetSmartPrinterMessages","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"query","description":"Id of the smart printer message","required":false,"type":"integer","format":"int32"},{"name":"idDevice","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartPrinterMessage"}}}}},"post":{"tags":["IOT"],"summary":"It's the method to post data from mqtt broker to Database (Thanks Rpi!)","operationId":"PostToDBPrinter","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","description":"Id of the device to upload to DB","required":true,"type":"integer","format":"int32"},{"name":"content","in":"body","description":"Content that will be uploaded","required":false,"schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartPrinterMessage"}}}],"responses":{"200":{"description":"Success"},"201":{"description":"Content successfully posted to DB"},"500":{"description":"Unexpected error"}}}},"/api/iot/smartgarden/{idDevice}":{"post":{"tags":["IOT"],"summary":"It's the method to post data from mqtt broker to Database (Thanks Rpi!)","operationId":"PostToDBSmartGarden","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"content","in":"body","required":false,"schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartGardenMessage"}}}],"responses":{"200":{"description":"Success"}}}},"/api/mqtt":{"get":{"tags":["MQTT"],"summary":"It's a mqtt publish test ! :)","operationId":"GetToPublishMqtt","consumes":[],"produces":[],"parameters":[],"responses":{"200":{"description":"Success"}}}},"/api/token":{"post":{"tags":["Token"],"operationId":"Create","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"email","in":"query","required":false,"type":"string"},{"name":"password","in":"query","required":false,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}}},"/token":{"post":{"tags":["Token"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success"}}}},"/twitter":{"post":{"tags":["Twitter"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/TwitterAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/user":{"get":{"tags":["User"],"summary":"Get a list of user","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/UserInfo"}}}}},"post":{"tags":["User"],"summary":"","operationId":"CreateUser","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"newUser","in":"body","required":false,"schema":{"$ref":"#/definitions/UserInfo"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}}},"/api/user/{id}":{"get":{"tags":["User"],"summary":"Get a specific user","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"id user","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}}},"/api/test":{"get":{"tags":["Values"],"summary":"It's a test ! :)","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"type":"string"}}}}},"post":{"tags":["Values"],"operationId":"Post","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"value","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/api/test/{id}":{"get":{"tags":["Values"],"operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}}}},"put":{"tags":["Values"],"operationId":"Put","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"},{"name":"value","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Values"],"operationId":"Delete","consumes":[],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Success"}}}}},"definitions":{"AzureADAuthModel":{"type":"object","properties":{"apiKey":{"type":"string"}}},"Book":{"type":"object","properties":{"id":{"type":"string"},"bookName":{"type":"string"},"price":{"format":"double","type":"number"},"category":{"type":"string"},"author":{"type":"string"}}},"Device":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"location":{"type":"string"},"locationExplanation":{"type":"string"},"height":{"format":"int32","type":"integer"},"width":{"format":"int32","type":"integer"}}},"FacebookAuthModel":{"type":"object","properties":{"userAccessToken":{"type":"string"}}},"GoogleAuthModel":{"type":"object","properties":{"authorizationCode":{"type":"string"},"apiKey":{"type":"string"}}},"SmartPrinterMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"time":{"type":"string"},"temperature":{"format":"double","type":"number"},"pressure":{"format":"double","type":"number"},"smoke":{"format":"int32","type":"integer"}}},"SmartGardenMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"time":{"type":"string"},"temperature":{"format":"double","type":"number"},"pressure":{"format":"double","type":"number"},"humidity":{"format":"double","type":"number"},"water":{"format":"int32","type":"integer"},"light":{"format":"int32","type":"integer"}}},"UserInfo":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"token":{"type":"string"},"birthday":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"language":{"type":"string"},"timeZone":{"type":"string"},"postalCode":{"format":"int32","type":"integer"},"screenConfigurationIds":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/ScreenConfiguration"}},"deviceIds":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Device"}}}},"ScreenConfiguration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"widgets":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Widget"}},"height":{"format":"int32","type":"integer"},"width":{"format":"int32","type":"integer"}}},"Widget":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"},"type":{"type":"string"},"activated":{"type":"boolean"},"form":{"type":"string"},"font":{"type":"string"},"color":{"type":"string"},"size":{"type":"string"},"width":{"format":"int32","type":"integer"},"height":{"format":"int32","type":"integer"},"positionX":{"format":"int32","type":"integer"},"positionY":{"format":"int32","type":"integer"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"password":{"type":"string"}}},"TwitterAuthModel":{"type":"object","properties":{"apiKey":{"type":"string"}}}},"securityDefinitions":{"Bearer":{"name":"Authorization","in":"header","type":"apiKey","description":"Please enter JWT with Bearer into field"}},"security":[{"Bearer":[]}]} \ No newline at end of file +{"swagger":"2.0","info":{"version":"v1","title":"MyCoreApi"},"paths":{"/azure":{"post":{"tags":["Azure"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/AzureADAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/books":{"get":{"tags":["Books"],"operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Book"}}}}},"post":{"tags":["Books"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"book","in":"body","required":false,"schema":{"$ref":"#/definitions/Book"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Book"}}}}},"/api/books/{id}":{"get":{"tags":["Books"],"operationId":"GetBook","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Book"}}}},"put":{"tags":["Books"],"operationId":"Update","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"string"},{"name":"bookIn","in":"body","required":false,"schema":{"$ref":"#/definitions/Book"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Books"],"operationId":"Delete","consumes":[],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success"}}}},"/api/device":{"get":{"tags":["Device"],"summary":"","operationId":"GetAllDevices","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Device"}}}}},"post":{"tags":["Device"],"summary":"","operationId":"CreateDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"query","required":false,"type":"integer","format":"int32"},{"name":"device","in":"body","required":false,"schema":{"$ref":"#/definitions/Device"}}],"responses":{"200":{"description":"Success"}}}},"/api/device/{idDevice}":{"get":{"tags":["Device"],"summary":"","operationId":"GetDeviceInfo","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"idDevice","in":"path","description":"Id of the device you want to get information","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Device"}}}},"put":{"tags":["Device"],"summary":"","operationId":"UpdateDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"device","in":"body","required":false,"schema":{"$ref":"#/definitions/Device"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Device"],"summary":"","operationId":"DeleteDevice","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"deviceId","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/facebook":{"post":{"tags":["Facebook"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/FacebookAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/google":{"post":{"tags":["Google"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/GoogleAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/iot/smartprinter/{idDevice}":{"get":{"tags":["IOT"],"summary":"Retrieve all SmartPrinterMessage","operationId":"GetSmartPrinterMessages","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"query","description":"Id of the smart printer message","required":false,"type":"integer","format":"int32"},{"name":"idDevice","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartPrinterMessage"}}}}},"post":{"tags":["IOT"],"summary":"It's the method to post data from mqtt broker to Database (Thanks Rpi!)","operationId":"PostToDBPrinter","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","description":"Id of the device to upload to DB","required":true,"type":"integer","format":"int32"},{"name":"content","in":"body","description":"Content that will be uploaded","required":false,"schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartPrinterMessage"}}}],"responses":{"200":{"description":"Success"},"201":{"description":"Content successfully posted to DB"},"500":{"description":"Unexpected error"}}}},"/api/iot/smartgarden/{idDevice}":{"post":{"tags":["IOT"],"summary":"It's the method to post data from mqtt broker to Database (Thanks Rpi!)","operationId":"PostToDBSmartGarden","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"idDevice","in":"path","required":true,"type":"integer","format":"int32"},{"name":"content","in":"body","required":false,"schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/SmartGardenMessage"}}}],"responses":{"200":{"description":"Success"}}}},"/api/mqtt":{"get":{"tags":["MQTT"],"summary":"It's a mqtt publish test ! :)","operationId":"GetToPublishMqtt","consumes":[],"produces":[],"parameters":[],"responses":{"200":{"description":"Success"}}}},"/api/token":{"post":{"tags":["Token"],"operationId":"Create","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"email","in":"query","required":false,"type":"string"},{"name":"password","in":"query","required":false,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}}},"/token":{"post":{"tags":["Token"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success"}}}},"/twitter":{"post":{"tags":["Twitter"],"operationId":"Create","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/TwitterAuthModel"}}],"responses":{"200":{"description":"Success"}}}},"/api/user":{"get":{"tags":["User"],"summary":"Get a list of user","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/UserInfo"}}}}},"put":{"tags":["User"],"summary":"","operationId":"UpdateUser","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"updatedUser","in":"body","required":false,"schema":{"$ref":"#/definitions/UserInfo"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}},"post":{"tags":["User"],"summary":"","operationId":"CreateUser","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"newUser","in":"body","required":false,"schema":{"$ref":"#/definitions/UserInfo"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}}},"/api/user/{id}":{"get":{"tags":["User"],"summary":"Get a specific user","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"id user","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserInfo"}}}},"delete":{"tags":["User"],"operationId":"DeleteUser","consumes":[],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success"}}}},"/api/test":{"get":{"tags":["Values"],"summary":"It's a test ! :)","operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"uniqueItems":false,"type":"array","items":{"type":"string"}}}}},"post":{"tags":["Values"],"operationId":"Post","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"value","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/api/test/{id}":{"get":{"tags":["Values"],"operationId":"Get","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}}}},"put":{"tags":["Values"],"operationId":"Put","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"},{"name":"value","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}},"delete":{"tags":["Values"],"operationId":"Delete","consumes":[],"produces":[],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Success"}}}}},"definitions":{"AzureADAuthModel":{"type":"object","properties":{"apiKey":{"type":"string"}}},"Book":{"type":"object","properties":{"id":{"type":"string"},"bookName":{"type":"string"},"price":{"format":"double","type":"number"},"category":{"type":"string"},"author":{"type":"string"}}},"Device":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"location":{"type":"string"},"locationExplanation":{"type":"string"},"height":{"format":"int32","type":"integer"},"width":{"format":"int32","type":"integer"}}},"FacebookAuthModel":{"type":"object","properties":{"userAccessToken":{"type":"string"}}},"GoogleAuthModel":{"type":"object","properties":{"authorizationCode":{"type":"string"},"apiKey":{"type":"string"}}},"SmartPrinterMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"time":{"type":"string"},"temperature":{"format":"double","type":"number"},"pressure":{"format":"double","type":"number"},"smoke":{"format":"int32","type":"integer"}}},"SmartGardenMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"time":{"type":"string"},"temperature":{"format":"double","type":"number"},"pressure":{"format":"double","type":"number"},"humidity":{"format":"double","type":"number"},"water":{"format":"int32","type":"integer"},"light":{"format":"int32","type":"integer"}}},"UserInfo":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"token":{"type":"string"},"birthday":{"format":"date-time","type":"string"},"dateCreation":{"format":"date-time","type":"string"},"address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"},"language":{"type":"string"},"timeZone":{"type":"string"},"postalCode":{"format":"int32","type":"integer"},"screenConfigurationIds":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/ScreenConfiguration"}},"deviceIds":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Device"}}}},"ScreenConfiguration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"widgets":{"uniqueItems":false,"type":"array","items":{"$ref":"#/definitions/Widget"}},"height":{"format":"int32","type":"integer"},"width":{"format":"int32","type":"integer"}}},"Widget":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"},"type":{"type":"string"},"activated":{"type":"boolean"},"form":{"type":"string"},"font":{"type":"string"},"color":{"type":"string"},"size":{"type":"string"},"width":{"format":"int32","type":"integer"},"height":{"format":"int32","type":"integer"},"positionX":{"format":"int32","type":"integer"},"positionY":{"format":"int32","type":"integer"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"password":{"type":"string"}}},"TwitterAuthModel":{"type":"object","properties":{"apiKey":{"type":"string"}}}},"securityDefinitions":{"Bearer":{"name":"Authorization","in":"header","type":"apiKey","description":"Please enter JWT with Bearer into field"}},"security":[{"Bearer":[]}]} \ No newline at end of file