Skip to content

Commit 4c922f8

Browse files
committed
Add publish.html & css
1 parent 0ad017e commit 4c922f8

File tree

5 files changed

+65
-22
lines changed

5 files changed

+65
-22
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# Spring boot
2-
练习资料
2+
练习参考资料
33
>[Spring Boot 文档](https://spring.io/projects/spring-boot)
44
>[Spring Web](https://spring.io/guides/gs/serving-web-content/)
55
>[Bootstrap 前端框架](https://v3.bootcss.com/getting-started/#download)
6+
>[Bootstrap 样式表](https://v3.bootcss.com/css/)
67
>[ES](https://elasticsearch.cn/explore)
78
>[GitHub OAuth2](https://devoloper.github.com/aoos/building-oauth-apps/creating-an-oauth-app/)
89
>[Okhttp](https://square.github.io/okhttp)
910
>[Spring Mybaits](https://mybatis.org/mybatis-3/zh/index.html)
11+
>[Flyway Migration](https://flywaydb.org/getstarted/firststeps/maven)
1012
1113
工具
12-
>[Git](https://github.com)
13-
>[Visual Paradigm](https://www.visual-paradigm.com)
14+
>代码版本管理[GitHub](https://github.com)
15+
>流程图[Visual Paradigm](https://www.visual-paradigm.com)
16+
>数据库版本脚本管理[Flyway Migration](https://flywaydb.org/getstarted/firststeps/maven)
1417
1518
> # Git 使用
1619
> ```shell script
20+
> # Git 使用
1721
> git init # 初始化本地仓库
1822
> git add . # 添加当前目录文件
1923
> git state # 查看状态
@@ -34,12 +38,14 @@
3438
>
3539
3640
```markdown
37-
Creating the first migration
38-
We create the migration directory `src/main/resources/db/migration`
39-
Followed by a first migration called `src/main/resources/db/migration/V1__Create_person_table.sql`
41+
*Flyway Migration*
42+
创建第一次迁移
43+
> 创建迁移目录 `src/main/resources/db/migration`(目标文件路径)
44+
> 进行第一次迁移 `src/main/resources/db/migration/V1__Create_person_table.sql`(SQL语句)
45+
> 执行Flyway迁移数据库 `mvn flyway:migrate`(执行语句)
4046
```
41-
## 数据库脚本
4247
48+
## 数据库脚本
4349
```sql
4450
table For H2
4551
-- ----------------------------

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<version>6.3.1</version>
9494
<!-- flywaydb 数据库地址配置 -->
9595
<configuration>
96-
<url>jdbc:h2:~\SqlServerDB\community.db</url>
96+
<url>jdbc:h2:D:\Users\LITSOFT\IdeaProjects\SqlDate\community.db</url>
9797
<user>root</user>
9898
<password>123456</password>
9999
</configuration>

src/main/java/life/majiang/community/controller/IndexController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class IndexController {
2929
@GetMapping("/")
3030
public String index(HttpServletRequest request) {
3131
Cookie[] cookies = request.getCookies(); // 获取用户 cookie
32-
if (cookies != null) {
32+
if (cookies != null) {// 判断是用户 Cookie 是否为空
3333
for (Cookie cookie : cookies) {
3434
if (cookie.getName().equals("token")) { // 检查 cookies_key是否为 token
3535
String token = cookie.getValue();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
body {
2+
background-color: #c4e3f3;
3+
}
4+
5+
.main {
6+
background-color: white;
7+
margin: 30px;
8+
}
9+
10+
.btn-publish {
11+
float: right;
12+
margin-bottom: 15px;
13+
}

src/main/resources/templates/publish.html

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
<link href="../static/css/community.css" rel="stylesheet">
34
<html xmlns:th="http://www.thymeleaf.org">
45
<head>
56
<title>发布 - 麻酱社区</title>
67
<meta charset="UTF-8" http-equiv="Content-Type"/>
78
<link href="css/bootstrap.min.css" rel="stylesheet">
89
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
10+
<link href="css/community.css" rel="stylesheet">
911
<script src="js/bootstrap.min.js" type="application/javascript"></script>
1012

1113
</head>
12-
<body>
1314
<nav class="navbar navbar-default">
1415
<div class="container-fluid">
15-
1616
<div class="navbar-header">
17-
<button aria-expanded="false" class="navbar-toggle collapsed" data-target="#bs-example-navbar-collapse-1"
17+
<button aria-expanded="false" class="navbar-toggle collapsed"
18+
data-target="#bs-example-navbar-collapse-1"
1819
data-toggle="collapse" type="button">
1920
<span class="sr-only">麻酱社区</span>
2021
</button>
@@ -34,10 +35,10 @@
3435
<!--如果不为空则展示,打印<li>整个节点-->
3536
<li class="dropdown" th:if="${session.user != null }">
3637
<!--th:text 替换整个标签a-->
37-
<a href="#" class="dropdown-toggle"
38-
aria-haspopup="true" data-toggle="dropdown"
39-
aria-expanded="false" role="button"
40-
th:text="${session.user.getName()}">个人信息<span class="caret"></span></a>
38+
<a aria-expanded="false" aria-haspopup="true"
39+
class="dropdown-toggle" data-toggle="dropdown"
40+
href="#" role="button"
41+
th:text="${session.user.getName()}">个人信息<span class="caret"></span></a>
4142
<ul class="dropdown-menu">
4243
<li><a href="#">消息中心</a></li>
4344
<li><a href="#">个人资料</a></li>
@@ -47,16 +48,39 @@
4748
<li th:if="${session.user == null}">
4849
<a href="https://github.com/login/oauth/authorize?client_id=639f4c8d6441c6136b44&redirect_url=http://localhost:8080/callback&scope=user&state=1">登录</a>
4950
</li>
50-
5151
</ul>
5252
</div>
5353
</div>
54-
<div class="container-fluid">
55-
<div class="row">
56-
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="background-color: red"></div>
57-
<div class="col-lg-3 col-md-12 col-sm-12 col-xs-12" style="background-color: green"> </div>
54+
</nav>
55+
<div class="container-fluid main">
56+
<div class="row">
57+
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
58+
<h2><span aria-hidden="true" class="glyphicon glyphicon-plus"></span>发起</h2>
59+
<hr>
60+
<from action="">
61+
<div class="form-group">
62+
<label for="titile">问题标题 (简明扼要):</label>
63+
<input class="form-control" id="titile" name="titile" placeholder="问题标题" type="text">
64+
</div>
65+
<div class="form-group">
66+
<label for="titile">问题补充 (必填 参考右侧提示):</label>
67+
<textarea class="form-control" cols="30" id="description" name="description"
68+
rows="30"></textarea>
69+
</div>
70+
<div class="form-group">
71+
<label for="titile">添加标签:</label>
72+
<input class="form-control" id="tag" name="tag" placeholder="输入标签 以,分隔" type="text">
73+
</div>
74+
<button class="btn btn-info btn-publish" type="submit">确认发布</button>
75+
</from>
76+
</div>
77+
<div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
78+
<h3>问题发起指南</h3>
79+
• 问题标题: 请用精简的语言描述您发布的问题,不超过25字 <br>
80+
• 问题补充: 详细补充您的问题内容,并确保问题描述清晰直观, 并提供一些相关的资料<br>
81+
• 选择标签: 选择一个或者多个合适的标签,用逗号隔开,每个标签不超过10个字<br>
5882
</div>
5983
</div>
60-
</nav>
84+
</div>
6185
</body>
6286
</html>

0 commit comments

Comments
 (0)