Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 80 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@
>
><b>2. ORGANIZAÇÃO DO PROJETO</b>
>
>><b>2.1. Fluxograma</b>
>><b>2.1. <a href="#org_geral"> Visão Geral</b></a>
>>
>><b>2.2. <a href="#org_fluxograma"> Fluxograma</b></a>
>
><b>3. SOFTWARE</b>
>
>><b>3.1. GOOGLE CLOUD</b>
>><b>3.1. <a href="#soft_google"> GOOGLE CLOUD</b></a>
>>
>>><b>3.1.1. Google API</b>
>>>
>>>><b>3.1.1.1. Directions API</b>
>>>>>
>>>>><b>3.1.1.1.1. Visão Geral</b>
>>>>>
>>>>
>>>><b>3.1.1.2. Distance Matrix API</b>
>>>>
>>>>><b>3.1.1.2.1. Visão Geral</b>
>>>>
>>>><b>3.1.1.3. Compute Engine API</b>
>>>>>
>>>>><b>3.1.1.3.1. Visão Geral</b>
>>>
>>><b>3.1.2. Instâncias Virtuais</b>
>>>
Expand All @@ -42,9 +39,48 @@
>>>>
>>>><b>3.1.3.2 Instalação e Implementação</b>
>>>
>>
>><b>3.2. FRONTEND</b>
>>
>>><b>3.2.1. Componentes</b>
>>>>
>>>><b>3.2.1.1. Login</b>
>>>>>
>>>>><b>3.2.1.1.1. CanActivate
>>>>>
>>>>><b>3.2.1.1.2. HttpClient
>>>>
>>>><b>3.2.1.2. Home</b>
>>>>
>>>><b>3.2.1.3. Dashboard</b>
>>>>>
>>>>><b>3.2.1.3.1. Contador de Clientes e Visitantes</b>
>>>>>
>>>>><b>3.2.1.3.2. Registro de Pacotes</b>
>>>>>
>>>>><b>3.2.1.3.3. Bounce Rate</b>
>>>>
>>>><b>3.2.1.4. Users</b>
>>>>
>>>><b>3.2.1.5. Pacotes</b>
>>>>>
>>>>><b>3.2.1.5.1. Recent Quote
>>>>>
>>>>><b>3.2.1.5.2. Register Quote
>>>>>
>>>>><b>3.2.1.5.3. Tracking Package
>>>
>>><b>3.2.2. Services</b>
>>>>
>>>><b>3.2.2.1. Login Service</b>
>>>>
>>>><b>3.2.2.2. Quote Service</b>
>>>
>>><b>3.2.3. Segurança (A analisar)
>>>>
>>>><b>3.2.3.1. Dados do Login
>>>>
>>>><b>3.2.3.2. Encriptação dos Dados
>>
>><b>3.3. BACKEND</b>
>>>
>>><b>3.3.1. Spring Boot</b>
Expand Down Expand Up @@ -73,7 +109,7 @@

## 1 - RESUMO

<details open id="resume">
<details id="resume">
<summary> <b>1.1 - Da Licença, Disponibilidade e Finalidade </b> </summary>

#### &nbsp;&nbsp;&nbsp;&nbsp; Esse projeto foi desenvolvido pelo grupo Roxo da Turma Java Noturno de 2022, composto por <b>Bruno Roberto, Cristian Schauffert, Kalil Fakhouri e Mateus Felipe</b> com a mentoria do <b> professor Oliota</b>, visando apenas a demonstração dos conhecimentos técnicos adquiridos durante o curso e a apresentação da etapa final à empresas.
Expand All @@ -86,7 +122,7 @@

</details>

<details open id="stack">
<details id="stack">
<summary> <b>1.2 - Das Tecnologias Utilizadas</b> </summary>

#### &nbsp;&nbsp;&nbsp;&nbsp; Durante o curso foi utilizado diversas tecnologias, métodos ágeis e ferramentas de desenvolvimento tais como:
Expand All @@ -112,3 +148,36 @@
> #### Metodologia:
>> * ##### <img align=center alt=kaka-vscode height=25 width=40 src="https://raw.githubusercontent.com/devicons/devicon/1119b9f84c0290e0f0b38982099a2bd027a48bf1/icons/trello/trello-plain.svg" /> Trello - Kanban

</details>
<br/><br/>

# 2 - ORGANIZAÇÃO DO PROJETO

<details open id="org_geral">
<summary><b>2.1 - Visão Geral</b></summary>

#### &nbsp;&nbsp;&nbsp;&nbsp;

