// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/ClientRepository.java
// public interface ClientRepository extends UserRepository<Client> {
//     @CachePut("vetmanager")
//     Client save(Client client);
//     @Cacheable("vetmanager")
//     Client findByLegalID(int legalID);
// 
//     Collection<? extends Client> findFirst10ByPhone1(int i);
// 
//     Collection<? extends Client> findFirst10ByLastNameContainingIgnoreCase(String word);
// 
//     Collection<? extends Client> findFirst10ByFirstNameContainingIgnoreCase(String word);
// 
//     Collection<? extends Client> findFirst10ByLegalID(int i);
//     @Cacheable("vetmanager")
//     Client findById(long id);
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/PetRepository.java
// public interface PetRepository extends JpaRepository<Pet, Long> {
//     @CachePut("vetmanager")
//     Pet save(Pet pet);
//     @Cacheable("vetmanager")
//     Pet findById(long id);
// 
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/Pet_BreedRepository.java
// public interface Pet_BreedRepository extends JpaRepository<Pet_Breed, Long> {
//     List<Pet_Breed> findByBreed(String breed);
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/Pet_WeightHistoryRepository.java
// public interface Pet_WeightHistoryRepository extends JpaRepository<Pet_WeightHistory, Long> {
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/VetmanagerApplication.java
// @SpringBootApplication
// public class VetmanagerApplication extends SpringBootServletInitializer {
// 
// 	@Autowired
// 	static
// 	ClientRepository clientRepository;
// 
//     @Autowired
//     static
//     AppointmentRepository appointmentRepository;
// 
// 
// 
//     @Override
// 	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
// 		return application.sources(VetmanagerApplication.class);
// 	}
// 
// 	public static String appName = "VetManager";
// 
// 	public static void main(String[] args) {
// 		SpringApplication.run(VetmanagerApplication.class, args);
// 
// 		HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
// 			public boolean verify(String hostname, SSLSession session) {
// 				return true;
// 			}
// 		});
// 
// 		
// 		ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
// 		ses.scheduleAtFixedRate(new Runnable() {
// 			@Override
// 			public void run() {
// 			    System.out.print("HOOOOLA");
// 				List<Appointment> appointments = 			    appointmentRepository.findAll();
// 
// //                for (Appointment appointment : appointments) {
// //                    LocalDate dateBefore;
// //                    LocalDate dateAfter appointment.g;
// //                    long daysBetween = HOURS.between(dateBefore, dateAfter);
// //                    //if (client.getHoursBeforeNotification())
// //                }
// 
// 
//             }
// 		}, 0, 1, TimeUnit.DAYS);
// 	}
// }


import es.urjc.etsii.mtenrero.Entities.*;
import es.urjc.etsii.mtenrero.Repositories.ClientRepository;
import es.urjc.etsii.mtenrero.Repositories.PetRepository;
import es.urjc.etsii.mtenrero.Repositories.Pet_BreedRepository;
import es.urjc.etsii.mtenrero.Repositories.Pet_WeightHistoryRepository;
import es.urjc.etsii.mtenrero.VetmanagerApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.annotation.PostConstruct;
import java.text.DateFormat;
import java.util.List;
import java.util.Optional;
package es.urjc.etsii.mtenrero.Controllers;




/**
 * Created by mtenrero on 28/01/2017.
 */
@Controller
public class PetsController {
    @Autowired
    private PetRepository petRepository;
    @Autowired
    private ClientRepository clientRepository;
    @Autowired
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/ClientRepository.java
// public interface ClientRepository extends UserRepository<Client> {
//     @CachePut("vetmanager")
//     Client save(Client client);
//     @Cacheable("vetmanager")
//     Client findByLegalID(int legalID);
// 
//     Collection<? extends Client> findFirst10ByPhone1(int i);
// 
//     Collection<? extends Client> findFirst10ByLastNameContainingIgnoreCase(String word);
// 
//     Collection<? extends Client> findFirst10ByFirstNameContainingIgnoreCase(String word);
// 
//     Collection<? extends Client> findFirst10ByLegalID(int i);
//     @Cacheable("vetmanager")
//     Client findById(long id);
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/PetRepository.java
// public interface PetRepository extends JpaRepository<Pet, Long> {
//     @CachePut("vetmanager")
//     Pet save(Pet pet);
//     @Cacheable("vetmanager")
//     Pet findById(long id);
// 
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/Pet_BreedRepository.java
// public interface Pet_BreedRepository extends JpaRepository<Pet_Breed, Long> {
//     List<Pet_Breed> findByBreed(String breed);
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/Repositories/Pet_WeightHistoryRepository.java
// public interface Pet_WeightHistoryRepository extends JpaRepository<Pet_WeightHistory, Long> {
// }
// 
// Path: src/main/java/es/urjc/etsii/mtenrero/VetmanagerApplication.java
// @SpringBootApplication
// public class VetmanagerApplication extends SpringBootServletInitializer {
// 
// 	@Autowired
// 	static
// 	ClientRepository clientRepository;
// 
//     @Autowired
//     static
//     AppointmentRepository appointmentRepository;
// 
// 
// 
//     @Override
// 	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
// 		return application.sources(VetmanagerApplication.class);
// 	}
// 
// 	public static String appName = "VetManager";
// 
// 	public static void main(String[] args) {
// 		SpringApplication.run(VetmanagerApplication.class, args);
// 
// 		HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
// 			public boolean verify(String hostname, SSLSession session) {
// 				return true;
// 			}
// 		});
// 
// 		
// 		ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
// 		ses.scheduleAtFixedRate(new Runnable() {
// 			@Override
// 			public void run() {
// 			    System.out.print("HOOOOLA");
// 				List<Appointment> appointments = 			    appointmentRepository.findAll();
// 
// //                for (Appointment appointment : appointments) {
// //                    LocalDate dateBefore;
// //                    LocalDate dateAfter appointment.g;
// //                    long daysBetween = HOURS.between(dateBefore, dateAfter);
// //                    //if (client.getHoursBeforeNotification())
// //                }
// 
// 
//             }
// 		}, 0, 1, TimeUnit.DAYS);
// 	}
// }


// Path: src/main/java/es/urjc/etsii/mtenrero/Controllers/PetsController.java
import es.urjc.etsii.mtenrero.Entities.*;
import es.urjc.etsii.mtenrero.Repositories.ClientRepository;
import es.urjc.etsii.mtenrero.Repositories.PetRepository;
import es.urjc.etsii.mtenrero.Repositories.Pet_BreedRepository;
import es.urjc.etsii.mtenrero.Repositories.Pet_WeightHistoryRepository;
import es.urjc.etsii.mtenrero.VetmanagerApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.annotation.PostConstruct;
import java.text.DateFormat;
import java.util.List;
import java.util.Optional;

package es.urjc.etsii.mtenrero.Controllers;




/**
 * Created by mtenrero on 28/01/2017.
 */
@Controller
public class PetsController {
    @Autowired
    private PetRepository petRepository;
    @Autowired
    private ClientRepository clientRepository;
    @Autowired
    private Pet_WeightHistoryRepository petWeightHistoryRepository;