diff --git a/package-lock.json b/package-lock.json index d2eb761..5194c7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8925,9 +8925,9 @@ "integrity": "sha512-p/hzIjUVccW4eJPhuORHI3AUkDpqfvCQVrjxbFEejnTEdWY4C8fomVfjiaA9jCu83fSQnBHuRIGB96iAR8R6uA==" }, "primeng": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/primeng/-/primeng-8.0.1.tgz", - "integrity": "sha512-87HQEh+S4lm4r280Thlk3pHzJJ1lr4Dl82zidnfWeOBZ5lMbK2w9w9yKJH875aPKWs0MMDVZeQ5V9jMWolRjlA==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/primeng/-/primeng-9.0.0.tgz", + "integrity": "sha512-gR9uvEc9/1BXV9tfMt9dggvCAlNZjhrlarbfLPViY6Hqqr588WhOOvU40Gm8rh3sbXkfisuc6Rvhu7ePQXscHA==" }, "process": { "version": "0.11.10", diff --git a/package.json b/package.json index e693197..82d1db1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "ngx-bootstrap": "^3.2.0", "popper": "^1.0.1", "primeicons": "^1.0.0", - "primeng": "^8.0.1", + "primeng": "^9.0.0", "rxjs": "~6.5.2", "tslib": "^1.9.0", "zone.js": "~0.9.1" diff --git a/src/app/_api/models.ts b/src/app/_api/models.ts index aa77a18..ade2db4 100644 --- a/src/app/_api/models.ts +++ b/src/app/_api/models.ts @@ -5,6 +5,7 @@ export { FacebookAuthModel } from './models/facebook-auth-model'; export { GoogleAuthModel } from './models/google-auth-model'; export { SmartPrinterMessage } from './models/smart-printer-message'; export { SmartGardenMessage } from './models/smart-garden-message'; +export { TokenDTO } from './models/token-dto'; export { UserInfo } from './models/user-info'; export { ScreenConfiguration } from './models/screen-configuration'; export { Widget } from './models/widget'; diff --git a/src/app/_api/models/token-dto.ts b/src/app/_api/models/token-dto.ts new file mode 100644 index 0000000..33b14d1 --- /dev/null +++ b/src/app/_api/models/token-dto.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +export interface TokenDTO { + email?: string; + password?: string; +} diff --git a/src/app/_api/models/user-info.ts b/src/app/_api/models/user-info.ts index 8f27136..121856e 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 { - dateCreation?: string; + address?: string; id?: string; email?: string; password?: string; @@ -10,10 +10,11 @@ export interface UserInfo { lastName?: string; token?: string; birthday?: string; + dateCreation?: string; role?: string; - address?: string; city?: string; state?: string; + country?: string; language?: string; timeZone?: string; postalCode?: number; diff --git a/src/app/_api/services/token.service.ts b/src/app/_api/services/token.service.ts index bc388dc..409ea2b 100644 --- a/src/app/_api/services/token.service.ts +++ b/src/app/_api/services/token.service.ts @@ -8,13 +8,14 @@ import { Observable as __Observable } from 'rxjs'; import { map as __map, filter as __filter } from 'rxjs/operators'; import { UserInfo } from '../models/user-info'; +import { TokenDTO } from '../models/token-dto'; import { User } from '../models/user'; @Injectable({ providedIn: 'root', }) class TokenService extends __BaseService { - static readonly CreatePath = '/api/token'; - static readonly Create_1Path = '/token'; + static readonly ConnectUserPath = '/api/token'; + static readonly CreatePath = '/token'; constructor( config: __Configuration, @@ -24,20 +25,14 @@ class TokenService extends __BaseService { } /** - * @param params The `TokenService.CreateParams` containing the following parameters: - * - * - `password`: - * - * - `email`: - * + * @param tokenDTO undefined * @return Success */ - CreateResponse(params: TokenService.CreateParams): __Observable<__StrictHttpResponse> { + ConnectUserResponse(tokenDTO?: TokenDTO): __Observable<__StrictHttpResponse> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - if (params.password != null) __params = __params.set('password', params.password.toString()); - if (params.email != null) __params = __params.set('email', params.email.toString()); + __body = tokenDTO; let req = new HttpRequest( 'POST', this.rootUrl + `/api/token`, @@ -56,16 +51,11 @@ class TokenService extends __BaseService { ); } /** - * @param params The `TokenService.CreateParams` containing the following parameters: - * - * - `password`: - * - * - `email`: - * + * @param tokenDTO undefined * @return Success */ - Create(params: TokenService.CreateParams): __Observable { - return this.CreateResponse(params).pipe( + ConnectUser(tokenDTO?: TokenDTO): __Observable { + return this.ConnectUserResponse(tokenDTO).pipe( __map(_r => _r.body as UserInfo) ); } @@ -73,7 +63,7 @@ class TokenService extends __BaseService { /** * @param user undefined */ - Create_1Response(user?: User): __Observable<__StrictHttpResponse> { + CreateResponse(user?: User): __Observable<__StrictHttpResponse> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; @@ -98,22 +88,14 @@ class TokenService extends __BaseService { /** * @param user undefined */ - Create_1(user?: User): __Observable { - return this.Create_1Response(user).pipe( + Create(user?: User): __Observable { + return this.CreateResponse(user).pipe( __map(_r => _r.body as null) ); } } module TokenService { - - /** - * Parameters for Create - */ - export interface CreateParams { - password?: string; - email?: string; - } } export { TokenService } diff --git a/src/app/_services/authentication.service.ts b/src/app/_services/authentication.service.ts index 635fbce..8aefbc6 100644 --- a/src/app/_services/authentication.service.ts +++ b/src/app/_services/authentication.service.ts @@ -4,6 +4,7 @@ import { Observable, BehaviorSubject } from 'rxjs'; import { TokenService } from '../_api/services/token.service'; import { UserInfo } from '../_api/models/user-info'; import { map } from 'rxjs/operators'; +import { TokenDTO } from '../_api/models'; @Injectable({ providedIn: 'root' @@ -24,16 +25,16 @@ export class AuthenticationService { this.currentUser = this.currentUserSubject.asObservable(); } - public GetToken(user: UserInfo): Observable { - return this._tokenService.Create(user); + public GetToken(user: TokenDTO): Observable { + return this._tokenService.ConnectUser(user); } public GetAuthStatus() { return this.IsLoggedIn; } - public Login(user: UserInfo) { - return this._tokenService.Create(user) + public Login(tokenDTO: TokenDTO) { + return this._tokenService.ConnectUser(tokenDTO) .pipe(map(user => { // store user details and jwt token in local storage to keep user logged in between page refreshes localStorage.setItem('currentUser', JSON.stringify(user)); diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4f2194a..a5cd47f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,14 +1,15 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { HomeComponent } from './control-panel/home/home.component'; -import { ConfigurationComponent } from './control-panel/profile/configuration/configuration.component'; +import { AutomationComponent } from './control-panel/profile/automation/automation.component'; import { AuthGuard } from './_helpers/auth.guard'; import { NotFoundComponent } from './control-panel/not-found/not-found.component'; import { ProfileComponent } from './control-panel/profile/profile/profile.component'; import { EditProfileComponent } from './control-panel/profile/edit-profile/edit-profile.component'; -import { EditConfigurationComponent } from './control-panel/profile/configuration/edit-configuration/edit-configuration.component'; +import { EditAutomationComponent } from './control-panel/profile/automation/edit-automation/edit-automation.component'; import { DevicesComponent } from './control-panel/profile/devices/devices.component'; import { DashboardComponent } from './control-panel/profile/dashboard/dashboard.component'; +import { BetComponent } from './control-panel/bet/bet.component'; const routes: Routes = [ @@ -23,12 +24,15 @@ const routes: Routes = { path: '', component: ProfileComponent}, { path: 'dashboard', component: DashboardComponent}, { path: 'edit', component: EditProfileComponent}, - { path: 'configurations', children: [ - { path: '', component: ConfigurationComponent}, - { path: ':configurationId', component: EditConfigurationComponent} + { path: 'automation', children: [ + { path: '', component: AutomationComponent}, + { path: ':configurationId', component: EditAutomationComponent} ]}, { path: 'devices', children: [ { path: '', component: DevicesComponent} + ]}, + { path: 'bet', children: [ + { path: '', component: BetComponent} ]} ]} ] diff --git a/src/app/app.component.html b/src/app/app.component.html index a215ff8..92784d1 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -11,7 +11,8 @@ - + + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0de65dc..1fb30ca 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,7 +5,7 @@ import { TranslateService } from '@ngx-translate/core'; import { AuthenticationService } from './_services/authentication.service'; import { Router } from '@angular/router'; import { first } from 'rxjs/operators'; -import { UserInfo } from './_api/models'; +import { UserInfo, TokenDTO } from './_api/models'; import { UserService } from './_api/services'; @@ -33,7 +33,7 @@ export class AppComponent implements OnInit { public CreateUser: UserInfo = {}; public ConfirmPassword: string; - public UserTryingToLogin: UserInfo = {}; + public UserTryingToLogin: TokenDTO = {}; // Sign in public ErrorTextSignIn = ''; @@ -105,19 +105,20 @@ export class AppComponent implements OnInit { } ); - this._translateService.get('App.Home.UserDropDown.ModifyUser').subscribe(modifyLabel => { - this._translateService.get('App.Home.UserDropDown.Logout').subscribe(logoutLabel => { + this._translateService.get(['App.Home.UserDropDown.ModifyUser', 'App.Home.UserDropDown.Logout', + 'App.Home.UserDropDown.Profile']).subscribe(labels => { this.ItemsUserDropDown = [ - {label: modifyLabel, icon: 'fa fa-edit', command: () => { + {label: labels['App.Home.UserDropDown.Profile'], icon: 'fa fa-user', command: () => { + this._router.navigate(['/profile/' + this.ConnectedUser.id]); + }}, + {label: labels['App.Home.UserDropDown.ModifyUser'], icon: 'fa fa-edit', command: () => { this._router.navigate(['/profile/' + this.ConnectedUser.id + '/edit']); }}, - {label: logoutLabel, icon: 'fa fa-sign-out', command: () => { + {label: labels['App.Home.UserDropDown.Logout'], icon: 'fa fa-sign-out', command: () => { this.Logout(); }} ]; }); - }); - } @@ -135,8 +136,8 @@ export class AppComponent implements OnInit { this.Email = null; this.Password = null; this._authService.IsLoggedIn = true; - this._router.navigate(['/profile/' + this.ConnectedUser.id]); this.ErrorTextLogin = ''; + this.GoToDashboard(); }, error => { this._translateService.get('App.Home.Login.ErrorText').subscribe(loginErrorText => { @@ -170,14 +171,18 @@ export class AppComponent implements OnInit { this._router.navigate(['/profile/' + this.ConnectedUser.id]); } - public GoToConfiguration() { - this._router.navigate(['/profile/' + this.ConnectedUser.id + '/configurations']); + public GoToAutomation() { + this._router.navigate(['/profile/' + this.ConnectedUser.id + '/automation']); } public GoToDevices() { this._router.navigate(['/profile/' + this.ConnectedUser.id + '/devices']); } + public GoToBet() { + this._router.navigate(['/profile/' + this.ConnectedUser.id + '/bet']); + } + public CreateProfile() { if (this.CorrectForm()) { this.CreateUser.deviceIds = []; @@ -241,50 +246,27 @@ export class AppComponent implements OnInit { 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; + this._translateService.get(['App.Home.Login.Header', 'App.Home.SignIn.Header', 'App.Home.About.Header', 'App.Home.Team.Header', + 'App.Home.Contact.Header', 'App.Home.Login.Identify', 'App.Home.SignIn.CreateProfile', 'App.Common.Form.LastName', + 'App.Common.Form.FirstName', 'App.Common.Form.Email', 'App.Common.Form.Password', 'App.Common.Form.ConfirmPassword', + 'App.Common.Form.Create' + ]).subscribe(labelTab => { + this.LabelHeaderLogIn = labelTab['App.Home.Login.Header']; + this.LabelHeaderSignIn = labelTab['App.Home.SignIn.Header']; + this.LabelHeaderAbout = labelTab['App.Home.About.Header']; + this.LabelHeaderTeam = labelTab['App.Home.Team.Header']; + this.LabelHeaderContact = labelTab['App.Home.Contact.Header']; + // LOGIN + this.LabelLoginIdentify = labelTab['App.Home.Login.Identify']; + // SIGN IN + this.LabelSignInCreateProfile = labelTab['App.Home.SignIn.CreateProfile']; + // FORM + this.LabelFormLastName = labelTab['App.Common.Form.LastName']; + this.LabelFormFirstName = labelTab['App.Common.Form.FirstName']; + this.LabelFormEmail = labelTab['App.Common.Form.Email']; + this.LabelFormPassword = labelTab['App.Common.Form.Password']; + this.LabelFormConfirmPassword = labelTab['App.Common.Form.ConfirmPassword']; + this.LabelFormCreate = labelTab['App.Common.Form.Create']; }); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e16d924..20a325e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -22,12 +22,12 @@ 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 { ConfirmationService, MessageService, MenuItem } from 'primeng/api'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { AuthenticationService } from './_services/authentication.service'; -import { ConfigurationComponent } from './control-panel/profile/configuration/configuration.component'; +import { AutomationComponent } from './control-panel/profile/automation/automation.component'; import { NotFoundComponent } from './control-panel/not-found/not-found.component'; import { ProfileComponent } from './control-panel/profile/profile/profile.component'; import { EditProfileComponent } from './control-panel/profile/edit-profile/edit-profile.component'; @@ -36,9 +36,12 @@ import { ErrorInterceptor } from './_helpers/error.interceptor'; import { NotificationsService } from './_services/notifications.service'; import { ToastModule } from 'primeng/toast'; import { DropdownModule } from 'primeng/dropdown'; -import { EditConfigurationComponent } from './control-panel/profile/configuration/edit-configuration/edit-configuration.component'; +import { EditAutomationComponent } from './control-panel/profile/automation/edit-automation/edit-automation.component'; import { DevicesComponent } from './control-panel/profile/devices/devices.component'; import { DashboardComponent } from './control-panel/profile/dashboard/dashboard.component'; +import { BetComponent } from './control-panel/bet/bet.component'; +import { PanelMenuModule } from 'primeng/panelmenu'; +import { EnergyComponent } from './control-panel/profile/dashboard/energy/energy.component'; @@ -67,13 +70,15 @@ export function HttpLoaderFactory(http: HttpClient) { AppComponent, HomeComponent, BorderCardDirective, - ConfigurationComponent, + AutomationComponent, NotFoundComponent, ProfileComponent, EditProfileComponent, - EditConfigurationComponent, + EditAutomationComponent, DevicesComponent, - DashboardComponent + DashboardComponent, + BetComponent, + EnergyComponent ], imports: [ BrowserModule, @@ -94,6 +99,7 @@ export function HttpLoaderFactory(http: HttpClient) { ConfirmDialogModule, ToastModule, DropdownModule, + PanelMenuModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/src/app/control-panel/profile/configuration/configuration.component.css b/src/app/control-panel/bet/bet.component.css similarity index 100% rename from src/app/control-panel/profile/configuration/configuration.component.css rename to src/app/control-panel/bet/bet.component.css diff --git a/src/app/control-panel/bet/bet.component.html b/src/app/control-panel/bet/bet.component.html new file mode 100644 index 0000000..8ec25c0 --- /dev/null +++ b/src/app/control-panel/bet/bet.component.html @@ -0,0 +1,11 @@ + +
+
+
+
+
+

