记得上下班打卡 | git大法好,push需谨慎

Commit 978adf2b authored by 胡佳晨's avatar 胡佳晨

积分明细

parent ecc202c0
......@@ -24,4 +24,7 @@ public class StoneConstant {
//限购
public static final String ITEM_LIMIT = ITEM.concat("limit:");
//锁
public static final String LOCK = ITEM.concat("lock:");
}
......@@ -282,8 +282,8 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
logs.setUid(uid);
logs.setScore(BigDecimal.valueOf(score));
logs.setCreatedAt(LocalDateTime.now());
stoneMongoUtils.logCreate(logs);
stoneRedisUtils.addLogsList(uid,logs);
stoneMongoUtils.logCreate(logs);
//mysql 入库 积分日志
queueUtils.sendMsgByRedis(MQConst.StoneQueue.STONE_INSERT_LOGS.getKey(),
SqlMapping.get("stone_score_logs.insert", logs.getLogsId(), logs.getUid(), logs.getScore(), logs.getContent(), logs.getReason(), getOverdueAt(), LocalDateTime.now())
......@@ -302,8 +302,8 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
logs.setUid(uid);
logs.setScore(BigDecimal.valueOf(score).negate());
logs.setCreatedAt(LocalDateTime.now());
stoneMongoUtils.logCreate(logs);
stoneRedisUtils.addLogsList(uid,logs);
stoneMongoUtils.logCreate(logs);
//mysql 入库 积分日志
queueUtils.sendMsgByRedis(MQConst.StoneQueue.STONE_INSERT_LOGS.getKey(),
SqlMapping.get("stone_score_logs.insert", logs.getLogsId(), logs.getUid(), logs.getScore(), logs.getContent(), logs.getReason(), getOverdueAt(), LocalDateTime.now())
......
......@@ -312,4 +312,15 @@ public class StoneRedisUtils {
return (List<StoneOrderListVo>) obj;
}
}
public boolean lockUid(String uid){
String redisKey = StoneConstant.LOCK.concat(uid);
return redisUtil.lock(uid,1,1);
}
public void unLockUid(String uid){
String redisKey = StoneConstant.LOCK.concat(uid);
redisUtil.uLock(redisKey);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment