|
|
@@ -384,7 +384,7 @@ public class CollectionService {
|
|
|
public synchronized Long increaseSale(Long id, int number) {
|
|
|
BoundValueOperations<String, Object> ops = redisTemplate.boundValueOps(RedisKeys.COLLECTION_SALE + id);
|
|
|
if (ops.get() == null) {
|
|
|
- Boolean success = ops.setIfAbsent(Optional.ofNullable(collectionRepo.getStock(id))
|
|
|
+ Boolean success = ops.setIfAbsent(Optional.ofNullable(collectionRepo.getSale(id))
|
|
|
.orElse(0), 7, TimeUnit.DAYS);
|
|
|
log.info("创建redis销量:{}", success);
|
|
|
}
|
|
|
@@ -394,7 +394,7 @@ public class CollectionService {
|
|
|
}
|
|
|
|
|
|
public synchronized Long decreaseSale(Long id, int number) {
|
|
|
- return increaseStock(id, -number);
|
|
|
+ return increaseSale(id, -number);
|
|
|
}
|
|
|
|
|
|
@Debounce(key = "#id", delay = 500)
|