Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cambio de nombre en el proyecto Fixes#1 #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
22 changes: 19 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
<artifactId>ernsaqrio</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
<name>petclinic</name>
<name>Pet Clinic</name>

<properties>

Expand All @@ -31,7 +31,23 @@
<spring-format.version>0.0.19</spring-format.version>

</properties>

<developers>
<developer>
<id>ernsaqrio</id>
<name>Ernesto</name>
<email>[email protected]</email>
<roles>
<role>Developer</role>
<role>Gamer</role>
</roles>
<properties>
<favorite.videogame>Space Leaper Cocoon</favorite.videogame>
<favorite.manga>Bleach</favorite.manga>
<favorite.film>No game no life zero</favorite.film>
<favorite.music>Electronic music and Nightcore</favorite.music>
</properties>
</developer>
</developers>
<dependencies>
<!-- Spring and Spring Boot dependencies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.springframework.samples.petclinic.web;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.samples.petclinic.model.Person;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

Expand All @@ -12,6 +15,14 @@ public class WelcomeController {
@GetMapping({"/","/welcome"})
public String welcome(Map<String, Object> model) {

List<Person> persons = new ArrayList<Person>();
Person person = new Person();
person.setFirstName("Ernesto ");
person.setLastName("Saquete Rios");
persons.add(person);
model.put("persons", persons);
model.put("title", "Pet Clinic");
model.put("group", "Lab");
return "welcome";
}
}
8 changes: 8 additions & 0 deletions src/main/resources/db/hsqldb/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ INSERT INTO authorities(id,username,authority) VALUES (2,'owner1','owner');
-- One vet user, named vet1 with passwor v3t
INSERT INTO users(username,password,enabled) VALUES ('vet1','v3t',TRUE);
INSERT INTO authorities(id,username,authority) VALUES (3,'vet1','veterinarian');
-- My user is a pet owner
INSERT INTO users(username,password,enabled) VALUES ('ernsaqrio','E1999Caballo6',TRUE);
INSERT INTO authorities(id,username,authority) VALUES (4,'ernsaqrio','owner');


INSERT INTO vets(id, first_name,last_name) VALUES (1, 'James', 'Carter');
INSERT INTO vets(id, first_name,last_name) VALUES (2, 'Helen', 'Leary');
Expand Down Expand Up @@ -43,6 +47,8 @@ INSERT INTO owners VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085
INSERT INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683', 'owner1');
INSERT INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435', 'owner1');
INSERT INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487', 'owner1');
INSERT INTO owners VALUES (11, 'Ernesto', 'Saquete Rios', '41020 C New Delhi 1 Portal 8 Floor 2B', 'Seville', '618961461', 'ernsaqrio');


INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (1, 'Leo', '2010-09-07', 1, 1);
INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (2, 'Basil', '2012-08-06', 6, 2);
Expand All @@ -57,6 +63,8 @@ INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (10, 'Mulligan', '2
INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (11, 'Freddy', '2010-03-09', 5, 9);
INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (12, 'Lucky', '2010-06-24', 2, 10);
INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (13, 'Sly', '2012-06-08', 1, 10);
INSERT INTO pets(id,name,birth_date,type_id,owner_id) VALUES (14, 'Vanilla', '2022-06-08', 1, 11);


INSERT INTO visits(id,pet_id,visit_date,description) VALUES (1, 7, '2013-01-01', 'rabies shot');
INSERT INTO visits(id,pet_id,visit_date,description) VALUES (2, 8, '2013-01-02', 'rabies shot');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/main/webapp/WEB-INF/jsp/welcome.jsp
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
<%@ page session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<!-- %@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %-->

<petclinic:layout pageName="home">
<h2><fmt:message key="welcome"/></h2>
<div class="row">
<h2>Project ${title}</h2>
<p><h2>Group ${group}</h2></p>
<div class="row">
<div class="col-md-12">
<spring:url value="/resources/images/logoPNG_3.png" htmlEscape="true" var="logo"/>
<img class="img-responsive" src="${logo}"/>
</div>
</div>
<p>
<ul>
<c:forEach items="${persons}" var="person">
<li>${person.firstName} ${person.lastName}</li>
</c:forEach>
</ul>
</p>
</div>
<div class="row">
<div class="col-md-12">
<spring:url value="/resources/images/pets.png" htmlEscape="true" var="petsImage"/>
Expand Down