Skip to content

Commit

Permalink
新增全能增删改查接口,可同时进行 增、删、改、查 多种操作,感谢 cloudAndMonkey 贡献 CRUD 功能
Browse files Browse the repository at this point in the history
通过 @method: "POST", @gets: { "Privacy":"Privacy-CIRCLE", "User": { "@ROLE":"LOGIN", "tag":"User" } } 等关键词指定。具体文档见:
Tencent/APIJSON#468
  • Loading branch information
TommyLemon committed Sep 2, 2023
1 parent 65f4d5b commit c503a2c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ public String router(@PathVariable String method, @PathVariable String tag, @Req

// 通用接口,非事务型操作 和 简单事务型操作 都可通过这些接口自动化实现 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

/**全能增删改查接口,可同时进行 增、删、改、查 多种操作,
* 通过 @method: "POST", @gets: { "Privacy":"Privacy-CIRCLE", "User": { "@role":"LOGIN", "tag":"User" } } 等关键词指定
* @param request
* @param session
* @return
*/
@PostMapping(value = "crud") // 直接 {method} 或 apijson/{method} 会和内置网页的路由有冲突
// @Override
public String crudAll(@RequestBody String request, HttpSession session) {
return newParser(session, RequestMethod.CRUD).parse(request);
}
/**增删改查统一入口,这个一个方法可替代以下 7 个方法,牺牲一点路由解析性能来提升一些开发效率
* @param method
* @param request
Expand Down

0 comments on commit c503a2c

Please sign in to comment.