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

Commit 41e888d5 authored by jiangxiulong's avatar jiangxiulong

cityVote 数据迁移

parent c7a0c95c
......@@ -93,6 +93,13 @@ public class RedisDataController {
return ResponseDto.success(result);
}
@PostMapping("sweet/cityVote")
@ApiOperation("sweet-cityVote数据迁移")
public ResponseDto<Boolean> cityVote() {
Boolean result = redisDataService.cityVote();
return ResponseDto.success(result);
}
/*kylin:order:ExpressStatus:id:138291855523471362201224 // 无数据暂时 一条是测试
// 下面会自动降级mongo
kylin:order:refund:orderId:1000651
......
......@@ -213,4 +213,31 @@ public class RedisDataServiceImpl {
return false;
}
}
public Boolean cityVote() {
try {
// RedisTemplate<String, Object> redis = redisUtil.getRedisTemplateByDb(15);
Jedis redis = getRedis();
String redisKey = "sweet:cityVote3:cityCode*";
Set<String> keys = redis.keys(redisKey);
for (String key : keys) {
String value = redis.get(key);
redisUtil.set(key, value);
}
String redisKey2 = "sweet:cityVote3:user*";
Set<String> keys2 = redis.keys(redisKey2);
for (String key : keys2) {
String value = redis.get(key);
redisUtil.set(key, value);
}
return true;
} catch (Exception e) {
log.error("sweetUnionIdStrError", e);
return false;
}
}
}
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