Crud controller 通用办法层面思考
在这篇文章之前, 我提出了一个 crud 的模板工程. 次要目标是去掉 数据库和 redis 这两层的通用代码. 在去掉这一层之后想尝试去掉 controller 类. 对这个想法进行了实现
我的项目地址: https://github.com/huifer/cru…
分支: dev
配置
依赖配置
本例为 mybatis 操作
0.0.5-Releases-hot-fix dev 开发分支版本. 后续会批改
com.github.huifer
for-controller
0.0.5-Releases-hot-fix
compile
com.github.huifer
for-mybatis
0.0.5-Releases-hot-fix
实体类配置
@CrudController(uri = "/project/int", idType = Integer.class)
public class ProjectInt extends AbsEntity implements Serializable {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@CrudController(uri = "/project/str", idType = String.class