-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/development'
Conflicts: .idea/libraries/com_github_warmuuh_libsass_maven_plugin_0_2_5_libsass_3_3_6.xml .idea/libraries/org_apache_maven_plugins_maven_resources_plugin_3_0_2.xml .idea/libraries/org_springframework_boot_spring_boot_devtools_1_4_3_RELEASE.xml .idea/workspace.xml
- Loading branch information
Showing
118 changed files
with
3,324 additions
and
7,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>es.urjc.etsii.mtenrero</groupId> | ||
<artifactId>vetmanager</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<groupId>es.urjc.etsii.mtenrero</groupId> | ||
<artifactId>vetmanager</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>vetmanager</name> | ||
<description>Demo project for Spring Boot</description> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>1.4.3.RELEASE</version> | ||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
<name>vetmanager</name> | ||
<description>Demo project for Spring Boot</description> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>1.4.3.RELEASE</version> | ||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<java.version>1.8</java.version> | ||
</properties> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<java.version>1.8</java.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-mongodb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-mustache</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web-services</artifactId> | ||
</dependency> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-mongodb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-mustache</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web-services</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<version>4.3.6.RELEASE</version> | ||
</dependency> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.warmuuh</groupId> | ||
<artifactId>libsass-maven-plugin</artifactId> | ||
<version>0.2.6-libsass_3.4.0</version> | ||
<executions> | ||
<execution> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<inputPath>${basedir}/src/main/sass</inputPath> | ||
<outputPath>src/main/resources/public/resources/styles</outputPath> | ||
<includePath>${basedir}/src/main/sass/components/</includePath> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>4.3.6.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<version>4.3.5.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<version>4.3.5.RELEASE</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.warmuuh</groupId> | ||
<artifactId>libsass-maven-plugin</artifactId> | ||
<version>0.2.6-libsass_3.4.0</version> | ||
<executions> | ||
<execution> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<inputPath>${basedir}/src/main/sass</inputPath> | ||
<outputPath>src/main/resources/public/resources/styles</outputPath> | ||
<includePath>${basedir}/src/main/sass/components/</includePath> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
</project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 51 additions & 1 deletion
52
src/main/java/es/urjc/etsii/mtenrero/Controllers/AppointmentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,70 @@ | ||
package es.urjc.etsii.mtenrero.Controllers; | ||
|
||
import es.urjc.etsii.mtenrero.Entities.Client; | ||
import es.urjc.etsii.mtenrero.Entities.Pet; | ||
import es.urjc.etsii.mtenrero.Entities.Appointment; | ||
import es.urjc.etsii.mtenrero.Entities.Pet_Breed; | ||
import es.urjc.etsii.mtenrero.Repositories.AppointmentRepository; | ||
import es.urjc.etsii.mtenrero.Repositories.ClientRepository; | ||
import es.urjc.etsii.mtenrero.Repositories.PetRepository; | ||
import es.urjc.etsii.mtenrero.Repositories.PreferenceRepository; | ||
import es.urjc.etsii.mtenrero.VetmanagerApplication; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Calendar; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by mtenrero on 28/01/2017. | ||
*/ | ||
@Controller | ||
public class AppointmentController { | ||
@Autowired | ||
PetRepository petRepository; | ||
@Autowired | ||
AppointmentRepository appointmentRepository; | ||
@Autowired | ||
PreferenceRepository preferenceRepository; | ||
@Autowired | ||
ClientRepository clientRepository; | ||
|
||
@RequestMapping("/dashboard/appointments") | ||
public String getLanding(Model model) { | ||
model.addAttribute("title", VetmanagerApplication.appName + ": Appointments"); | ||
model.addAttribute("navAppointments", true); | ||
|
||
model.addAttribute("intervals",this.preferenceRepository.findAll().get(0).generateWeekdayAppointmentIntervals()); | ||
model.addAttribute("Appointment", appointmentRepository.findAll()); | ||
return "appointments"; | ||
} | ||
|
||
@PostMapping("/dashboard/appointments") | ||
public String addAppointment(Model model, | ||
@RequestParam String hour, | ||
@RequestParam String consult, | ||
@RequestParam long petId | ||
) { | ||
model.addAttribute("title", VetmanagerApplication.appName + ": Appointments"); | ||
model.addAttribute("navAppointments", true); | ||
Appointment appointment = new Appointment(hour, petRepository.findById(petId), consult); | ||
appointment.setClient(petRepository.findById(petId).getClient()); | ||
appointment.setBreed(petRepository.findById(petId).getBreed()); | ||
if (appointmentRepository.save(appointment) != null) { | ||
model.addAttribute("savedClient", true); | ||
model.addAttribute("toastMessage", "Appointment saved correctly!"); | ||
} | ||
model.addAttribute("Appointment", appointmentRepository.findAll()); | ||
return "appointments"; | ||
} | ||
@GetMapping("/dashboard/appointments/{id}") | ||
public String getinfo(Model model,@PathVariable long id) { | ||
model.addAttribute("title", VetmanagerApplication.appName + ": Clients"); | ||
model.addAttribute("navClients", true); | ||
model.addAttribute("appointments",appointmentRepository.findOne(id)); | ||
return "appointment_view"; | ||
} | ||
} |
Oops, something went wrong.