@author Exrickx
| 19 | * @author Exrickx |
| 20 | */ |
| 21 | @Controller |
| 22 | public class PageController { |
| 23 | |
| 24 | private static final Logger log= LoggerFactory.getLogger(PageController.class); |
| 25 | |
| 26 | @Autowired |
| 27 | private PayService payService; |
| 28 | |
| 29 | @Autowired |
| 30 | private StringRedisTemplate redisTemplate; |
| 31 | |
| 32 | @RequestMapping("/") |
| 33 | public String index(){ |
| 34 | |
| 35 | return "index"; |
| 36 | } |
| 37 | |
| 38 | @RequestMapping("/{page}") |
| 39 | public String showPage(@PathVariable String page, |
| 40 | HttpServletRequest request){ |
| 41 | |
| 42 | String id = request.getParameter("id"); |
| 43 | if("openAlipay".equals(page)&&StringUtils.isNotBlank(id)){ |
| 44 | // 已扫码状态 |
| 45 | try{ |
| 46 | payService.changePayState(id,4); |
| 47 | Set<String> keys = redisTemplate.keys("xpay:*"); |
| 48 | redisTemplate.delete(keys); |
| 49 | }catch (Exception e){ |
| 50 | |
| 51 | } |
| 52 | } |
| 53 | return page; |
| 54 | } |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected