1.编写lua脚本用于生成主键ID序列号,内容如下 local key = tostring(KEYS[1]); local count = tonumber(KEYS[2]); local dateStr = tostring(KEYS[3]); local newKey = key .. "_" .. dateStr; local numRedis = redis.call("incr", newKey); print(numRedis); if (numRed
1.使用opv.increment 达到增量的效果[判断某个用户 是第几次做这种操作] @RequestMapping("createCode") @RestController public class CreateCodeController { @Autowired StringRedisTemplate stringRedisTemplate; public static final String TEN_CODE_GLOBAL_KEY_IN_REDIS = "PIS