| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import org.aspectj.lang.ProceedingJoinPoint;
|
| | | import org.aspectj.lang.Signature;
|
| | | import org.aspectj.lang.annotation.Around;
|
| | |
| | | public class IntegralGetFrequencyLimitAspect {
|
| | |
|
| | | @Resource
|
| | | private JedisPool jedisPool;
|
| | | private RedisManager redisManager;
|
| | |
|
| | | private ExpressionParser parser = new SpelExpressionParser();
|
| | |
|
| | |
| | |
|
| | | String catchKey = "integral-get-frequency-" + StringUtil.Md5(generateKeyBySpEL(key, joinPoint));
|
| | |
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | Jedis jedis =redisManager.getJedis();
|
| | | try {
|
| | | if (jedis.setnx(catchKey, "1") > 0) {
|
| | | jedis.expire(catchKey, timeS);
|
| | |
| | | } finally {
|
| | | }
|
| | | } finally {
|
| | | jedisPool.returnResource(jedis);
|
| | | jedis.close();
|
| | | }
|
| | | }
|
| | | } catch (NoSuchMethodException e) {
|