优化权限,修复controller重写父类导致注解失效的问题

This commit is contained in:
zhouhao
2017-02-24 15:18:21 +08:00
parent 47ebcbc6da
commit d2eba56010
17 changed files with 115 additions and 153 deletions

View File

@@ -35,8 +35,8 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DataSourceUtils;
import javax.sql.DataSource;

View File

@@ -13,6 +13,7 @@ import org.hswebframework.web.commons.entity.Entity;
import org.hswebframework.web.commons.entity.PagerResult;
import org.hswebframework.web.commons.entity.param.QueryParamEntity;
import org.hswebframework.web.controller.QueryController;
import org.hswebframework.web.controller.authorization.UserController;
import org.hswebframework.web.controller.message.ResponseMessage;
import org.hswebframework.web.entity.authorization.SimpleUserEntity;
import org.hswebframework.web.entity.authorization.UserEntity;
@@ -30,6 +31,7 @@ import java.util.List;
*/
@RestController
@Authorize(permission = "test")
@RequestMapping("/test")
public class TestController implements QueryController<UserEntity, String, QueryParamEntity> {
@GetMapping("/test1")
@@ -61,6 +63,9 @@ public class TestController implements QueryController<UserEntity, String, Query
return ResponseMessage.ok(entity);
}
public static void main(String[] args) throws NoSuchMethodException {
System.out.println(UserController.class.getMethod("list", Entity.class));
}
@Override
public TestService getService() {

View File

@@ -1,6 +1,7 @@
spring:
aop:
auto: true
proxy-target-class: true
datasource:
url : jdbc:h2:mem:examples
username : sa
@@ -10,7 +11,4 @@ spring:
hsweb:
app:
name: hsweb示例
version: 3.0.0
authorize:
filters:
user/**: user:*
version: 3.0.0