feat(game): 增加按时间查询游戏投注记录功能

- 新增 GameBettingDetailsDTO 类,用于游戏投注详情查询
- 在 GameBettingDetailsMapper 中添加按时间查询的 SQL 语句
- 修改 GameBettingDetailsServiceImpl 中的查询方法,支持按时间查询
- 更新相关控制器和接口,增加按时间查询游戏记录的功能
main-cf
shi 2025-03-24 14:30:14 +08:00
parent d59232a9cc
commit 34f6ad895a
1 changed files with 0 additions and 71 deletions

View File

@ -1,71 +0,0 @@
package com.ff.base.core.redis;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
/**
* redis
*
* @author shi
* @date 2025/03/18
*/
@Component
public class RedisCacheLock {
@Resource
private RedissonClient redissonClient;
/**
* Redis
*
* @param key Redis
* @return `RLock`
*
* `RLock` Redisson 线线
*/
public RLock getLock(String key) {
return redissonClient.getLock(key);
}
/**
*
*
* @param key Redis
* @param waitTime `false`
* @param leaseTime `leaseTime`
* @return `true` `false`
*
* 线`tryLock` 线
* 线线 `waitTime` `false`
*/
public boolean tryLock(String key, long waitTime, long leaseTime) {
RLock lock = redissonClient.getLock(key);
try {
return lock.tryLock(waitTime, leaseTime, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // 恢复线程中断状态
return false;
}
}
/**
*
*
* @param key Redis
*
* 线 `RLock` `isHeldByCurrentThread()` `true`
* 线
*/
public void unlock(String key) {
RLock lock = redissonClient.getLock(key);
if (lock.isHeldByCurrentThread()) {
lock.unlock(); // 释放锁
}
}
}