本次更新如下
- API跟Service彻底解耦,API的参数列表和Service参数列表完全可以不一致,不管是类型还是数量,框架会自动把API的参数值给到Service的参数中对应的字段
- 代码结构上做了调整,使源码更规范,便于阅读与维护
- 为了配合声明式API的出现,发布了Mars-cloud 3.0.2
API与Service怎么解耦的
Service中的方法,代码示例
public List<DemoEntity> selectList(InsertEntity insertEntity, Map<String,Object> param) {
return null;
}
API声明,代码示例
@MarsReference(beanName = "bean的name",refName = "selectList")
Object selectList(DemoEntity demoEntity);
前端直接请求 这个api即可,传来的参数会被自动赋值给demoEntity里的字段,框架会自动把demoEntity里的数据赋值给Service的参数