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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -30,16 +31,17 @@ public class QuoteController {

@PostMapping("/recent")
public RecentQuote recentPackage(@RequestBody RecentQuote quote) {

return recentQuoteRepository.save(quote);

}

@PostMapping("/register")
public RegisterQuote registerPackage(@RequestBody RegisterQuote quote) {

return registerQuoteRepository.save(quote);

}

@GetMapping("/recent/{id}")
public List<RecentQuote> recentQuote(@PathVariable("id") int id){
return recentQuoteRepository.findOwnQuote(id);
}

@GetMapping("/go")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
package br.com.entra21.teamroxo.TMSProject.interfaces;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import br.com.entra21.teamroxo.TMSProject.template.RecentQuote;

@Repository
@EnableJpaRepositories
public interface RecentQuoteRepository extends JpaRepository<RecentQuote, Integer> {

@Query("FROM RecentQuote WHERE pessoa_id = :idUser")
List<RecentQuote> findOwnQuote(@Param("idUser") int idUser);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package br.com.entra21.teamroxo.TMSProject.template;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

public class SystemLink {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;

}
7 changes: 6 additions & 1 deletion frontend/main/src/app/loginservice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,29 @@ import { LoginComponent } from './login/login.component';
@Injectable({
providedIn: 'root'
})

export class LoginserviceService implements CanActivate {

readonly TMSLoginAPI: string = "http://localhost:8080"
readonly APIBounceInit: string = "http://localhost:8080/login/init"

//DADOS BÁSICOS
nome!: string
user!: string
email!: string
password!: string
birth!: Date
document!: string

//DADOS DE CONTROLE
succeed!: boolean
progress!: boolean
admin!: boolean
enterprise!: boolean
pessoaID!: number
adminEnter:boolean = false

//DADOS ESTATÍSTICOS
idBounce!: number
userBounce!: string
dateBounce!: string
Expand Down Expand Up @@ -79,7 +84,7 @@ export class LoginserviceService implements CanActivate {
this.email = resp.email
this.password = response[0].senha
})

let bounce: any = {
"user": response[0].user
}
Expand Down