Skip to content

Commit 643a0c9

Browse files
committed
模板引擎
1 parent 29788c8 commit 643a0c9

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package info.xiaomo.freemarker.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.ModelMap;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
/**
8+
* 把今天最好的表现当作明天最新的起点..~
9+
* いま 最高の表現 として 明日最新の始発..~
10+
* Today the best performance as tomorrow newest starter!
11+
* Created by IntelliJ IDEA.
12+
*
13+
* @author: xiaomo
14+
* @github: https://github.com/qq83387856
15+
* @email: hupengbest@163.com
16+
* @QQ_NO: 83387856
17+
* @Date: 2016/11/16 10:19
18+
* @Copyright(©) 2015 by xiaomo.
19+
**/
20+
21+
@Controller
22+
public class FreemarkerController {
23+
24+
@RequestMapping("hello")
25+
public String hello(ModelMap map) {
26+
map.put("host", "使用freemarker!");
27+
return "index";
28+
}
29+
30+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
logging.config=classpath:config/logback-dev.xml
2+
server.port=8080
3+
server.session.timeout=1800
4+
server.max-http-header-size=20971520
5+
6+
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
7+
spring.jackson.time-zone=GMT+8
8+
9+
spring.freemarker.charset=utf-8
10+
11+
#other
12+
banner.location=config/banner-girl.txt
13+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.::::.
2+
.::::::::.
3+
:::::::::::
4+
..:::::::::::'
5+
'::::::::::::'
6+
.::::::::::
7+
'::::::::::::::..
8+
..::::::::::::.
9+
``::::::::::::::::
10+
::::``:::::::::' .:::.
11+
::::' ':::::' .::::::::.
12+
.::::' :::: .:::::::'::::.
13+
.:::' ::::: .:::::::::' ':::::.
14+
.::' :::::.:::::::::' ':::::.
15+
.::' ::::::::::::::' ``::::.
16+
...::: ::::::::::::' ``::.
17+
```` ':. ':::::::::' ::::..
18+
'.:::::' ':'````..
19+
:: Spring Boot :: (v1.4.1.RELEASE)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<configuration scan="true">
4+
5+
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder charset="UTF-8">
7+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level - %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<root level="INFO">
12+
<appender-ref ref="stdout"/>
13+
</root>
14+
15+
<logger name="info.xiaomo" level="DEBUG"/>
16+
17+
</configuration>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package info.xiaomo.velocity.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.ModelMap;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
/**
8+
* 把今天最好的表现当作明天最新的起点..~
9+
* いま 最高の表現 として 明日最新の始発..~
10+
* Today the best performance as tomorrow newest starter!
11+
* Created by IntelliJ IDEA.
12+
*
13+
* @author: xiaomo
14+
* @github: https://github.com/qq83387856
15+
* @email: hupengbest@163.com
16+
* @QQ_NO: 83387856
17+
* @Date: 2016/11/16 10:19
18+
* @Copyright(©) 2015 by xiaomo.
19+
**/
20+
21+
@Controller
22+
public class VelocityController {
23+
24+
@RequestMapping("hello")
25+
public String hello(ModelMap map) {
26+
map.put("host", "使用Velocity!");
27+
return "index";
28+
}
29+
30+
}

website/src/main/java/info/xiaomo/website/service/UserService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import info.xiaomo.core.exception.UserNotFoundException;
55
import info.xiaomo.website.model.UserModel;
66
import org.springframework.data.domain.Page;
7+
import org.springframework.transaction.annotation.Isolation;
8+
import org.springframework.transaction.annotation.Propagation;
9+
import org.springframework.transaction.annotation.Transactional;
710

811
import java.util.List;
912

@@ -25,6 +28,7 @@ public interface UserService {
2528

2629
UserModel findUserById(Long id);
2730

31+
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
2832
UserModel findUserByEmail(String email);
2933

3034
UserModel addUser(UserModel model);

0 commit comments

Comments
 (0)