com.fhs.demo.action.TestAop Maven / Gradle / Ivy
The newest version!
package com.fhs.demo.action;
import com.fhs.core.permission.ParamVaild;
import com.fhs.core.result.HttpResult;
import com.fhs.demo.bean.TestAopBean;
import com.fhs.redis.service.RedisCacheService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/testaop")
public class TestAop {
@Autowired
private RedisCacheService redisCacheService;
@RequestMapping(value = "/t", method = {RequestMethod.POST})
@ResponseBody
public HttpResult testAop(@RequestBody @ParamVaild TestAopBean testAop){
HttpResult httpResult = new HttpResult();
httpResult.setCode (200);
httpResult.setMessage ("ok!");
httpResult.setResult (true);
httpResult.setData (testAop);
return httpResult;
}
@RequestMapping(value = "/goIndexJsp", method = {RequestMethod.GET})
public String goIndexJsp(){
redisCacheService.addStr ( "sssss", "helloworld" );
System.out.println(SecurityUtils.getSubject().isPermitted("frontMembershipCard:add"));
return "index";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy