提交 7d6e48a4 编写于 作者: shuzheng5201314's avatar shuzheng5201314

update

上级 55b669ea
.idea
*.iml
target
\ No newline at end of file
target
.log
\ No newline at end of file
......@@ -12,6 +12,10 @@ zheng
| ├── qa-dao
| ├── qa-service
| └── qa-web
├── upms 通用用户权限系统
| ├── upms-dao
| ├── upms-service
| └── upms-admin
├── pay 支付系统
| ├── pay-service
| ├── pay-sdk
......@@ -28,10 +32,6 @@ zheng
| └── wechat-app 小程序
| ├── wechat-app-sdk
| └── wechat-app-example
├── upms 通用用户权限系统
| ├── upms-dao
| ├── upms-service
| └── upms-admin
├── api 接口系统
└── oss 对象存储系统
├── oss-sdk
......
......@@ -83,11 +83,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
<!-- mongodb -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
</dependencies>
<build>
......
package com.zheng.springboot.web;
import com.zheng.springboot.domain.User;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
......@@ -7,6 +8,9 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ZhangShuzheng on 2016/11/16.
*/
......@@ -15,9 +19,21 @@ public class HelloController {
@ApiOperation(value="测试首页", notes="测试首页get请求")
@ApiImplicitParam(name = "map", value = "ModelMap实体map", required = false, dataType = "ModelMap")
@RequestMapping(value = "/index", method = RequestMethod.GET)
@RequestMapping(value = "/hello", method = RequestMethod.GET)
public String index(ModelMap map) {
map.addAttribute("host", "http://www.zhangshuzheng.cn");
List<User> users = new ArrayList<>();
User user = new User();
user.setId(null);
user.setAge(11);
user.setName("");
users.add(user);
user = new User();
user.setId(2l);
user.setAge(22);
user.setName("lisi");
users.add(user);
map.addAttribute("users", users);
return "/index";
}
......
profile.env=dev
\ No newline at end of file
profile.env=prod
\ No newline at end of file
profile.env=test
\ No newline at end of file
########## 环境 ##########
spring.profiles.active=dev
evn=${profile.env}
########## 单数据源 ##########
#spring.datasource.url=jdbc:mysql://localhost:3306/zheng
#spring.datasource.username=root
......
<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="UTF-8"/>
<title></title>
</head>
<body>
<h1 th:text="${host}">Hello World</h1>
<ul th:each="user : ${users}">
<li th:text="${user.id}"></li>
<li th:text="${user.age}"></li>
<li th:text="${user.name}"></li>
</ul>
</body>
</html>
\ No newline at end of file
package com.zheng;
import com.zheng.springboot.SpringbootApplication;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,8 +19,8 @@ public class SpringbootApplicationTests {
public void contextLoads() {
System.out.println("=============================== redis start ===============================");
// 保存字符串
stringRedisTemplate.opsForValue().set("aaa", "111");
Assert.assertEquals("111", stringRedisTemplate.opsForValue().get("aaa"));
// stringRedisTemplate.opsForValue().set("aaa", "111");
// Assert.assertEquals("111", stringRedisTemplate.opsForValue().get("aaa"));
System.out.println("=============================== redis end ===============================");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册