소스 검색

修复未注解PathVariable导致参数未注入

zhouhao 8 년 전
부모
커밋
434d6cf69c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/QueryController.java

+ 2 - 1
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/QueryController.java

@@ -24,6 +24,7 @@ import org.hswebframework.web.logging.AccessLogger;
 import org.hswebframework.web.service.QueryByEntityService;
 import org.hswebframework.web.service.QueryService;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 
 import static org.hswebframework.web.controller.message.ResponseMessage.ok;
 
@@ -46,7 +47,7 @@ public interface QueryController<E, PK, Q extends Entity> {
     @Authorize(action = "read")
     @GetMapping(path = "/{id}")
     @AccessLogger("根据主键查询")
-    default ResponseMessage getByPrimaryKey(PK id) {
+    default ResponseMessage getByPrimaryKey(@PathVariable PK id) {
         return ok(getService().selectByPk(id));
     }