</details>

<details open id="org_fluxograma">
<summary><b>2.2 - Fluxograma</b></summary>



</details>

<br/><br/>

# 3 - SOFTWARE

<details open id="soft_google">
<summary><b>3.1 - GOOGLE CLOUD</b></summary>
<br>

>## <b>3.1.1 - Google API
>>### <b>3.1.1.1 - Directions API </b>
>>
>>#### &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Directions API

</summary>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -26,4 +28,11 @@ public List<Carriers> listCarriers(){

}

@PostMapping()
public Carriers postCarrier(@RequestBody Carriers carrier) {

return carriersRepository.save(carrier);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.JSONPObject;

@RestController
Expand All @@ -26,28 +29,29 @@ public class ShipController {
final String GOOGLE = "https://maps.googleapis.com/maps/api/directions/json?origin=";

@GetMapping("/{cepOrigem}/{cepDestino}")
public JSONPObject getGoogleAPI(@PathVariable ("cepOrigem") int param1, @PathVariable ("cepDestino") int param2 ){
public JsonNode getGoogleAPI(@PathVariable ("cepOrigem") int param1, @PathVariable ("cepDestino") int param2 ){

try {

String APIUrl = GOOGLE+param1+"&destination="+param2+"&key=AIzaSyCKNjLUI0d01M0SfoDjIov4vZlR3DprotM";

URL url = new URL(APIUrl);
HttpsURLConnection get = (HttpsURLConnection) url.openConnection();

BufferedReader response = new BufferedReader(new InputStreamReader(get.getInputStream()));

String jsonEmString = converteJsonEmString(response);

JSONPObject obj = new JSONPObject(jsonEmString, null);

return obj;

}catch (Exception e) {

return null;

}

String APIUrl = GOOGLE+param1+"&destination="+param2+"&key=AIzaSyCKNjLUI0d01M0SfoDjIov4vZlR3DprotM";

URL url = new URL(APIUrl);
HttpsURLConnection get = (HttpsURLConnection) url.openConnection();

BufferedReader response = new BufferedReader(new InputStreamReader(get.getInputStream()));

String jsonEmString = converteJsonEmString(response);

ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(jsonEmString);

return node;

}catch (Exception e) {

return null;

}

}

Expand Down
16 changes: 16 additions & 0 deletions frontend/main/src/app/carrier.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { CarrierService } from './carrier.service';

describe('CarrierService', () => {
let service: CarrierService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(CarrierService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
19 changes: 19 additions & 0 deletions frontend/main/src/app/carrier.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';

@Injectable({
providedIn: 'root'
})
export class CarrierService {

apiURL:string = 'http://localhost:8080/carriers'

constructor(private router: Router, private http: HttpClient) { }

listCarrier():any{

return this.http.get(this.apiURL)

}
}
2 changes: 2 additions & 0 deletions frontend/main/src/app/loginservice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class LoginserviceService implements CanActivate {
progress: boolean = false
admin:boolean = false
enterprise:boolean = false
pessoaID!:number

constructor(private router: Router, private http: HttpClient) { }

Expand All @@ -42,6 +43,7 @@ export class LoginserviceService implements CanActivate {
this.user = resp.nome
this.admin = resp.admin
this.enterprise = resp.enterprise
this.pessoaID = response[0].pessoa_id
})
return response
})
Expand Down
23 changes: 20 additions & 3 deletions frontend/main/src/app/quote.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { type } from 'os';
import { catchError } from 'rxjs';
import { ShipQtComponent } from './ship-qt/ship-qt.component';

Expand All @@ -8,14 +10,29 @@ import { ShipQtComponent } from './ship-qt/ship-qt.component';
})
export class QuoteService {

apiURL:string = 'https://maps.googleapis.com/maps/api/directions/json?origin='
apiURL:string = 'http://localhost:8080/ship'
apiURL2:string = 'http://localhost:8080/quote'

constructor(private http: HttpClient) { }
constructor(private router: Router, private http: HttpClient) { }

quote(cepOrigem:string, cepDestino:string):any{

return this.http.get<any>(this.apiURL+cepOrigem+'&destination='+cepDestino+'&key=AIzaSyCKNjLUI0d01M0SfoDjIov4vZlR3DprotM')
return this.http.get(this.apiURL+'/'+cepOrigem+'/'+cepDestino)

}

regRecentQuotes(object:any){
this.http.post(this.apiURL2+'/recent',object)
.subscribe((response)=>{


console.log(response);

})


}



}
Loading