1 Star 0 Fork 43

caocf / durcframework-core

forked from tanghc / durcframework-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

欢迎使用durcframework-core

日常更新

项目介绍

durcframework-core

  • durcframework-core是一个基于SpringMVC + Mybatis的框架。其设计目的在于提高开发效率,避免做重复的工作。尤其是在做管理后台时,能减少许多代码量。

框架用到的技术点

  1. 采用泛型设计,对数据库的增删改查做了适度的封装。只需少量代码就能完成一个模块的CRUD操作。
  2. 使用注解来生成查询条件,mybatis文件不需要额外配置,减少了mybatis的代码量。
  3. 使用Java代码动态生成查询条件,可以根据不同场景,不同业务来组装查询条件。
  4. 可以配合前台做Ajax开发,传输JSON格式数据,也可以使用传统SpringMVC到jsp页面。
  5. 后台自动验证功能,支持JSR-303。

使用本框架可以完成的事:

  1. 少量代码完成对一张表的增删改查。
  2. 数据导出
  3. 数据校验

使用本框架完成的项目:

框架对应demo


简单列子

Controller完成对学生表的增删改查

controller类

// 继承CrudController,表示该Controller具有增删改查功能
@Controller
public class StudentCrudController extends CrudController<Student, StudentService> {
	
	// 模拟表单提交
	// http://localhost/durcframeworkTest/addStudent.do?name=Lucy&stuNo=No00001971&address=USA&mobile=13345678951&birthday=1987-07-06
	@RequestMapping("/addStudent.do")
	public @ResponseBody MessageResult addStudent(Student student) {
		this.save(student);
		System.out.println("添加后的主键ID:"+ student.getId());
		return success();
	}
	
	// http://localhost/durcframeworkTest/listStudent.do
	@RequestMapping("/listStudent.do")
	public @ResponseBody GridResult listStudent(SearchStudentEntity searchStudentEntity) {
		return this.query(searchStudentEntity);
	}
	
	// 模拟表单提交,修改姓名为Lily
	// http://localhost/durcframeworkTest/updateStudent.do?id=39&name=Lily&stuNo=36251111
	@RequestMapping("/updateStudent.do")
	public @ResponseBody MessageResult updateStudent(Student student) {
		return this.update(student);
	}
	
	// 传一个id值即可,根据主键删除
	// http://localhost/durcframeworkTest/delStudent.do?id=39
	@RequestMapping("/delStudent.do")
	public @ResponseBody MessageResult delStudent(Student student) {
		// 通过主键查询某一条记录
		System.out.println(this.getService().get(student.getId()));
		return this.delete(student);
	}
	
	
}

Service类

// 只需简单继承无需其它代码
@Service
public class StudentService extends CrudService<Student, StudentDao> {}

Dao层


// 只需简单继承无需其它代码
public interface StudentDao extends BaseDao<Student> {}

空文件

简介

基于SpringMVC,一个可以提高开发效率,避免做重复工作的框架 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/henryccf/durcframework-core.git
git@gitee.com:henryccf/durcframework-core.git
henryccf
durcframework-core
durcframework-core
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891