快速开发框架 SpringBlade

码农软件 · 软件分类 · J2EE框架 · 2019-03-26 17:27:55

软件介绍

SpringBlade,是基于多个优秀的开源项目(spring+springmvc+beetl+beetlsql+shiro),高度整合封装而成的快速开发平台。

鸣谢

1.JFinal
2.eova
3.hutool
4.beetl
5.beetlsql
6.dreamlu
7.kisso
8.spring-shiro-training

内置功能

用户管理
角色管理
菜单管理
字典管理
部门管理
附件管理
参数管理
连接池监视
日志管理
代码生成

技术选型
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
* 图表控件:echarts

后台界面:

示例代码:

新增

 @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_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);
        }
    }

dao工具

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

通用service

public interface NoticeService extends IService<Notice> {

    }


    @Service
    public class NoticeServiceImpl extends BaseService<Notice> implements NoticeService {

    }


    @Autowired
    NoticeService service;

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

分页

 @ResponseBody
    @RequestMapping(KEY_LIST)
    public Object list() {
        Object grid = paginate(LIST_SOURCE, new IQuery() {

            @Override
            public void queryBefore(AopContext ac) {
                if (ShiroKit.lacksRole(ConstShiro.ADMINISTRATOR)) {
                    String condition = "and creater = #{creater}";
                    ac.setCondition(condition);
                    ac.getParam().put("creater", ShiroKit.getUser().getId());
                }
            }

            @Override
            public void queryAfter(AopContext ac) {
                @SuppressWarnings("unchecked")
                BladePage<Map<String, Object>> page = (BladePage<Map<String, Object>>) ac.getObject();
                List<Map<String, Object>> list = page.getRows();
                for (Map<String, Object> map : list) {
                    map.put("createrName", Func.getDictName(102, map.get("creater")));
                }
            }
        });

        return grid;
    }

本文地址:https://codercto.com/soft/d/2209.html

Software Design 中文版 01

Software Design 中文版 01

[日] 技术评论社 / 人民邮电出版社 / 2014-3 / 39.00

《Software Design》是日本主流的计算机技术读物,旨在帮助程序员更实时、深入地了解前沿技术,扩大视野,提升技能。内容涵盖多平台软件开发技巧、云技术应用、大数据分析、网络通信技术、深度互联时代下的移动开发、虚拟化、人工智能等最前沿实践性讲解。以人脑思维模式,激发计算机操控的无限可能;以软件开发技巧,挖掘系统与硬件的最大价值。 《Software Design 中文版 01》的主题为......一起来看看 《Software Design 中文版 01》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器