Skip to content

Commit 8a1f6f5

Browse files
authored
Merge pull request #2 from AdonisVienet/localRama
ajout services
2 parents e9843e2 + 6f401ce commit 8a1f6f5

23 files changed

+461
-3
lines changed
6.91 MB
Loading

src/app/components/sidebar/sidebar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="logo">
22
<a href="https://www.creative-tim.com" class="simple-text">
33
<div class="logo-img">
4-
<img src="/assets/img/angular2-logo-red.png"/>
4+
<!-- <img src="src/app/components/sidebar/image/realstateagency.jpg"/> -->
55
</div>
6-
Creative Tim
6+
Real Estate Agency
77
</a>
88
</div>
99
<div class="sidebar-wrapper">

src/app/components/sidebar/sidebar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ declare interface RouteInfo {
99
}
1010
export const ROUTES: RouteInfo[] = [
1111
{ path: '/dashboard', title: 'Dashboard', icon: 'dashboard', class: '' },
12-
{ path: '/user-profile', title: 'User Profile', icon:'person', class: '' },
12+
{ path: '/user-profile', title: 'Client', icon:'person', class: '' },
1313
{ path: '/table-list', title: 'Table List', icon:'content_paste', class: '' },
1414
{ path: '/typography', title: 'Typography', icon:'library_books', class: '' },
1515
{ path: '/icons', title: 'Icons', icon:'bubble_chart', class: '' },
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { AppartementService } from './appartement.service';
4+
5+
describe('AppartementService', () => {
6+
let service: AppartementService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(AppartementService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { HttpClient } from '@angular/common/http';
2+
import { Injectable } from '@angular/core';
3+
import { Observable } from 'rxjs';
4+
5+
@Injectable({
6+
providedIn: 'root'
7+
})
8+
export class AppartementService {
9+
private BASE_URL = "http://localhost:8080/appartements"
10+
constructor(private httpClient:HttpClient) { }
11+
12+
public findAll() : Observable<any>
13+
{ return this.httpClient.get(this.BASE_URL); }
14+
15+
public save(appartement:any) : Observable<any>
16+
{ return this.httpClient.post(this.BASE_URL, appartement); }
17+
18+
public delete(id:number) : Observable<any>
19+
{ return this.httpClient.delete(this.BASE_URL + "/" + id); }
20+
21+
public findOne(id:number) : Observable<any>
22+
{ return this.httpClient.get(this.BASE_URL + "/" + id);}
23+
24+
public update(appartement:any):Observable<any>{
25+
var appartementJSON = JSON.parse(appartement);
26+
return this.httpClient.put(this.BASE_URL + "/" + appartementJSON.idappartement, appartementJSON);
27+
}
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { AvisService } from './avis.service';
4+
5+
describe('AvisService', () => {
6+
let service: AvisService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(AvisService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});

src/app/services/avis.service.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { HttpClient } from '@angular/common/http';
2+
import { Injectable } from '@angular/core';
3+
import { Observable } from 'rxjs';
4+
5+
@Injectable({
6+
providedIn: 'root'
7+
})
8+
export class AvisService {
9+
10+
private BASE_URL = "http://localhost:8080/avis"
11+
constructor(private httpClient:HttpClient) { }
12+
13+
public findAll() : Observable<any>
14+
{ return this.httpClient.get(this.BASE_URL); }
15+
16+
public save(avis:any) : Observable<any>
17+
{ return this.httpClient.post(this.BASE_URL, avis); }
18+
19+
public delete(id:number) : Observable<any>
20+
{ return this.httpClient.delete(this.BASE_URL + "/" + id);}
21+
22+
public findOne(id:number) : Observable<any>
23+
{ return this.httpClient.get(this.BASE_URL + "/" + id); }
24+
25+
public update(avis:any):Observable<any>{
26+
var avisJSON = JSON.parse(avis);
27+
return this.httpClient.put(this.BASE_URL + "/" + avisJSON.idavis, avisJSON);
28+
}
29+
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { GarageService } from './garage.service';
4+
5+
describe('GarageService', () => {
6+
let service: GarageService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(GarageService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});

src/app/services/garage.service.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { HttpClient } from '@angular/common/http';
2+
import { Injectable } from '@angular/core';
3+
import { Observable } from 'rxjs';
4+
5+
@Injectable({
6+
providedIn: 'root'
7+
})
8+
export class GarageService {
9+
10+
private BASE_URL = "http://localhost:8080/garages"
11+
constructor(private httpClient:HttpClient) { }
12+
13+
public findAll() : Observable<any>
14+
{return this.httpClient.get(this.BASE_URL); }
15+
16+
public save(garage:any) : Observable<any>
17+
{ return this.httpClient.post(this.BASE_URL, garage);}
18+
19+
public delete(id:number) : Observable<any>
20+
{ return this.httpClient.delete(this.BASE_URL + "/" + id); }
21+
22+
public findOne(id:number) : Observable<any>
23+
{ return this.httpClient.get(this.BASE_URL + "/" + id); }
24+
25+
public update(garage:any):Observable<any>{
26+
var garageJSON = JSON.parse(garage);
27+
return this.httpClient.put(this.BASE_URL + "/" + garageJSON.idgarage, garageJSON);
28+
}
29+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { MaisonService } from './maison.service';
4+
5+
describe('MaisonService', () => {
6+
let service: MaisonService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(MaisonService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});

0 commit comments

Comments
 (0)