Go to file
2016-07-06 09:54:17 +08:00
.settings init all 2016-07-06 09:54:17 +08:00
doc/sql init all 2016-07-06 09:54:17 +08:00
src init all 2016-07-06 09:54:17 +08:00
.gitignore init all 2016-07-06 09:54:17 +08:00
LICENSE Initial commit 2016-07-06 09:51:22 +08:00
pom.xml init all 2016-07-06 09:54:17 +08:00
README.md init all 2016-07-06 09:54:17 +08:00

#Spring-Blade 企业级开发平台

平台简介

Spring-Blade是基于多个优秀的开源项目高度整合封装而成的快速开发平台。主要用于交流学习
感谢活跃于开源中国的各位前辈jfinal作者、eova作者、hutool作者、beetl作者、dreamlu大牛等。
从c#转java的时候看着你们的代码学习了很多当中有部分代码使用到了各位的源码如果不能使用请及时联系我删除
ps:因为喜欢刀锋战士所以取名了SpringBlade当中有一个类也命名为Blade但是后来发现已经有了一个高人气的开源作品Blade作者是 王爵。 很尴尬,不过还是需要在这儿声明一下。

内置功能

  1. 用户管理
  2. 角色管理
  3. 菜单管理
  4. 字典管理
  5. 部门管理
  6. 附件管理
  7. 参数管理
  8. 连接池监视
  9. 日志管理

技术选型

1、后端

  • 核心框架Spring Framework
  • 安全框架Apache Shiro
  • 视图框架Spring MVC
  • 服务端验证Blade Validator
  • 任务调度Spring Task
  • 持久层框架beetlsql
  • 模板引擎beetl
  • 数据库连接池Alibaba Druid
  • 缓存框架Ehcache
  • 日志管理SLF4J、LOGBACKUP
  • 工具类Apache Commons、FastJson、EASYPOI、BladeToolBox

2、前端

  • JS框架jQuery
  • CSS框架Twitter Bootstrap
  • 客户端验证JQuery-html5Validate
  • 富文本KindEcitor
  • 数据表格jqGrid
  • 树结构控件jQuery zTree
  • 弹出层Layer
  • 日期控件: LayDate

后台界面

后台界面 后台界面

代码示例

实体类

@Table(name = "notice")
@BindID(name = "id")
@SuppressWarnings("serial")
public class Notice extends BaseModel {
	private String id;
	private Integer creater;
	private String content;
	private String title;
	private Date createTime;

	@AutoID
	@SeqID(name = "SEQ_NOTICE")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}	
	.....................
		
}

新增

	@ResponseBody
	@RequestMapping(KEY_SAVE)
	public AjaxResult save() {
		Notice notice = mapping(PERFIX, Notice.class);
		boolean temp = Blade.create(Notice.class).save(notice);
		if (temp) {
			return success(SAVE_SUCCESS_MSG);
		} else {
			return error(SAVE_FAIL_MSG);
		}
	}

修改

	@ResponseBody
	@RequestMapping(KEY_UPDATE)
	public AjaxResult update() {
		Notice notice = mapping(PERFIX, Notice.class);
		boolean temp = Blade.create(Notice.class).update(notice);
		if (temp) {
			return success(UPDATE_SUCCESS_MSG);
		} else {
			return error(UPDATE_FAIL_MSG);
		}
	}

删除

	@ResponseBody
	@RequestMapping(KEY_REMOVE)
	public AjaxResult remove(@RequestParam String ids) {
		int cnt = Blade.create(Notice.class).deleteByIds(ids);
		if (cnt > 0) {
			return success(DEL_SUCCESS_MSG);
		} else {
			return error(DEL_FAIL_MSG);
		}
	}

自定义sql查询,返回map

	List<Maps> list = Db.init().selectList("select * form news where title = #{title}", Maps.create().set("title", "标题测试"));

自定义sql查询,返回String

	String editor = Db.init().queryStr("select editor form news where newsId = #{newsId}", Maps.create().set("newsId", 123));

根据条件修改

	boolean temp = Blade.create(News.class).updateBy("editor = #{editor}", "title = #{title}", Maps.create().set("title", "测试标题").set("editor", "编辑一"));

根据条件删除

	String ids = "1,2,3,4,5";
	String[] idArr = ids.split(",");
	int cnt = Blade.create(News.class).deleteBy("status in #{join(#{ids})}", Maps.create().set("ids", idArr));

注:

欢迎提出更好的意见,大家共同进步
SpringBlade仅供交流学习若因为商业用途引起的纠纷和造成的一切后果请自行承担谢谢。