My Bets

+

+ This is the bet page. => You will have the possibility to search matches according to the odds you want. +

+ \ No newline at end of file diff --git a/src/app/control-panel/profile/configuration/configuration.component.spec.ts b/src/app/control-panel/bet/bet.component.spec.ts similarity index 52% rename from src/app/control-panel/profile/configuration/configuration.component.spec.ts rename to src/app/control-panel/bet/bet.component.spec.ts index cbc856a..2986dd7 100644 --- a/src/app/control-panel/profile/configuration/configuration.component.spec.ts +++ b/src/app/control-panel/bet/bet.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ConfigurationComponent } from './configuration.component'; +import { BetComponent } from './bet.component'; -describe('ConfigurationComponent', () => { - let component: ConfigurationComponent; - let fixture: ComponentFixture; +describe('BetComponent', () => { + let component: BetComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ConfigurationComponent ] + declarations: [ BetComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(ConfigurationComponent); + fixture = TestBed.createComponent(BetComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/control-panel/bet/bet.component.ts b/src/app/control-panel/bet/bet.component.ts new file mode 100644 index 0000000..dca3792 --- /dev/null +++ b/src/app/control-panel/bet/bet.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-bet', + templateUrl: './bet.component.html', + styleUrls: ['./bet.component.css'] +}) +export class BetComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.css b/src/app/control-panel/profile/automation/automation.component.css similarity index 100% rename from src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.css rename to src/app/control-panel/profile/automation/automation.component.css diff --git a/src/app/control-panel/profile/automation/automation.component.html b/src/app/control-panel/profile/automation/automation.component.html new file mode 100644 index 0000000..e8b0119 --- /dev/null +++ b/src/app/control-panel/profile/automation/automation.component.html @@ -0,0 +1,23 @@ + +
+
+
+
+
+ +

My Automations

+ +

+ This is the automatisation page. => You will find list of all automations and link to create new one. +

+ +

+Here a list with : + +Name - last played (used) - Command buttons (edit, delete) +

+ + + \ No newline at end of file diff --git a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.spec.ts b/src/app/control-panel/profile/automation/automation.component.spec.ts similarity index 50% rename from src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.spec.ts rename to src/app/control-panel/profile/automation/automation.component.spec.ts index fc7d6a6..6292db7 100644 --- a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.spec.ts +++ b/src/app/control-panel/profile/automation/automation.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { EditConfigurationComponent } from './edit-configuration.component'; +import { AutomationComponent } from './automation.component'; -describe('EditConfigurationComponent', () => { - let component: EditConfigurationComponent; - let fixture: ComponentFixture; +describe('AutomationComponent', () => { + let component: AutomationComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditConfigurationComponent ] + declarations: [ AutomationComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(EditConfigurationComponent); + fixture = TestBed.createComponent(AutomationComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/control-panel/profile/configuration/configuration.component.ts b/src/app/control-panel/profile/automation/automation.component.ts similarity index 67% rename from src/app/control-panel/profile/configuration/configuration.component.ts rename to src/app/control-panel/profile/automation/automation.component.ts index 7faef93..b80d4ff 100644 --- a/src/app/control-panel/profile/configuration/configuration.component.ts +++ b/src/app/control-panel/profile/automation/automation.component.ts @@ -5,15 +5,15 @@ import { NotificationsService } from '../../../_services/notifications.service'; import { UserInfo } from '../../../_api/models'; @Component({ - selector: 'app-configuration', - templateUrl: './configuration.component.html', - styleUrls: ['./configuration.component.css'] + selector: 'app-automation', + templateUrl: './automation.component.html', + styleUrls: ['./automation.component.css'] }) -export class ConfigurationComponent implements OnInit { +export class AutomationComponent implements OnInit { public ConnectedUser: UserInfo; - public SelectedConfig = 'hkgskjhdskj15'; + public SelectedAutomation = 'hkgskjhdskj15'; constructor( private _notifications: NotificationsService, @@ -32,8 +32,8 @@ export class ConfigurationComponent implements OnInit { }); } - public OpenSelectedConfig() { - this._router.navigate([this._router.url, this.SelectedConfig]); + public OpenSelectedAutomation() { + this._router.navigate([this._router.url, this.SelectedAutomation]); } } diff --git a/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.css b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.html b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.html new file mode 100644 index 0000000..8b7908d --- /dev/null +++ b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.html @@ -0,0 +1,9 @@ + +
+
+
+
+
+

+ This is the edit automation page. => (Existing one from MyMirror 1.0) => You will have the chance to personnalize your screen configuration +

diff --git a/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.spec.ts b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.spec.ts new file mode 100644 index 0000000..73440fb --- /dev/null +++ b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditAutomationComponent } from './edit-automation.component'; + +describe('EditAutomationComponent', () => { + let component: EditAutomationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditAutomationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditAutomationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.ts b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.ts similarity index 74% rename from src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.ts rename to src/app/control-panel/profile/automation/edit-automation/edit-automation.component.ts index 08ce096..f3638bf 100644 --- a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.ts +++ b/src/app/control-panel/profile/automation/edit-automation/edit-automation.component.ts @@ -4,11 +4,11 @@ import { ConfirmationService } from 'primeng/api'; import { NotificationsService } from '../../../../_services/notifications.service'; @Component({ - selector: 'app-edit-configuration', - templateUrl: './edit-configuration.component.html', - styleUrls: ['./edit-configuration.component.css'] + selector: 'app-edit-automation', + templateUrl: './edit-automation.component.html', + styleUrls: ['./edit-automation.component.css'] }) -export class EditConfigurationComponent implements OnInit { +export class EditAutomationComponent implements OnInit { constructor( private _notifications: NotificationsService, diff --git a/src/app/control-panel/profile/configuration/configuration.component.html b/src/app/control-panel/profile/configuration/configuration.component.html deleted file mode 100644 index 09678b5..0000000 --- a/src/app/control-panel/profile/configuration/configuration.component.html +++ /dev/null @@ -1,15 +0,0 @@ - -
-
-
-
-
- -

- This is the config page. => You will find list of all configuration and link to create new one. -

- - - \ No newline at end of file diff --git a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.html b/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.html deleted file mode 100644 index 51879f3..0000000 --- a/src/app/control-panel/profile/configuration/edit-configuration/edit-configuration.component.html +++ /dev/null @@ -1,9 +0,0 @@ - -
-
-
-
-
-

- This is the edit config page. => (Existing one from MyMirror 1.0) => You will have the chance to personnalize your screen configuration -

diff --git a/src/app/control-panel/profile/dashboard/dashboard.component.css b/src/app/control-panel/profile/dashboard/dashboard.component.css index 80f0733..1793e2d 100644 --- a/src/app/control-panel/profile/dashboard/dashboard.component.css +++ b/src/app/control-panel/profile/dashboard/dashboard.component.css @@ -1,8 +1,6 @@ .sidebar { position: fixed; - width: 200px; - height: 400px; - background: #000; + width: 180px; } .content { margin-left: 200px; @@ -14,8 +12,6 @@ z-index: 1; } .info { - width: 1440px; - height: 300px; position: relative; background: #f55; } \ No newline at end of file diff --git a/src/app/control-panel/profile/dashboard/dashboard.component.html b/src/app/control-panel/profile/dashboard/dashboard.component.html index c2e6953..912e6ec 100644 --- a/src/app/control-panel/profile/dashboard/dashboard.component.html +++ b/src/app/control-panel/profile/dashboard/dashboard.component.html @@ -1,9 +1,14 @@ -
-
-
+
+
+ -
-
+
+

My Dashboard

+
+ +
+
\ No newline at end of file diff --git a/src/app/control-panel/profile/dashboard/dashboard.component.ts b/src/app/control-panel/profile/dashboard/dashboard.component.ts index d18e3f6..753babd 100644 --- a/src/app/control-panel/profile/dashboard/dashboard.component.ts +++ b/src/app/control-panel/profile/dashboard/dashboard.component.ts @@ -1,4 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import {PanelMenuModule} from 'primeng/panelmenu'; +import {MenuItem} from 'primeng/api'; +import { ElementSchemaRegistry } from '@angular/compiler'; @Component({ selector: 'app-dashboard', @@ -7,9 +10,71 @@ import { Component, OnInit } from '@angular/core'; }) export class DashboardComponent implements OnInit { + items: MenuItem[]; + + ShowEnergy = false; + constructor() { } ngOnInit() { + // TODO Retrieve list from service (depends on what the user has access to) + this.items = [ + { + icon: 'fas fa-seedling', + label: 'Energy', + items: [ + {label: 'Electricity', icon: 'fas fa-bolt', + items: [ + {label: 'Solar Panel', icon: 'fas fa-solar-panel', + command: () => { this.Open('Energy/Electricity/SolarPanel'); }} + ], + command: () => { this.Open('Energy/Electricity'); }}, + {label: 'Gas', icon: 'fas fa-burn'}, + {label: 'Water', icon: 'fas fa-tint'} + ], command: () => { this.Open('Energy'); } + }, + { + label: 'Security', + icon: 'fas fa-lock', + items: [ + {label: 'Alarm', icon: 'fas fa-bell'}, + {label: 'Camera', icon: 'fas fa-video'} + ] + }, + { + label: 'Entertainment', + icon: 'fas fa-music', + items: [ + { + label: 'Music', + icon: 'fas fa-music' + }, + { + label: 'Tv', + icon: 'fas fa-tv', + } + ] + }, + { + label: 'Health', + icon: 'fas fa-heartbeat', + items: [ + { + label: 'My body', + icon: ' fas fa-user-alt' + }, + { + label: 'Fitness', + icon: 'fas fa-running', + } + ] + } + ]; + } + + Open(module: string) { + console.log(module); + this.ShowEnergy = true; } } diff --git a/src/app/control-panel/profile/dashboard/energy/energy.component.css b/src/app/control-panel/profile/dashboard/energy/energy.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/control-panel/profile/dashboard/energy/energy.component.html b/src/app/control-panel/profile/dashboard/energy/energy.component.html new file mode 100644 index 0000000..d65e362 --- /dev/null +++ b/src/app/control-panel/profile/dashboard/energy/energy.component.html @@ -0,0 +1 @@ +

energy works!

diff --git a/src/app/control-panel/profile/dashboard/energy/energy.component.spec.ts b/src/app/control-panel/profile/dashboard/energy/energy.component.spec.ts new file mode 100644 index 0000000..e7d36f5 --- /dev/null +++ b/src/app/control-panel/profile/dashboard/energy/energy.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EnergyComponent } from './energy.component'; + +describe('EnergyComponent', () => { + let component: EnergyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EnergyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EnergyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/control-panel/profile/dashboard/energy/energy.component.ts b/src/app/control-panel/profile/dashboard/energy/energy.component.ts new file mode 100644 index 0000000..22fde41 --- /dev/null +++ b/src/app/control-panel/profile/dashboard/energy/energy.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-energy', + templateUrl: './energy.component.html', + styleUrls: ['./energy.component.css'] +}) +export class EnergyComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/control-panel/profile/devices/devices.component.html b/src/app/control-panel/profile/devices/devices.component.html index 5be1387..ce0ac5b 100644 --- a/src/app/control-panel/profile/devices/devices.component.html +++ b/src/app/control-panel/profile/devices/devices.component.html @@ -4,18 +4,29 @@

+

My Devices

- This is the devices page. => You will have the possibility to change parameters for all your screen devices => + This is the devices page. => You will have the possibility to change parameters for all your devices =>

-

Actions

+ - Voir l'état de connexion (ou dernière connexion) - Changer parametres - - Changer position - Changer Nom - Changer les owners - Supprimer du profil - Voir l'état de connexion - - Assigner une configuration (?) + - Voir les automatisations dans lesquels les devices jouent un rôle + - Voir le niveau de batterie des devices (si applicable) +

+ +

+Ici un petit endroit avec des trois zones : Combien de devices connectés/ non connectés ++ +

+ +

+Ici un tableau avec la liste des devices + +'Etat de connexion/date dernière connexion boule verte ou rouge '- 'Nom' - 'Dernières données recues du devices (si applicable) ou cellule en fonction du type de device' - 'Etat de batterie si applicable' - 'Boutons actions (Edit (changer le nom affiché du device), Supprimer)'

\ No newline at end of file diff --git a/src/app/control-panel/profile/profile/profile.component.html b/src/app/control-panel/profile/profile/profile.component.html index eb3f6ec..f570fbc 100644 --- a/src/app/control-panel/profile/profile/profile.component.html +++ b/src/app/control-panel/profile/profile/profile.component.html @@ -4,7 +4,7 @@

- +

My Profile

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/assets/i18n/en.json b/src/assets/i18n/en.json index a590a7a..3484403 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -27,7 +27,8 @@ }, "UserDropDown": { "Logout": "Logout", - "ModifyUser": "Edit profile" + "ModifyUser": "Edit profile", + "Profile": "My profile" } }, "NotFound": { diff --git a/swagger.json b/swagger.json index b0dc9b8..2ad1456 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"}}}}},"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 +{"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":"ConnectUser","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"tokenDTO","in":"body","required":false,"schema":{"$ref":"#/definitions/TokenDTO"}}],"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"}}},"TokenDTO":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}}},"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