An open API service indexing awesome lists of open source software.

https://github.com/huangyanbin/springbootdemo

Spring Boot 示例
https://github.com/huangyanbin/springbootdemo

bootstrap freemarker hibernate js mybits mysql redis-cache spring-boot

Last synced: 3 months ago
JSON representation

Spring Boot 示例

Awesome Lists containing this project

README

          

# Spring Boot 示例
------
一个用于练手Spring boot 的demo.

> * 生成json数据,增加Result结果封装
> * 分别使用了Hibernate,mybatis。数据库mysql
> * 全局拦截,过滤
> * redis 缓存
> * 使用freemaker编写网页
> * 尝试写了table.js,根据json返回数据自动生成bootStrap样式表格
根据返回数据自动填充div。

------

## 如何自动生成表格
```js
fillTabClass($("#ArtTable"),"文章列表",[
{ name:"ID",
key:"id"
},
{ name:"图标",
key:"icon",
type:"img",
style:"width:40px;height:40px;",class:"img-circle"},
{ name:"主题",
key:"title",
type:"span"
},
{name:"时间",
key:"createTime",
format:function (time) {
return timeFormat(time);
}
}
],result.data,"table-bordered");
```
## 如何自动填充数据
```html






$title$


$content$






$user.nickName$

$createTime$






```
```js
fillHtmlElement2($("#articleDiv"),$("#articleCustom"),article,
[
{ key:"createTime",
format:function(time) {
return timeFormat(time);
}
}
]
);
```
### 待完善

- [ ] 自动填充数据Div不够完善.
- [ ] 自动生成表格可选项较少。