代码拉取完成,页面将自动刷新
67
修正现有swagger实现中忽略ActionKey注解的问题、增加了路径变量功能
已合并
(1)swagger实现中如果有ActionKey注解的URL路径,则应使用该路径而不是方法名
(2)增加了路径变量功能
使用方法
在配置类中的使用PathVariableActionHandler和PathVariableActionMapping
@Override
public void onConstantConfig(Constants constants) {
constants.setActionMapping(PathVariableActionMapping::new);
}
@Override
public void onHandlerConfig(JfinalHandlers handlers) {
handlers.setActionHandler(new PathVariableActionHandler());
}
在action上使用ActionKey注解,URL中使用{变量},如
@ActionKey("/foo/{id}")
public void foo(){
String id = getPara("id"); // 或 Integer id = getParaToInt("id");
...
}
@ActionKey("/foo/{id}/bar/{name}")
public void bar(){
String id = getPara("id"); // 或 Integer id = getParaToInt("id");
String name = getPara("name");
...
}