Commit 53b47758 authored by Bryan Roblero's avatar Bryan Roblero

test spring boot

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java">
<attributes>
<attribute name="FROM_GRADLE_MODEL" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/resources">
<attributes>
<attribute name="FROM_GRADLE_MODEL" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/test/java">
<attributes>
<attribute name="FROM_GRADLE_MODEL" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Apple</name>
<comment>Project Apple created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
build.commands=org.eclipse.jdt.core.javabuilder
connection.arguments=
connection.java.home=null
connection.jvm.arguments=
connection.project.dir=
derived.resources=.gradle,build
eclipse.preferences.version=1
natures=org.eclipse.jdt.core.javanature
project.path=\:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.source=1.7
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="cloudfoundry.standalone.app" version="1.0"/>
</faceted-project>
boot.validation.initialized=true
eclipse.preferences.version=1
spring.datasource.url=jdbc:mysql://localhost:3306/pruebaS
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager)
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
@CHARSET "ISO-8859-1";
.msg-val {
color: red;
}
.msg-success {
color: green;
}
\ No newline at end of file
body {
background-color: #eaeef3;
}
.login_header {
background-color: transparent;
}
.footer_bg {
background-color: #286597;
color: #ffffff;
}
.btn_blue {
background-color: #013059;
color: #ffffff;
}
.btn_blue:focus, .btn_blue:hover {
color: #ffffff;
}
.btn_white {
background-color: #ffffff;
color: #000000;
}
.btn_green {
background-color: #669933;
color: #ffffff;
}
.btn_green:focus, .btn_green:hover {
color: #ffffff;
}
.btn_blue{
background-color: #286597;
color: #ffffff;
}
.btn_blue:focus, .btn_blue:hover {
color: #ffffff;
}
.link_blk {
color: #333333;
}
.blue_font {
color: #286597;
}
input.form-control {
color: #666666;
}
.alert_bx .form-control:focus {
/* border-color: #ff3333;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(255, 51, 51, 0);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(255, 51, 51, 0);*/
}
.exclamation_red {
color: #ff3333;
}
.infoCircle_blue {
color: #296597;
}
.infoCircle_grey{
color: #8C8A8A;
}
.error_red{
color: #ff0000;
}
.check_green {
color: #669933;
}
.exclamation_orange {
color: #ff9900;
}
.exclamation_danger{
color: #a94442;
}
/**COMMON PAGES**/
.cmn_header h1 {
color: #286597;
}
.cmn_content_section .form-control {
color: #999999;
}
.cmn_content_section input.form-control , textarea.form-control{
color: #000000 !important;
}
.bg_white{
background-color: #ffffff;
}
h1{
color: #000000;
}
.cmn_header{
background-color: #f0f4fa;
border-bottom: 1px solid #c5c5c5;
box-shadow: 0px 1px 5px #c5c5c5;
}
.cmn_footer{
background-color: #013059;
}
.cmn_content_section .fa-info-circle{
color: #296597;
}
.alert.alert-warning{
background-color: #fcf7e3;
color: #c09953;
}
.progress_bar_block .progress{
background-color: #c2c2c2;
}
.progress_bar_block .progress-bar {
background-color: #339900;
-webkit-box-shadow: inset 0 0px 0 rgba(0, 0, 0, .15);
box-shadow: inset 0 0px 0 rgba(0, 0, 0, .15);
}
.bordr_top{
border-top: 1px solid #cccccc;
}
body.page_bg_white{
background-color: #ffffff;
}
.page_bg_white .cmn_header h1{
color: #000000;
}
.page_bg_white .cmn_footer{
background-color: #e1e1e1;
}
.page_bg_white .cmn_header{
background-color: #e1e1e1;
}
.home_item_list .thumbnail{
background-color: #f7f7f7;
box-shadow: 1px 2px 6px #b5b6bb;
border: 0px solid #797979;
}
/* Spinner */
.am-spinner {
height: 30px;
width: 30px;
border-radius: 100%;
display: block;
position: relative;
top: 0px;
background-color: transparent;
border: 5px solid transparent;
border-color: #eee #eee #444 #444;
-webkit-animation: rotateLoading 1s linear 0s infinite normal;
-webkit-transform-origin: 50% 50%;
-moz-animation: rotateLoading 1.5s linear 0s infinite normal;
-moz-transform-origin: 50% 50%;
animation: rotateLoading 1.5s linear 0s infinite normal;
transform-origin: 50% 50%;
transition: all 0.1s ease-in;
}
@keyframes rotateLoading {
0% { transform: rotate(0deg); -webkit-transform: rotate(0deg);}
100% { transform: rotate(360deg); -webkit-transform: rotate(360deg);}
}
@-webkit-keyframes rotateLoading {
0% { -webkit-transform: rotate(0deg);}
100% { -webkit-transform: rotate(360deg);}
}
@-moz-keyframes rotateLoading {
0% { -moz-transform: rotate(0deg);}
100% { -moz-transform: rotate(360deg);}
}
.spinner-center {
overflow: auto;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
}
.btn_shadow {
-webkit-box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
-moz-box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
border-radius:0;
}
.btn_shadow:active:focus,
.btn_shadow:focus:hover,
.btn_shadow:focus {
-moz-outline-style: none;
outline: medium none;
}
.btn_shadow:active,
.btn_shadow.active {
top: 2px;
}
This diff is collapsed.
<!DOCTYPE html>
<html lang="en-US">
<body ng-app="myApp">
<div ng-controller="PersonController">
<h1> Travel PRO </h1>
<form name="personForm" >
<table>
<tr><th>Datos de Viaje</th></tr>
<tr ng-repeat="row in persons">
<td><span ng-bind="row.id"></span></td>
<td><span ng-bind="row.name"></span></td>
<td><span ng-bind="row.email"></span></td>
<td>
</tr>
</table>
<p class="bg-info info-msg" id="info1">{{Message}}</p>
<div class="form-group" >
<label class=blue_font>ID</label>
<input class=form-control type="text" id="ID" ng-model="personForm.id" placeholder="ID" autocomplete="off">
</div>
<div class="btn-wrapper">
<div class="form-group" >
<label class=blue_font>Nombre</label>
<input class=form-control type="text" id="Name" ng-model="personForm.name" placeholder="Nombre" autocomplete="off">
</div>
<div class="form-group" >
<label class=blue_font>Fecha de Viaje</label>
<input class=form-control type="text" id="Email" ng-model="personForm.email" placeholder="Fecha de Viaje" autocomplete="off">
</div>
<label class=blue_font>Destino</label>
<input class=form-control type="text" id="Email" ng-model="" placeholder="Destino" autocomplete="off">
</div>
<label class=blue_font>Estado</label>
<input class=form-control type="text" id="Email" ng-model="" placeholder="Estado" autocomplete="off">
</div>
<div class="btn-wrapper">
<div class="row-gutter-5">
<div class="col-md-4 col-xs-6 col-sm-6">
<button class="btn btn_blue" type="button" data-ng-click="create()" id="Create" >Create</button>
</div>
<div class="col-md-4 col-xs-6 col-sm-6">
<button class="btn btn_blue" type="button" data-ng-click="" id="refresh">Refresh</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script src="./js/angular.min.js"></script>
<script src="./js/angular-resource.min.js"></script>
<script src="./js/app.js"></script>
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/theme-default.css">
<link rel="stylesheet" href="./css/theme-blue.css">
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/custom.css">
</body>
</html>
\ No newline at end of file
/*
AngularJS v1.4.8
(c) 2010-2015 Google, Inc. http://angularjs.org
License: MIT
*/
(function(I,f,C){'use strict';function D(t,e){e=e||{};f.forEach(e,function(f,k){delete e[k]});for(var k in t)!t.hasOwnProperty(k)||"$"===k.charAt(0)&&"$"===k.charAt(1)||(e[k]=t[k]);return e}var y=f.$$minErr("$resource"),B=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;f.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,e=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
this.$get=["$http","$q",function(k,F){function w(f,g){this.template=f;this.defaults=r({},e.defaults,g);this.urlParams={}}function z(l,g,s,h){function c(a,q){var c={};q=r({},g,q);u(q,function(b,q){x(b)&&(b=b());var m;if(b&&b.charAt&&"@"==b.charAt(0)){m=a;var d=b.substr(1);if(null==d||""===d||"hasOwnProperty"===d||!B.test("."+d))throw y("badmember",d);for(var d=d.split("."),n=0,g=d.length;n<g&&f.isDefined(m);n++){var e=d[n];m=null!==m?m[e]:C}}else m=b;c[q]=m});return c}function G(a){return a.resource}
function d(a){D(a||{},this)}var t=new w(l,h);s=r({},e.defaults.actions,s);d.prototype.toJSON=function(){var a=r({},this);delete a.$promise;delete a.$resolved;return a};u(s,function(a,q){var g=/^(POST|PUT|PATCH)$/i.test(a.method);d[q]=function(b,A,m,e){var n={},h,l,s;switch(arguments.length){case 4:s=e,l=m;case 3:case 2:if(x(A)){if(x(b)){l=b;s=A;break}l=A;s=m}else{n=b;h=A;l=m;break}case 1:x(b)?l=b:g?h=b:n=b;break;case 0:break;default:throw y("badargs",arguments.length);}var w=this instanceof d,p=w?
h:a.isArray?[]:new d(h),v={},z=a.interceptor&&a.interceptor.response||G,B=a.interceptor&&a.interceptor.responseError||C;u(a,function(a,b){switch(b){default:v[b]=H(a);break;case "params":case "isArray":case "interceptor":break;case "timeout":v[b]=a}});g&&(v.data=h);t.setUrlParams(v,r({},c(h,a.params||{}),n),a.url);n=k(v).then(function(b){var c=b.data,m=p.$promise;if(c){if(f.isArray(c)!==!!a.isArray)throw y("badcfg",q,a.isArray?"array":"object",f.isArray(c)?"array":"object",v.method,v.url);a.isArray?
(p.length=0,u(c,function(b){"object"===typeof b?p.push(new d(b)):p.push(b)})):(D(c,p),p.$promise=m)}p.$resolved=!0;b.resource=p;return b},function(b){p.$resolved=!0;(s||E)(b);return F.reject(b)});n=n.then(function(b){var a=z(b);(l||E)(a,b.headers);return a},B);return w?n:(p.$promise=n,p.$resolved=!1,p)};d.prototype["$"+q]=function(b,a,c){x(b)&&(c=a,a=b,b={});b=d[q].call(this,b,this,a,c);return b.$promise||b}});d.bind=function(a){return z(l,r({},g,a),s)};return d}var E=f.noop,u=f.forEach,r=f.extend,
H=f.copy,x=f.isFunction;w.prototype={setUrlParams:function(l,g,e){var h=this,c=e||h.template,k,d,r="",a=h.urlParams={};u(c.split(/\W/),function(d){if("hasOwnProperty"===d)throw y("badname");!/^\d+$/.test(d)&&d&&(new RegExp("(^|[^\\\\]):"+d+"(\\W|$)")).test(c)&&(a[d]=!0)});c=c.replace(/\\:/g,":");c=c.replace(t,function(a){r=a;return""});g=g||{};u(h.urlParams,function(a,e){k=g.hasOwnProperty(e)?g[e]:h.defaults[e];f.isDefined(k)&&null!==k?(d=encodeURIComponent(k).replace(/%40/gi,"@").replace(/%3A/gi,
":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(b,a){return d+a})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(b,a,c){return"/"==c.charAt(0)?c:a+c})});h.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");l.url=r+c.replace(/\/\\\./,"/.");u(g,function(a,c){h.urlParams[c]||(l.params=l.params||{},l.params[c]=
a)})}};return z}]})})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
var app = angular.module('myApp', ['ngResource']);
app.controller('PersonController', ['$scope', '$resource',function($scope,$resource) {
function fetchAllPersons(){
$scope.persons = $resource('http://localhost:8080/person'
).query(function(data){return data;});
};
fetchAllPersons();
$scope.refresh = function(){
fetchAllPersons();
};
$scope.create = function(){
User = $resource(
"http://localhost:8080/create",
{},
{save: {method:'PUT',isArray:false}}
);
var user = {};
user.id = $scope.personForm.id;
user.name = $scope.personForm.name;
user.phoneNo = $scope.personForm.mobile;
user.password = $scope.personForm.password;
user.confirmPassword = "";
user.email = $scope.personForm.email;
$scope.Message = User.save(user);
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
$scope.deleteRec = function(){
User = $resource(
"http://localhost:8080/delete/:id",
{},
{save: {method:'DELETE', params: {id: '@id'}}}
);
User.delete({id: $scope.personForm.id}).then(function successCallback(response) {
$scope.Message = response;
}, function errorCallback(response) {
});
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
$scope.update = function(){
User = $resource(
"http://localhost:8080/update/:id",
{},
{save: {method:'PUT', params: {id: '@id'}}}
);
var user = {};
user.id = $scope.personForm.id;
user.name = $scope.personForm.name;
user.phoneNo = $scope.personForm.mobile;
user.password = $scope.personForm.password;
user.confirmPassword = "";
user.email = $scope.personForm.email;
$scope.Message = User.save({id: $scope.personForm.id}, user);
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
}]);
\ No newline at end of file
buildscript {
ext {
springBootVersion = '1.4.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
jar {
baseName = 'demo'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('org.springframework.boot:spring-boot-starter-jersey')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-web-services')
compile('org.springframework.boot:spring-boot-starter-websocket')
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Subproject commit 45688242e02476e34491d90004fae47cd59b7c5d
package com.Sample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@EntityScan(basePackageClasses=com.Sample.Entity.Person.class)
@SpringBootApplication
public class AppleApplication {
public static void main(String[] args) {
SpringApplication.run(AppleApplication.class, args);
}
}
package com.Sample.Controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.Sample.Entity.Person;
import com.Sample.Service.PersonService;
@Controller
public class PersonController {
@Autowired
private PersonService personService;
@RequestMapping(value = "/person", method = RequestMethod.GET)
@ResponseBody
public Object index(){
return personService.findAll();
}
@RequestMapping(value = "/create", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
//public String create(@RequestParam(value = "id", required = true) Long id, @RequestParam("name")String name,@RequestParam("email") String email,@RequestParam("password") String password,@RequestParam("PhoneNo") String PhoneNo) {
public String create(@RequestBody Person person) {
String userId = "";
try {
//Person user = new Person();
personService.save(person);
// userId = String.valueOf(user.getId());
userId = String.valueOf(person.getId());
}
catch (Exception ex) {
return "Error creating the user: " + ex.toString();
}
return "User succesfully created with id = " + userId;
}
@RequestMapping("/delete/{id}")
@ResponseBody
public String delete(@PathVariable long id) {
try {
Person user = personService.findById(id);
personService.delete(user);
}
catch (Exception ex) {
return "Error deleting the user:" + ex.toString();
}
return "User succesfully deleted!";
}
@RequestMapping("/get-by-email")
@ResponseBody
public String getByEmail(String email) {
String userId = "";
try {
Person user = personService.findByEmail(email);
userId = String.valueOf(user.getId());
}
catch (Exception ex) {
return "User not found";
}
return "The user id is: " + userId;
}
}
package com.Sample.DAO;
import com.Sample.Entity.Person;
import java.util.Map;
import org.springframework.stereotype.Repository;
@Repository
public class PersonDAO {
private static Map<Integer, Person> persons;
}
package com.Sample.Entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Person {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id")
private Long id;
public Person(Long id) {
this.id = id;
}
@Column(name = "name")
private String name;
@Column(name = "email", nullable = false, unique = true)
private String email;
@Column(name = "password")
private String password;
@Column(name = "mobile")
private String Phone;
private transient String confirmPassword;
public Person(String name, String email, String password, String Phone) {
this.name = name;
this.email = email;
this.password = password;
this.Phone = Phone;
}
public Person() {
// TODO Auto-generated constructor stub
}
public String getEmail() {
return email;
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public String getPassword() {
return password;
}
public String getPhoneNo() {
return Phone;
}
public void setEmail(String email) {
this.email = email;
}
public void setId(Long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setPassword(String password) {
this.password = password;
}
public void setPhoneNo(String phoneNo) {
Phone = phoneNo;
}
public String getConfirmPassword() {
return confirmPassword;
}
public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword;
}
}
package com.Sample.Service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.Sample.Entity.Person;
import com.Sample.repository.PersonRepository;
@Service
public class PersonService {
@Autowired
private PersonRepository personRepository;
public Object findAll(){
return personRepository.findAll();
}
public Person findById(Long id){
return personRepository.findOne(id);
}
public Person save(Person person){
return personRepository.save(person);
}
public void delete(Person person){
personRepository.delete(person);
return;
}
public Person findByEmail(String email) {
// TODO Auto-generated method stub
return null;
}
}
package com.Sample.repository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import com.Sample.Entity.Person;
@Repository
public interface PersonRepository extends CrudRepository<Person,Long> {
public Person findByEmail(String email);
/***public Person findUsingEmail(String email);******/
}
spring.datasource.url=jdbc:mysql://localhost:3306/pruebaS
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager)
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
@CHARSET "ISO-8859-1";
.msg-val {
color: red;
}
.msg-success {
color: green;
}
\ No newline at end of file
body {
background-color: #eaeef3;
}
.login_header {
background-color: transparent;
}
.footer_bg {
background-color: #286597;
color: #ffffff;
}
.btn_blue {
background-color: #013059;
color: #ffffff;
}
.btn_blue:focus, .btn_blue:hover {
color: #ffffff;
}
.btn_white {
background-color: #ffffff;
color: #000000;
}
.btn_green {
background-color: #669933;
color: #ffffff;
}
.btn_green:focus, .btn_green:hover {
color: #ffffff;
}
.btn_blue{
background-color: #286597;
color: #ffffff;
}
.btn_blue:focus, .btn_blue:hover {
color: #ffffff;
}
.link_blk {
color: #333333;
}
.blue_font {
color: #286597;
}
input.form-control {
color: #666666;
}
.alert_bx .form-control:focus {
/* border-color: #ff3333;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(255, 51, 51, 0);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(255, 51, 51, 0);*/
}
.exclamation_red {
color: #ff3333;
}
.infoCircle_blue {
color: #296597;
}
.infoCircle_grey{
color: #8C8A8A;
}
.error_red{
color: #ff0000;
}
.check_green {
color: #669933;
}
.exclamation_orange {
color: #ff9900;
}
.exclamation_danger{
color: #a94442;
}
/**COMMON PAGES**/
.cmn_header h1 {
color: #286597;
}
.cmn_content_section .form-control {
color: #999999;
}
.cmn_content_section input.form-control , textarea.form-control{
color: #000000 !important;
}
.bg_white{
background-color: #ffffff;
}
h1{
color: #000000;
}
.cmn_header{
background-color: #f0f4fa;
border-bottom: 1px solid #c5c5c5;
box-shadow: 0px 1px 5px #c5c5c5;
}
.cmn_footer{
background-color: #013059;
}
.cmn_content_section .fa-info-circle{
color: #296597;
}
.alert.alert-warning{
background-color: #fcf7e3;
color: #c09953;
}
.progress_bar_block .progress{
background-color: #c2c2c2;
}
.progress_bar_block .progress-bar {
background-color: #339900;
-webkit-box-shadow: inset 0 0px 0 rgba(0, 0, 0, .15);
box-shadow: inset 0 0px 0 rgba(0, 0, 0, .15);
}
.bordr_top{
border-top: 1px solid #cccccc;
}
body.page_bg_white{
background-color: #ffffff;
}
.page_bg_white .cmn_header h1{
color: #000000;
}
.page_bg_white .cmn_footer{
background-color: #e1e1e1;
}
.page_bg_white .cmn_header{
background-color: #e1e1e1;
}
.home_item_list .thumbnail{
background-color: #f7f7f7;
box-shadow: 1px 2px 6px #b5b6bb;
border: 0px solid #797979;
}
/* Spinner */
.am-spinner {
height: 30px;
width: 30px;
border-radius: 100%;
display: block;
position: relative;
top: 0px;
background-color: transparent;
border: 5px solid transparent;
border-color: #eee #eee #444 #444;
-webkit-animation: rotateLoading 1s linear 0s infinite normal;
-webkit-transform-origin: 50% 50%;
-moz-animation: rotateLoading 1.5s linear 0s infinite normal;
-moz-transform-origin: 50% 50%;
animation: rotateLoading 1.5s linear 0s infinite normal;
transform-origin: 50% 50%;
transition: all 0.1s ease-in;
}
@keyframes rotateLoading {
0% { transform: rotate(0deg); -webkit-transform: rotate(0deg);}
100% { transform: rotate(360deg); -webkit-transform: rotate(360deg);}
}
@-webkit-keyframes rotateLoading {
0% { -webkit-transform: rotate(0deg);}
100% { -webkit-transform: rotate(360deg);}
}
@-moz-keyframes rotateLoading {
0% { -moz-transform: rotate(0deg);}
100% { -moz-transform: rotate(360deg);}
}
.spinner-center {
overflow: auto;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
}
.btn_shadow {
-webkit-box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
-moz-box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
box-shadow: 2px 3px 0px rgba(4, 4, 4, 0.3);
border-radius:0;
}
.btn_shadow:active:focus,
.btn_shadow:focus:hover,
.btn_shadow:focus {
-moz-outline-style: none;
outline: medium none;
}
.btn_shadow:active,
.btn_shadow.active {
top: 2px;
}
This diff is collapsed.
<!DOCTYPE html>
<html lang="en-US">
<body ng-app="myApp">
<div ng-controller="PersonController">
<h1> Travel PRO </h1>
<form name="personForm" >
<table>
<tr><th>Datos de Viaje</th></tr>
<tr ng-repeat="row in persons">
<td><span ng-bind="row.id"></span></td>
<td><span ng-bind="row.name"></span></td>
<td><span ng-bind="row.email"></span></td>
<td>
</tr>
</table>
<p class="bg-info info-msg" id="info1">{{Message}}</p>
<div class="form-group" >
<label class=blue_font>ID</label>
<input class=form-control type="text" id="ID" ng-model="personForm.id" placeholder="ID" autocomplete="off">
</div>
<div class="btn-wrapper">
<div class="form-group" >
<label class=blue_font>Nombre</label>
<input class=form-control type="text" id="Name" ng-model="personForm.name" placeholder="Nombre" autocomplete="off">
</div>
<div class="form-group" >
<label class=blue_font>Fecha de Viaje</label>
<input class=form-control type="text" id="Email" ng-model="personForm.email" placeholder="Fecha de Viaje" autocomplete="off">
</div>
<label class=blue_font>Destino</label>
<input class=form-control type="text" id="Email" ng-model="" placeholder="Destino" autocomplete="off">
</div>
<label class=blue_font>Estado</label>
<input class=form-control type="text" id="Email" ng-model="" placeholder="Estado" autocomplete="off">
</div>
<div class="btn-wrapper">
<div class="row-gutter-5">
<div class="col-md-4 col-xs-6 col-sm-6">
<button class="btn btn_blue" type="button" data-ng-click="create()" id="Create" >Create</button>
</div>
<div class="col-md-4 col-xs-6 col-sm-6">
<button class="btn btn_blue" type="button" data-ng-click="" id="refresh">Refresh</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script src="./js/angular.min.js"></script>
<script src="./js/angular-resource.min.js"></script>
<script src="./js/app.js"></script>
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/theme-default.css">
<link rel="stylesheet" href="./css/theme-blue.css">
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/custom.css">
</body>
</html>
\ No newline at end of file
/*
AngularJS v1.4.8
(c) 2010-2015 Google, Inc. http://angularjs.org
License: MIT
*/
(function(I,f,C){'use strict';function D(t,e){e=e||{};f.forEach(e,function(f,k){delete e[k]});for(var k in t)!t.hasOwnProperty(k)||"$"===k.charAt(0)&&"$"===k.charAt(1)||(e[k]=t[k]);return e}var y=f.$$minErr("$resource"),B=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;f.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,e=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
this.$get=["$http","$q",function(k,F){function w(f,g){this.template=f;this.defaults=r({},e.defaults,g);this.urlParams={}}function z(l,g,s,h){function c(a,q){var c={};q=r({},g,q);u(q,function(b,q){x(b)&&(b=b());var m;if(b&&b.charAt&&"@"==b.charAt(0)){m=a;var d=b.substr(1);if(null==d||""===d||"hasOwnProperty"===d||!B.test("."+d))throw y("badmember",d);for(var d=d.split("."),n=0,g=d.length;n<g&&f.isDefined(m);n++){var e=d[n];m=null!==m?m[e]:C}}else m=b;c[q]=m});return c}function G(a){return a.resource}
function d(a){D(a||{},this)}var t=new w(l,h);s=r({},e.defaults.actions,s);d.prototype.toJSON=function(){var a=r({},this);delete a.$promise;delete a.$resolved;return a};u(s,function(a,q){var g=/^(POST|PUT|PATCH)$/i.test(a.method);d[q]=function(b,A,m,e){var n={},h,l,s;switch(arguments.length){case 4:s=e,l=m;case 3:case 2:if(x(A)){if(x(b)){l=b;s=A;break}l=A;s=m}else{n=b;h=A;l=m;break}case 1:x(b)?l=b:g?h=b:n=b;break;case 0:break;default:throw y("badargs",arguments.length);}var w=this instanceof d,p=w?
h:a.isArray?[]:new d(h),v={},z=a.interceptor&&a.interceptor.response||G,B=a.interceptor&&a.interceptor.responseError||C;u(a,function(a,b){switch(b){default:v[b]=H(a);break;case "params":case "isArray":case "interceptor":break;case "timeout":v[b]=a}});g&&(v.data=h);t.setUrlParams(v,r({},c(h,a.params||{}),n),a.url);n=k(v).then(function(b){var c=b.data,m=p.$promise;if(c){if(f.isArray(c)!==!!a.isArray)throw y("badcfg",q,a.isArray?"array":"object",f.isArray(c)?"array":"object",v.method,v.url);a.isArray?
(p.length=0,u(c,function(b){"object"===typeof b?p.push(new d(b)):p.push(b)})):(D(c,p),p.$promise=m)}p.$resolved=!0;b.resource=p;return b},function(b){p.$resolved=!0;(s||E)(b);return F.reject(b)});n=n.then(function(b){var a=z(b);(l||E)(a,b.headers);return a},B);return w?n:(p.$promise=n,p.$resolved=!1,p)};d.prototype["$"+q]=function(b,a,c){x(b)&&(c=a,a=b,b={});b=d[q].call(this,b,this,a,c);return b.$promise||b}});d.bind=function(a){return z(l,r({},g,a),s)};return d}var E=f.noop,u=f.forEach,r=f.extend,
H=f.copy,x=f.isFunction;w.prototype={setUrlParams:function(l,g,e){var h=this,c=e||h.template,k,d,r="",a=h.urlParams={};u(c.split(/\W/),function(d){if("hasOwnProperty"===d)throw y("badname");!/^\d+$/.test(d)&&d&&(new RegExp("(^|[^\\\\]):"+d+"(\\W|$)")).test(c)&&(a[d]=!0)});c=c.replace(/\\:/g,":");c=c.replace(t,function(a){r=a;return""});g=g||{};u(h.urlParams,function(a,e){k=g.hasOwnProperty(e)?g[e]:h.defaults[e];f.isDefined(k)&&null!==k?(d=encodeURIComponent(k).replace(/%40/gi,"@").replace(/%3A/gi,
":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(b,a){return d+a})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(b,a,c){return"/"==c.charAt(0)?c:a+c})});h.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");l.url=r+c.replace(/\/\\\./,"/.");u(g,function(a,c){h.urlParams[c]||(l.params=l.params||{},l.params[c]=
a)})}};return z}]})})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
var app = angular.module('myApp', ['ngResource']);
app.controller('PersonController', ['$scope', '$resource',function($scope,$resource) {
function fetchAllPersons(){
$scope.persons = $resource('http://localhost:8080/person'
).query(function(data){return data;});
};
fetchAllPersons();
$scope.refresh = function(){
fetchAllPersons();
};
$scope.create = function(){
User = $resource(
"http://localhost:8080/create",
{},
{save: {method:'PUT',isArray:false}}
);
var user = {};
user.id = $scope.personForm.id;
user.name = $scope.personForm.name;
user.phoneNo = $scope.personForm.mobile;
user.password = $scope.personForm.password;
user.confirmPassword = "";
user.email = $scope.personForm.email;
$scope.Message = User.save(user);
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
$scope.deleteRec = function(){
User = $resource(
"http://localhost:8080/delete/:id",
{},
{save: {method:'DELETE', params: {id: '@id'}}}
);
User.delete({id: $scope.personForm.id}).then(function successCallback(response) {
$scope.Message = response;
}, function errorCallback(response) {
});
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
$scope.update = function(){
User = $resource(
"http://localhost:8080/update/:id",
{},
{save: {method:'PUT', params: {id: '@id'}}}
);
var user = {};
user.id = $scope.personForm.id;
user.name = $scope.personForm.name;
user.phoneNo = $scope.personForm.mobile;
user.password = $scope.personForm.password;
user.confirmPassword = "";
user.email = $scope.personForm.email;
$scope.Message = User.save({id: $scope.personForm.id}, user);
$scope.personForm.id = "";
$scope.personForm.name="";
$scope.personForm.mobile="";
$scope.personForm.password="";
$scope.personForm.email="";
};
}]);
\ No newline at end of file
package com.Sample;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class AppleApplicationTests {
@Test
public void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment