remove bin folder
This commit is contained in:
parent
06236434b3
commit
5663f044c6
|
@ -1,95 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<project
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>spring-rest-angular</artifactId>
|
|
||||||
<name>spring-rest-angular</name>
|
|
||||||
<groupId>com.baeldung</groupId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<packaging>war</packaging>
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>1.3.3.RELEASE</version>
|
|
||||||
</parent>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.data</groupId>
|
|
||||||
<artifactId>spring-data-commons</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hsqldb</groupId>
|
|
||||||
<artifactId>hsqldb</artifactId>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>19.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.rest-assured</groupId>
|
|
||||||
<artifactId>rest-assured</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.rest-assured</groupId>
|
|
||||||
<artifactId>spring-mock-mvc</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<finalName>angular-spring-rest-sample</finalName>
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
|
@ -1,4 +0,0 @@
|
||||||
server.contextPath=/
|
|
||||||
spring.h2.console.enabled=true
|
|
||||||
logging.level.org.hibernate.SQL=info
|
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
|
|
@ -1,47 +0,0 @@
|
||||||
CREATE TABLE student (
|
|
||||||
id INTEGER PRIMARY KEY,
|
|
||||||
name VARCHAR(30),
|
|
||||||
gender VARCHAR(10),
|
|
||||||
age INTEGER
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (1,'Bryan', 'Male',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (2, 'Ben', 'Male', 22);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (3,'Lisa', 'Female',24);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (4,'Sarah', 'Female',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (5,'Jay', 'Male',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (6,'John', 'Male',22);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (7,'Jordan', 'Male',24);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (8,'Rob', 'Male',26);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (9,'Will', 'Male',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (10,'Shawn', 'Male',22);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (11,'Taylor', 'Female',24);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (12,'Venus', 'Female',26);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (13,'Vince', 'Male',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (14,'Carol', 'Female',22);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (15,'Joana', 'Female',24);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (16,'Dion', 'Male',26);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (17,'Evans', 'Male',20);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (18,'Bart', 'Male',22);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (19,'Jenny', 'Female',24);
|
|
||||||
INSERT INTO student (id,name,gender,age)
|
|
||||||
VALUES (20,'Kristine', 'Female',26);
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|
||||||
version="2.5">
|
|
||||||
|
|
||||||
<welcome-file-list>
|
|
||||||
<welcome-file>index.html</welcome-file>
|
|
||||||
</welcome-file-list>
|
|
||||||
|
|
||||||
</web-app>
|
|
|
@ -1,17 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" ng-app="app">
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet"
|
|
||||||
href="//cdn.rawgit.com/angular-ui/bower-ui-grid/master/ui-grid.min.css">
|
|
||||||
<script
|
|
||||||
src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
|
|
||||||
<script
|
|
||||||
src="//cdn.rawgit.com/angular-ui/bower-ui-grid/master/ui-grid.min.js"></script>
|
|
||||||
<script src="view/app.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div ng-controller="StudentCtrl as vm">
|
|
||||||
<div ui-grid="gridOptions" class="grid" ui-grid-pagination></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,56 +0,0 @@
|
||||||
var app = angular.module('app', ['ui.grid','ui.grid.pagination']);
|
|
||||||
|
|
||||||
app.controller('StudentCtrl', ['$scope','StudentService', function ($scope,StudentService) {
|
|
||||||
var paginationOptions = {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 5,
|
|
||||||
sort: null
|
|
||||||
};
|
|
||||||
|
|
||||||
StudentService.getStudents(paginationOptions.pageNumber,
|
|
||||||
paginationOptions.pageSize).success(function(data){
|
|
||||||
$scope.gridOptions.data = data.content;
|
|
||||||
$scope.gridOptions.totalItems = data.totalElements;
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.gridOptions = {
|
|
||||||
paginationPageSizes: [5, 10, 20],
|
|
||||||
paginationPageSize: paginationOptions.pageSize,
|
|
||||||
enableColumnMenus:false,
|
|
||||||
useExternalPagination: true,
|
|
||||||
columnDefs: [
|
|
||||||
{ name: 'id' },
|
|
||||||
{ name: 'name' },
|
|
||||||
{ name: 'gender' },
|
|
||||||
{ name: 'age' }
|
|
||||||
],
|
|
||||||
onRegisterApi: function(gridApi) {
|
|
||||||
$scope.gridApi = gridApi;
|
|
||||||
gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
|
|
||||||
paginationOptions.pageNumber = newPage;
|
|
||||||
paginationOptions.pageSize = pageSize;
|
|
||||||
StudentService.getStudents(newPage,pageSize).success(function(data){
|
|
||||||
$scope.gridOptions.data = data.content;
|
|
||||||
$scope.gridOptions.totalItems = data.totalElements;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
app.service('StudentService',['$http', function ($http) {
|
|
||||||
|
|
||||||
function getStudents(pageNumber,size) {
|
|
||||||
pageNumber = pageNumber > 0?pageNumber - 1:0;
|
|
||||||
return $http({
|
|
||||||
method: 'GET',
|
|
||||||
url: 'student/get?page='+pageNumber+'&size='+size
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
getStudents:getStudents
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
Loading…
Reference in New Issue