<repo_name>VTristan/SpringBoot-Angular<file_sep>/Berlioz/src/app/services/developer.service.ts
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Observable, throwError } from 'rxjs';
import { Developer } from "src/app/models/developer";

@Injectable({
  providedIn: 'root'
})
export class DeveloperService {
  
  private url: string;
  
  constructor(private http: HttpClient) { 
  this.url = 'http://localhost:8080/';
  }
  
public getDeveloperById(id: String): Observable<Developer>{
  return this.http.get<Developer>(this.url+'/get/'+id);
}

public getAllDevelopers(): Observable<Developer[]>{
  return this.http.get<Developer[]>(this.url+'/get/');
}

}
<file_sep>/Stravinsky/src/main/java/at/project/stravinsky/service/impl/UserServiceImpl.java
package at.project.stravinsky.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import at.project.stravinsky.dao.UserDao;
import at.project.stravinsky.entity.User;
import at.project.stravinsky.service.UserService;


@Service("UserServiceImpl")
@Transactional
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserDao userDao;

	@Override
	public List<User> getAll() {
		return userDao.findAll();
	}
}
<file_sep>/Stravinsky/src/main/java/at/project/stravinsky/util/MailSender.java
package at.project.stravinsky.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

public class MailSender {
	
	@Autowired
	private JavaMailSender javaMailSender;
	
	public void sendMail() {
		SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
		simpleMailMessage.setFrom("");
		simpleMailMessage.setTo("");
		simpleMailMessage.setSubject("");
		simpleMailMessage.setText("test");
		javaMailSender.send(simpleMailMessage);
	}

}
<file_sep>/Berlioz/src/app/developer/developer.component.ts
import { Component, OnInit } from '@angular/core';
import { DeveloperService } from "src/app/services/developer.service";
import { Developer } from '../models/developer';

@Component({
  selector: 'app-developer',
  templateUrl: './developer.component.html',
  styleUrls: ['./developer.component.css']
})
export class DeveloperComponent implements OnInit {
developers: Developer[];

  constructor(private developerService : DeveloperService) { }

  ngOnInit() {

    this.developerService.getAllDevelopers().subscribe(data => {
      this.developers = data;
    })

//

  }


}
<file_sep>/Stravinsky/src/main/java/at/project/stravinsky/service/DeveloperService.java
package at.project.stravinsky.service;

import java.util.List;

import at.project.stravinsky.entity.Developer;

public interface DeveloperService {
	//Si le but du Dao est de communiquer avec la BdD.
	//Le but du service est de lui appliquer des règles métiers et de sécurité.

	public void insert(Developer object);
	public Developer getById(Integer id);
	public List<Developer> getAll();
	public void update(Developer object);
	public void deleteById(Integer id);
}
<file_sep>/Stravinsky/src/test/java/at/project/stravinsky/MainTest.java
package at.project.stravinsky;

import java.util.Base64;

public class MainTest {

	public static void main(String[] args) {
		String name = "admin";
		String password = "<PASSWORD>";
		String authString = name + ":" + password;
		byte[] authEncBytes = Base64.getEncoder().encode(authString.getBytes());
		String authStringEnc = new String(authEncBytes);
		System.out.println(authStringEnc);
	}
}
<file_sep>/Berlioz/src/app/models/User.ts
export class User {
  private id: number;
	private firstName: string;
	private lastName: string;
	private role: string;
	private login: string;
	private password: string;
}<file_sep>/Stravinsky/src/main/java/at/project/stravinsky/service/ProjectService.java
package at.project.stravinsky.service;

import java.util.List;

import at.project.stravinsky.entity.Project;

public interface ProjectService {
	//Si le but du Dao est de communiquer avec la BdD.
	//Le but du service est de lui appliquer des règles métiers et de sécurité.
	//Nous pouvons ne laisser que certaines actions disponible aussi.
	
	public List<Project> getAll();
}
<file_sep>/Stravinsky/src/main/java/at/project/stravinsky/entity/Developer.java
package at.project.stravinsky.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="developer")
public class Developer {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="dev_id")
	private Integer id;
	@Column(name="pseudo", nullable=false)
	private String pseudo;
	
	public Developer(Integer id, String pseudo) {
		this.id = id;
		this.pseudo = pseudo;
	}

	public Developer(String pseudo) {
		this.pseudo = pseudo;
	}
	
	@Override
	public String toString() {
		return "{'id':'"+id+"','pseudo':'"+pseudo+"'}";
	}

	//ASSESSEURS//
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getPseudo() {
		return pseudo;
	}
	public void setPseudo(String pseudo) {
		this.pseudo = pseudo;
	}
	
}<file_sep>/Berlioz/src/app/models/developer.ts
export class Developer {
  id: number;
  pseudo: string;
}<file_sep>/README.md
"# SB-A" 
Front : Belioz 
Back : Stravinsky
