使用redis存储签到记录
public static final String USER_SIGN_KEY = "sign:";@Testpublic void sign() {for (Long userId : getUserIds()) {// 1.获取当前登录用户// long userId = 2L;// 2.获取日期LocalDateTime now = LocalDateTime.now().plusDays(-3);// 3.拼接keyString keySuffix = now.format(DateTimeFormatter.ofPattern(":yyyyMM"));String key = USER_SIGN_KEY + userId + keySuffix;// 4.获取今天是本月的第几天int dayOfMonth = now.getDayOfMonth();// 5. 写入Redis SETBIT key offset 1if (Boolean.FALSE.equals(stringRedisTemplate.opsForValue().getBit(key, dayOfMonth - 1))) {// 签到成果boolean signedToday = Boolean