Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fenghuo12
zheng
提交
7d6e48a4
Z
zheng
项目概览
fenghuo12
/
zheng
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zheng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7d6e48a4
编写于
11月 22, 2016
作者:
shuzheng5201314
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
55b669ea
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
38 addition
and
15 deletion
+38
-15
.gitignore
.gitignore
+2
-1
README.md
README.md
+4
-4
springboot/pom.xml
springboot/pom.xml
+0
-5
springboot/src/main/java/com/zheng/springboot/web/HelloController.java
...c/main/java/com/zheng/springboot/web/HelloController.java
+17
-1
springboot/src/main/resources/application-dev.properties
springboot/src/main/resources/application-dev.properties
+1
-0
springboot/src/main/resources/application-prod.properties
springboot/src/main/resources/application-prod.properties
+1
-0
springboot/src/main/resources/application-test.properties
springboot/src/main/resources/application-test.properties
+1
-0
springboot/src/main/resources/application.properties
springboot/src/main/resources/application.properties
+3
-0
springboot/src/main/resources/templates/index.html
springboot/src/main/resources/templates/index.html
+7
-1
springboot/src/test/java/com/zheng/SpringbootApplicationTests.java
...t/src/test/java/com/zheng/SpringbootApplicationTests.java
+2
-3
未找到文件。
.gitignore
浏览文件 @
7d6e48a4
.idea
*.iml
target
\ No newline at end of file
target
.log
\ No newline at end of file
README.md
浏览文件 @
7d6e48a4
...
...
@@ -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
...
...
springboot/pom.xml
浏览文件 @
7d6e48a4
...
...
@@ -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>
...
...
springboot/src/main/java/com/zheng/springboot/web/HelloController.java
浏览文件 @
7d6e48a4
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
(
2
l
);
user
.
setAge
(
22
);
user
.
setName
(
"lisi"
);
users
.
add
(
user
);
map
.
addAttribute
(
"users"
,
users
);
return
"/index"
;
}
...
...
springboot/src/main/resources/application-dev.properties
0 → 100644
浏览文件 @
7d6e48a4
profile.env
=
dev
\ No newline at end of file
springboot/src/main/resources/application-prod.properties
0 → 100644
浏览文件 @
7d6e48a4
profile.env
=
prod
\ No newline at end of file
springboot/src/main/resources/application-test.properties
0 → 100644
浏览文件 @
7d6e48a4
profile.env
=
test
\ No newline at end of file
springboot/src/main/resources/application.properties
浏览文件 @
7d6e48a4
########## 环境 ##########
spring.profiles.active
=
dev
evn
=
${profile.env}
########## 单数据源 ##########
#spring.datasource.url=jdbc:mysql://localhost:3306/zheng
#spring.datasource.username=root
...
...
springboot/src/main/resources/templates/index.html
浏览文件 @
7d6e48a4
<!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
springboot/src/test/java/com/zheng/SpringbootApplicationTests.java
浏览文件 @
7d6e48a4
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录