Spring Boot 入门、Spring Boot 配置、Web 开发、模板引擎、数据存储、数据缓存 案例更新

This commit is contained in:
liqiangqiang
2018-04-08 14:46:30 +08:00
parent c862ecd73b
commit fc5200546c
70 changed files with 2201 additions and 293 deletions

View File

@@ -0,0 +1,9 @@
## 是否启动日志 SQL 语句
spring.jpa.show-sql=true
spring.redis.host=localhost
spring.redis.port=6379
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1

View File

@@ -0,0 +1,2 @@
/* contentDiv */
.contentDiv {padding:20px 60px;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
<link th:href="@{https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/css/default.css}" rel="stylesheet"/>
<link rel="icon" th:href="@{/images/favicon.ico}" type="image/x-icon"/>
<meta charset="UTF-8"/>
<title>书籍管理</title>
</head>
<body>
<div class="contentDiv">
<h5>《Spring Boot 2.x 核心技术实战 - 上 基础篇》第 5 章《数据存储》Demo </h5>
<legend>
<strong>书籍管理</strong>
</legend>
<form th:action="@{/book/{action}(action=${action})}" method="post" class="form-horizontal">
<input type="hidden" name="id" th:value="${book.id}"/>
<div class="form-group">
<label for="book_name" class="col-sm-2 control-label">书名:</label>
<div class="col-xs-4">
<input type="text" class="form-control" id="book_name" name="name" th:value="${book.name}"
th:field="*{book.name}"/>
</div>
</div>
<div class="form-group">
<label for="book_writer" class="col-sm-2 control-label">作者:</label>
<div class="col-xs-4">
<input type="text" class="form-control" id="book_writer" name="writer" th:value="${book.writer}"
th:field="*{book.writer}"/>
</div>
</div>
<div class="form-group">
<label for="book_introduction" class="col-sm-2 control-label">简介:</label>
<div class="col-xs-4">
<textarea class="form-control" id="book_introduction" rows="3" name="introduction"
th:value="${book.introduction}" th:field="*{book.introduction}"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input class="btn btn-primary" type="submit" value="提交"/>&nbsp;&nbsp;
<input class="btn" type="button" value="返回" onclick="history.back()"/>
</div>
</div>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
<link th:href="@{https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/css/default.css}" rel="stylesheet"/>
<link rel="icon" th:href="@{/images/favicon.ico}" type="image/x-icon"/>
<meta charset="UTF-8"/>
<title>书籍列表</title>
</head>
<body>
<div class="contentDiv">
<h5>《Spring Boot 2.x 核心技术实战 - 上 基础篇》第 5 章《数据存储》Demo </h5>
<table class="table table-hover table-condensed">
<legend>
<strong>书籍列表</strong>
</legend>
<thead>
<tr>
<th>书籍编号</th>
<th>书名</th>
<th>作者</th>
<th>简介</th>
<th>管理</th>
</tr>
</thead>
<tbody>
<tr th:each="book : ${bookList}">
<th scope="row" th:text="${book.id}"></th>
<td><a th:href="@{/book/update/{bookId}(bookId=${book.id})}" th:text="${book.name}"></a></td>
<td th:text="${book.writer}"></td>
<td th:text="${book.introduction}"></td>
<td><a class="btn btn-danger" th:href="@{/book/delete/{bookId}(bookId=${book.id})}">删除</a></td>
</tr>
</tbody>
</table>
<div><a class="btn btn-primary" href="/book/create" role="button">新增书籍</a></div>
</div>
</body>
</html>