refactor(exception): 新增自定义异常类并重构异常处理

- 新增 ApiException 类用于处理 API相关的异常
- 新增 BaseException 类作为基础异常类- 重构 CurrencyMapper 接口,调整包结构
- 新增 CurrencyServiceImpl 类实现币种相关服务
- 更新原有的 CurrencyServiceImpl 类,调整导入顺序
main-pp
liaoyong 2025-04-12 13:15:53 +08:00
parent e566053cb7
commit 4894bd7784
106 changed files with 5146 additions and 415 deletions

View File

@ -16,6 +16,10 @@
<dependencies>
<dependency>
<groupId>com.ff</groupId>
<artifactId>ff-util</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@ -51,7 +55,11 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,8 +1,9 @@
package com.ff.agent.mapper;
import com.ff.agent.domain.TenantAgentCommission;
import java.math.BigDecimal;
import java.util.List;
import com.ff.agent.domain.TenantAgentCommission;
/**
* Mapper

View File

@ -1,8 +1,9 @@
package com.ff.agent.mapper;
import java.util.List;
import com.ff.agent.domain.TenantAgentInvite;
import java.util.List;
/**
* Mapper
*

View File

@ -1,8 +1,9 @@
package com.ff.agent.mapper;
import java.util.List;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import java.util.List;
/**
* Mapper
*

View File

@ -0,0 +1,62 @@
package com.ff.agent.mapper;
import com.ff.agent.domain.TenantAgentInviteRegister;
import java.util.List;
/**
* Mapper
*
* @author shi
* @date 2025-02-25
*/
public interface TenantAgentInviteRegisterMapper {
/**
*
*
* @param id
* @return
*/
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentInviteRegisterById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
}

View File

@ -1,8 +1,9 @@
package com.ff.agent.mapper;
import java.util.List;
import com.ff.agent.domain.TenantAgentWithdrawal;
import java.util.List;
/**
* Mapper
*

View File

@ -0,0 +1,71 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentCommission;
import java.math.BigDecimal;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-26
*/
public interface ITenantAgentCommissionService {
/**
*
*
* @param id
* @return
*/
TenantAgentCommission selectTenantAgentCommissionById(Long id);
/**
*
*
* @param tenantAgentCommission
* @return
*/
List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission);
/**
*
*
* @param tenantAgentCommission
* @return {@link BigDecimal }
*/
BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission);
/**
*
*
* @param tenantAgentCommission
* @return
*/
int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
/**
*
*
* @param tenantAgentCommission
* @return
*/
int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentCommissionByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentCommissionById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-27
*/
public interface ITenantAgentInvitePlatformService {
/**
*
*
* @param id
* @return
*/
TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id);
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform);
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentInvitePlatformByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentInvitePlatformById(Long id);
}

View File

@ -0,0 +1,62 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentInviteRegister;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-25
*/
public interface ITenantAgentInviteRegisterService {
/**
*
*
* @param id
* @return
*/
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentInviteRegisterById(Long id);
}

View File

@ -0,0 +1,70 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentInvite;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-25
*/
public interface ITenantAgentInviteService {
/**
*
*
* @param id
* @return
*/
TenantAgentInvite selectTenantAgentInviteById(Long id);
/**
*
*
* @param inviteCode
* @return {@link TenantAgentInvite }
*/
TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode);
/**
*
*
* @param tenantAgentInvite
* @return
*/
List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite);
/**
*
*
* @param tenantAgentInvite
* @return
*/
int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
/**
*
*
* @param tenantAgentInvite
* @return
*/
int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentInviteByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentInviteById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentWithdrawal;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-26
*/
public interface ITenantAgentWithdrawalService {
/**
*
*
* @param id
* @return
*/
TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id);
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal);
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentWithdrawalByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentWithdrawalById(Long id);
}

View File

@ -0,0 +1,111 @@
package com.ff.agent.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentCommission;
import com.ff.agent.mapper.TenantAgentCommissionMapper;
import com.ff.agent.service.ITenantAgentCommissionService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-26
*/
@Service
public class TenantAgentCommissionServiceImpl implements ITenantAgentCommissionService
{
@Autowired
private TenantAgentCommissionMapper tenantAgentCommissionMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentCommission selectTenantAgentCommissionById(Long id)
{
return tenantAgentCommissionMapper.selectTenantAgentCommissionById(id);
}
/**
*
*
* @param tenantAgentCommission
* @return
*/
@Override
public List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission)
{
return tenantAgentCommissionMapper.selectTenantAgentCommissionList(tenantAgentCommission);
}
/**
*
*
* @param tenantAgentCommission
* @return {@link BigDecimal }
*/
@Override
public BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission) {
return tenantAgentCommissionMapper.getAgentCommissionSum(tenantAgentCommission);
}
/**
*
*
* @param tenantAgentCommission
* @return
*/
@Override
public int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
{
tenantAgentCommission.setCreateTime(DateUtils.getNowDate());
tenantAgentCommission.setId(IdUtil.getSnowflakeNextId());
return tenantAgentCommissionMapper.insertTenantAgentCommission(tenantAgentCommission);
}
/**
*
*
* @param tenantAgentCommission
* @return
*/
@Override
public int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
{
tenantAgentCommission.setUpdateTime(DateUtils.getNowDate());
return tenantAgentCommissionMapper.updateTenantAgentCommission(tenantAgentCommission);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentCommissionByIds(Long[] ids)
{
return tenantAgentCommissionMapper.deleteTenantAgentCommissionByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentCommissionById(Long id)
{
return tenantAgentCommissionMapper.deleteTenantAgentCommissionById(id);
}
}

View File

@ -0,0 +1,100 @@
package com.ff.agent.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
import com.ff.agent.service.ITenantAgentInvitePlatformService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-27
*/
@Service
public class TenantAgentInvitePlatformServiceImpl implements ITenantAgentInvitePlatformService
{
@Autowired
private TenantAgentInvitePlatformMapper tenantAgentInvitePlatformMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id)
{
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformById(id);
}
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
@Override
public List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform)
{
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformList(tenantAgentInvitePlatform);
}
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
@Override
public int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
{
tenantAgentInvitePlatform.setId(IdUtil.getSnowflakeNextId());
tenantAgentInvitePlatform.setCreateTime(DateUtils.getNowDate());
return tenantAgentInvitePlatformMapper.insertTenantAgentInvitePlatform(tenantAgentInvitePlatform);
}
/**
*
*
* @param tenantAgentInvitePlatform
* @return
*/
@Override
public int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
{
tenantAgentInvitePlatform.setUpdateTime(DateUtils.getNowDate());
return tenantAgentInvitePlatformMapper.updateTenantAgentInvitePlatform(tenantAgentInvitePlatform);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentInvitePlatformByIds(Long[] ids)
{
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentInvitePlatformById(Long id)
{
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.ff.agent.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInviteRegister;
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
import com.ff.agent.service.ITenantAgentInviteRegisterService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-25
*/
@Service
public class TenantAgentInviteRegisterServiceImpl implements ITenantAgentInviteRegisterService {
@Autowired
private TenantAgentInviteRegisterMapper tenantAgentInviteRegisterMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id) {
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterById(id);
}
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
@Override
public List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister) {
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterList(tenantAgentInviteRegister);
}
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
@Override
public int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister) {
tenantAgentInviteRegister.setId(IdUtil.getSnowflakeNextId());
tenantAgentInviteRegister.setCreateTime(DateUtils.getNowDate());
return tenantAgentInviteRegisterMapper.insertTenantAgentInviteRegister(tenantAgentInviteRegister);
}
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
@Override
public int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister) {
tenantAgentInviteRegister.setUpdateTime(DateUtils.getNowDate());
return tenantAgentInviteRegisterMapper.updateTenantAgentInviteRegister(tenantAgentInviteRegister);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentInviteRegisterByIds(Long[] ids) {
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentInviteRegisterById(Long id) {
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterById(id);
}
}

View File

@ -0,0 +1,103 @@
package com.ff.agent.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInvite;
import com.ff.agent.mapper.TenantAgentInviteMapper;
import com.ff.agent.service.ITenantAgentInviteService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-25
*/
@Service
public class TenantAgentInviteServiceImpl implements ITenantAgentInviteService {
@Autowired
private TenantAgentInviteMapper tenantAgentInviteMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentInvite selectTenantAgentInviteById(Long id) {
return tenantAgentInviteMapper.selectTenantAgentInviteById(id);
}
/**
*
*
* @param inviteCode
* @return {@link TenantAgentInvite }
*/
@Override
public TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode) {
return tenantAgentInviteMapper.selectTenantAgentInviteByInviteCode(inviteCode);
}
/**
*
*
* @param tenantAgentInvite
* @return
*/
@Override
public List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite) {
return tenantAgentInviteMapper.selectTenantAgentInviteList(tenantAgentInvite);
}
/**
*
*
* @param tenantAgentInvite
* @return
*/
@Override
public int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite) {
tenantAgentInvite.setId(IdUtil.getSnowflakeNextId());
tenantAgentInvite.setCreateTime(DateUtils.getNowDate());
return tenantAgentInviteMapper.insertTenantAgentInvite(tenantAgentInvite);
}
/**
*
*
* @param tenantAgentInvite
* @return
*/
@Override
public int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite) {
tenantAgentInvite.setUpdateTime(DateUtils.getNowDate());
return tenantAgentInviteMapper.updateTenantAgentInvite(tenantAgentInvite);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentInviteByIds(Long[] ids) {
return tenantAgentInviteMapper.deleteTenantAgentInviteByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentInviteById(Long id) {
return tenantAgentInviteMapper.deleteTenantAgentInviteById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.ff.agent.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentWithdrawal;
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
import com.ff.agent.service.ITenantAgentWithdrawalService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-26
*/
@Service
public class TenantAgentWithdrawalServiceImpl implements ITenantAgentWithdrawalService {
@Autowired
private TenantAgentWithdrawalMapper tenantAgentWithdrawalMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id) {
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalById(id);
}
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
@Override
public List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal) {
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalList(tenantAgentWithdrawal);
}
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
@Override
public int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal) {
tenantAgentWithdrawal.setId(IdUtil.getSnowflakeNextId());
tenantAgentWithdrawal.setCreateTime(DateUtils.getNowDate());
return tenantAgentWithdrawalMapper.insertTenantAgentWithdrawal(tenantAgentWithdrawal);
}
/**
*
*
* @param tenantAgentWithdrawal
* @return
*/
@Override
public int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal) {
tenantAgentWithdrawal.setUpdateTime(DateUtils.getNowDate());
return tenantAgentWithdrawalMapper.updateTenantAgentWithdrawal(tenantAgentWithdrawal);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentWithdrawalByIds(Long[] ids) {
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentWithdrawalById(Long id) {
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalById(id);
}
}

View File

@ -1,8 +1,9 @@
package com.ff.common.mapper;
import java.util.List;
import com.ff.common.domain.Currency;
import java.util.List;
/**
* Mapper
*

View File

@ -1,8 +1,9 @@
package com.ff.common.mapper;
import java.util.List;
import com.ff.common.domain.Lang;
import java.util.List;
/**
* Mapper
*

View File

@ -0,0 +1,62 @@
package com.ff.common.service;
import com.ff.common.domain.Currency;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface ICurrencyService
{
/**
*
*
* @param id
* @return
*/
Currency selectCurrencyById(Long id);
/**
*
*
* @param currency
* @return
*/
List<Currency> selectCurrencyList(Currency currency);
/**
*
*
* @param currency
* @return
*/
int insertCurrency(Currency currency);
/**
*
*
* @param currency
* @return
*/
int updateCurrency(Currency currency);
/**
*
*
* @param ids
* @return
*/
int deleteCurrencyByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteCurrencyById(Long id);
}

View File

@ -0,0 +1,62 @@
package com.ff.common.service;
import com.ff.common.domain.Lang;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface ILangService
{
/**
*
*
* @param id
* @return
*/
Lang selectLangById(Long id);
/**
*
*
* @param lang
* @return
*/
List<Lang> selectLangList(Lang lang);
/**
*
*
* @param lang
* @return
*/
int insertLang(Lang lang);
/**
*
*
* @param lang
* @return
*/
int updateLang(Lang lang);
/**
*
*
* @param ids
* @return
*/
int deleteLangByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteLangById(Long id);
}

View File

@ -0,0 +1,99 @@
package com.ff.common.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.Currency;
import com.ff.common.mapper.CurrencyMapper;
import com.ff.common.service.ICurrencyService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class CurrencyServiceImpl implements ICurrencyService
{
@Autowired
private CurrencyMapper currencyMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Currency selectCurrencyById(Long id)
{
return currencyMapper.selectCurrencyById(id);
}
/**
*
*
* @param currency
* @return
*/
@Override
public List<Currency> selectCurrencyList(Currency currency)
{
return currencyMapper.selectCurrencyList(currency);
}
/**
*
*
* @param currency
* @return
*/
@Override
public int insertCurrency(Currency currency)
{
currency.setId(IdUtil.getSnowflakeNextId());
currency.setCreateTime(DateUtils.getNowDate());
return currencyMapper.insertCurrency(currency);
}
/**
*
*
* @param currency
* @return
*/
@Override
public int updateCurrency(Currency currency)
{
currency.setUpdateTime(DateUtils.getNowDate());
return currencyMapper.updateCurrency(currency);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteCurrencyByIds(Long[] ids)
{
return currencyMapper.deleteCurrencyByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteCurrencyById(Long id)
{
return currencyMapper.deleteCurrencyById(id);
}
}

View File

@ -0,0 +1,92 @@
package com.ff.common.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.Lang;
import com.ff.common.mapper.LangMapper;
import com.ff.common.service.ILangService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class LangServiceImpl implements ILangService {
@Autowired
private LangMapper langMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Lang selectLangById(Long id) {
return langMapper.selectLangById(id);
}
/**
*
*
* @param lang
* @return
*/
@Override
public List<Lang> selectLangList(Lang lang) {
return langMapper.selectLangList(lang);
}
/**
*
*
* @param lang
* @return
*/
@Override
public int insertLang(Lang lang) {
lang.setId(IdUtil.getSnowflakeNextId());
lang.setCreateTime(DateUtils.getNowDate());
return langMapper.insertLang(lang);
}
/**
*
*
* @param lang
* @return
*/
@Override
public int updateLang(Lang lang) {
lang.setUpdateTime(DateUtils.getNowDate());
return langMapper.updateLang(lang);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteLangByIds(Long[] ids) {
return langMapper.deleteLangByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteLangById(Long id) {
return langMapper.deleteLangById(id);
}
}

View File

@ -1,26 +1,24 @@
package com.ff.game.mapper;
import java.util.List;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.dto.GameBettingDetailsDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import java.util.List;
/**
* Mapper
*
*
* @author shi
* @date 2025-02-10
*/
public interface GameBettingDetailsMapper
{
public interface GameBettingDetailsMapper {
/**
*
*
*
* @param id
* @return
*/
GameBettingDetails selectGameBettingDetailsById(Long id);
GameBettingDetails selectGameBettingDetailsById(Long id);
/**
@ -30,48 +28,40 @@ public interface GameBettingDetailsMapper
* @param platformCode
* @return {@link List }<{@link Long }>
*/
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds, @Param("platformCode") String platformCode);
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds, @Param("platformCode") String platformCode);
/**
*
*
* @param gameBettingDetailsDTO
* @return
*/
List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetailsDTO gameBettingDetailsDTO);
/**
*
*
*
* @param gameBettingDetails
* @return
*/
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
/**
*
*
*
* @param gameBettingDetails
* @return
*/
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
/**
*
*
*
* @param id
* @return
*/
int deleteGameBettingDetailsById(Long id);
int deleteGameBettingDetailsById(Long id);
/**
*
*
*
* @param ids
* @return
*/
int deleteGameBettingDetailsByIds(Long[] ids);
int deleteGameBettingDetailsByIds(Long[] ids);
/**
*

View File

@ -1,70 +1,62 @@
package com.ff.game.mapper;
import java.util.List;
import com.ff.game.domain.GameExchangeMoney;
import com.ff.game.dto.GameExchangeMoneyDTO;
import java.util.List;
/**
* Mapper
*
*
* @author shi
* @date 2025-02-10
*/
public interface GameExchangeMoneyMapper
{
public interface GameExchangeMoneyMapper {
/**
*
*
*
* @param id
* @return
*/
GameExchangeMoney selectGameExchangeMoneyById(Long id);
GameExchangeMoney selectGameExchangeMoneyById(Long id);
/**
*
*
*
* @param gameExchangeMoney
* @return
*/
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
/**
*
*
* @param gameExchangeMoneyDTO dto
* @return {@link List }<{@link GameExchangeMoneyDTO }>
*/
List<GameExchangeMoneyDTO> selectGameExchangeMoneyDTOList(GameExchangeMoneyDTO gameExchangeMoneyDTO);
/**
*
*
*
* @param gameExchangeMoney
* @return
*/
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
/**
*
*
*
* @param gameExchangeMoney
* @return
*/
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
/**
*
*
*
* @param id
* @return
*/
int deleteGameExchangeMoneyById(Long id);
int deleteGameExchangeMoneyById(Long id);
/**
*
*
*
* @param ids
* @return
*/
int deleteGameExchangeMoneyByIds(Long[] ids);
int deleteGameExchangeMoneyByIds(Long[] ids);
}

View File

@ -1,8 +1,9 @@
package com.ff.game.mapper;
import java.util.List;
import com.ff.game.domain.GameFreeRecord;
import java.util.List;
/**
* Mapper
*

View File

@ -1,9 +1,6 @@
package com.ff.game.mapper;
import com.ff.api.response.GameResponse;
import com.ff.game.api.request.GameUniqueDTO;
import com.ff.game.domain.Game;
import com.ff.game.dto.GameDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -82,28 +79,5 @@ public interface GameMapper {
*/
Integer selectMaxSortNoBy(@Param("platformType") Integer platformType, @Param("platformCode") String platformCode);
/**
*
*
* @param gameUniqueDTO dto
* @return {@link List }<{@link Game }>
*/
List<Game> selectGameUniqueList(GameUniqueDTO gameUniqueDTO);
/**
*
*
* @return {@link List }<{@link GameResponse }>
*/
List<GameResponse> selectGameResponseList();
/**
*
*
* @param gameDTO dto
* @return {@link List }<{@link Game }>
*/
List<Game> selectGameDTOList(GameDTO gameDTO);
}

View File

@ -9,7 +9,6 @@ import java.util.List;
*/
public interface PlatformMapper {
List<Platform> selectList(Platform platform);
Platform selectByPlatformCode(String platformCode);

View File

@ -0,0 +1,79 @@
package com.ff.game.service;
import com.ff.game.domain.GameBettingDetails;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface IGameBettingDetailsService {
/**
*
*
* @param id
* @return
*/
GameBettingDetails selectGameBettingDetailsById(Long id);
/**
* id
*
* @param wagersIds ID
* @return {@link List }<{@link Long }>
*/
List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds, String platformCode);
/**
*
*
* @param gameBettingDetails
* @return
*/
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
/**
*
*
* @param bettingDetails
* @return int
*/
int batchInsert(List<GameBettingDetails> bettingDetails);
/**
*
*
* @param gameBettingDetails
* @return
*/
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
/**
*
*
* @param ids
* @return
*/
int deleteGameBettingDetailsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteGameBettingDetailsById(Long id);
/**
* id
*
* @param wagersId id
* @return int
*/
int deleteGameBettingDetailsByWagersId(List<String> wagersId);
}

View File

@ -0,0 +1,61 @@
package com.ff.game.service;
import com.ff.game.domain.GameExchangeMoney;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface IGameExchangeMoneyService {
/**
*
*
* @param id
* @return
*/
GameExchangeMoney selectGameExchangeMoneyById(Long id);
/**
*
*
* @param gameExchangeMoney
* @return
*/
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
/**
*
*
* @param gameExchangeMoney
* @return
*/
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
/**
*
*
* @param gameExchangeMoney
* @return
*/
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
/**
*
*
* @param ids
* @return
*/
int deleteGameExchangeMoneyByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteGameExchangeMoneyById(Long id);
}

View File

@ -0,0 +1,62 @@
package com.ff.game.service;
import com.ff.game.domain.GameFreeRecord;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface IGameFreeRecordService
{
/**
*
*
* @param id
* @return
*/
GameFreeRecord selectGameFreeRecordById(Long id);
/**
*
*
* @param gameFreeRecord
* @return
*/
List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord);
/**
*
*
* @param gameFreeRecord
* @return
*/
int insertGameFreeRecord(GameFreeRecord gameFreeRecord);
/**
*
*
* @param gameFreeRecord
* @return
*/
int updateGameFreeRecord(GameFreeRecord gameFreeRecord);
/**
*
*
* @param ids
* @return
*/
int deleteGameFreeRecordByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteGameFreeRecordById(Long id);
}

View File

@ -0,0 +1,80 @@
package com.ff.game.service;
import com.ff.game.domain.Game;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface IGameService {
/**
*
*
* @param id
* @return
*/
Game selectGameById(Long id);
/**
* id
*
* @param gameId id
* @return {@link Game }
*/
Game selectGameByGameId(String gameId);
/**
*
*
* @param game
* @return
*/
List<Game> selectGameList(Game game);
/**
*
*
* @param game
* @return
*/
int insertGame(Game game);
/**
*
*
* @param game
* @return
*/
int updateGame(Game game);
/**
*
*
* @param ids
* @return
*/
int deleteGameByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteGameById(Long id);
/**
* id
*
* @return {@link Integer }
*/
Integer selectMaxSortNo(Integer platformType, String platformCode);
}

View File

@ -0,0 +1,24 @@
package com.ff.game.service;
import com.ff.game.domain.Platform;
import java.util.List;
/**
* @author cengy
*/
public interface IPlatformService {
List<Platform> selectList(Platform platform);
Platform selectByPlatformCode(String platformCode);
int updatePlatform(Platform platform);
int insertPlatform(Platform platform);
int deleteById(Long id);
int deleteByIds(String ids);
}

View File

@ -0,0 +1,114 @@
package com.ff.game.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.mapper.GameBettingDetailsMapper;
import com.ff.game.service.IGameBettingDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService {
@Autowired
private GameBettingDetailsMapper gameBettingDetailsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public GameBettingDetails selectGameBettingDetailsById(Long id) {
return gameBettingDetailsMapper.selectGameBettingDetailsById(id);
}
/**
* id
*
* @param wagersIds ID
* @return {@link List }<{@link Long }>
*/
@Override
public List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds, String platformCode) {
return gameBettingDetailsMapper.selectGameBettingDetailsByWagersId(wagersIds, platformCode);
}
/**
*
*
* @param gameBettingDetails
* @return
*/
@Override
public int insertGameBettingDetails(GameBettingDetails gameBettingDetails) {
gameBettingDetails.setId(IdUtil.getSnowflakeNextId());
gameBettingDetails.setCreateTime(System.currentTimeMillis());
return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
}
/**
*
*
* @param bettingDetails
* @return int
*/
@Override
public int batchInsert(List<GameBettingDetails> bettingDetails) {
return gameBettingDetailsMapper.batchInsert(bettingDetails);
}
/**
*
*
* @param gameBettingDetails
* @return
*/
@Override
public int updateGameBettingDetails(GameBettingDetails gameBettingDetails) {
gameBettingDetails.setUpdateTime(System.currentTimeMillis());
return gameBettingDetailsMapper.updateGameBettingDetails(gameBettingDetails);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteGameBettingDetailsByIds(Long[] ids) {
return gameBettingDetailsMapper.deleteGameBettingDetailsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteGameBettingDetailsById(Long id) {
return gameBettingDetailsMapper.deleteGameBettingDetailsById(id);
}
/**
* id
*
* @param wagersId id
* @return int
*/
@Override
public int deleteGameBettingDetailsByWagersId(List<String> wagersId) {
return gameBettingDetailsMapper.deleteGameBettingDetailsByWagersId(wagersId);
}
}

View File

@ -0,0 +1,92 @@
package com.ff.game.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.game.domain.GameExchangeMoney;
import com.ff.game.mapper.GameExchangeMoneyMapper;
import com.ff.game.service.IGameExchangeMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class GameExchangeMoneyServiceImpl implements IGameExchangeMoneyService {
@Autowired
private GameExchangeMoneyMapper gameExchangeMoneyMapper;
/**
*
*
* @param id
* @return
*/
@Override
public GameExchangeMoney selectGameExchangeMoneyById(Long id) {
return gameExchangeMoneyMapper.selectGameExchangeMoneyById(id);
}
/**
*
*
* @param gameExchangeMoney
* @return
*/
@Override
public List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney) {
return gameExchangeMoneyMapper.selectGameExchangeMoneyList(gameExchangeMoney);
}
/**
*
*
* @param gameExchangeMoney
* @return
*/
@Override
public int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney) {
gameExchangeMoney.setId(IdUtil.getSnowflakeNextId());
gameExchangeMoney.setCreateTime(System.currentTimeMillis());
return gameExchangeMoneyMapper.insertGameExchangeMoney(gameExchangeMoney);
}
/**
*
*
* @param gameExchangeMoney
* @return
*/
@Override
public int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney) {
gameExchangeMoney.setUpdateTime(System.currentTimeMillis());
return gameExchangeMoneyMapper.updateGameExchangeMoney(gameExchangeMoney);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteGameExchangeMoneyByIds(Long[] ids) {
return gameExchangeMoneyMapper.deleteGameExchangeMoneyByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteGameExchangeMoneyById(Long id) {
return gameExchangeMoneyMapper.deleteGameExchangeMoneyById(id);
}
}

View File

@ -0,0 +1,91 @@
package com.ff.game.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.game.domain.GameFreeRecord;
import com.ff.game.mapper.GameFreeRecordMapper;
import com.ff.game.service.IGameFreeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class GameFreeRecordServiceImpl implements IGameFreeRecordService {
@Autowired
private GameFreeRecordMapper gameFreeRecordMapper;
/**
*
*
* @param id
* @return
*/
@Override
public GameFreeRecord selectGameFreeRecordById(Long id) {
return gameFreeRecordMapper.selectGameFreeRecordById(id);
}
/**
*
*
* @param gameFreeRecord
* @return
*/
@Override
public List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord) {
return gameFreeRecordMapper.selectGameFreeRecordList(gameFreeRecord);
}
/**
*
*
* @param gameFreeRecord
* @return
*/
@Override
public int insertGameFreeRecord(GameFreeRecord gameFreeRecord) {
gameFreeRecord.setId(IdUtil.getSnowflakeNextId());
gameFreeRecord.setCreateTime(System.currentTimeMillis());
return gameFreeRecordMapper.insertGameFreeRecord(gameFreeRecord);
}
/**
*
*
* @param gameFreeRecord
* @return
*/
@Override
public int updateGameFreeRecord(GameFreeRecord gameFreeRecord) {
gameFreeRecord.setUpdateTime(System.currentTimeMillis());
return gameFreeRecordMapper.updateGameFreeRecord(gameFreeRecord);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteGameFreeRecordByIds(Long[] ids) {
return gameFreeRecordMapper.deleteGameFreeRecordByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteGameFreeRecordById(Long id) {
return gameFreeRecordMapper.deleteGameFreeRecordById(id);
}
}

View File

@ -0,0 +1,114 @@
package com.ff.game.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.game.domain.Game;
import com.ff.game.mapper.GameMapper;
import com.ff.game.service.IGameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
@Slf4j
public class GameServiceImpl implements IGameService {
@Autowired
private GameMapper gameMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Game selectGameById(Long id) {
return gameMapper.selectGameById(id);
}
/**
* id
*
* @param gameId id
* @return {@link Game }
*/
@Override
public Game selectGameByGameId(String gameId) {
return gameMapper.selectGameByGameId(gameId);
}
/**
*
*
* @param game
* @return
*/
@Override
public List<Game> selectGameList(Game game) {
return gameMapper.selectGameList(game);
}
/**
*
*
* @param game
* @return
*/
@Override
public int insertGame(Game game) {
if (game.getId() == null) {
game.setId(IdUtil.getSnowflakeNextId());
}
game.setCreateTime(System.currentTimeMillis());
return gameMapper.insertGame(game);
}
/**
*
*
* @param game
* @return
*/
@Override
public int updateGame(Game game) {
game.setUpdateTime(System.currentTimeMillis());
return gameMapper.updateGame(game);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteGameByIds(Long[] ids) {
return gameMapper.deleteGameByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteGameById(Long id) {
return gameMapper.deleteGameById(id);
}
@Override
public Integer selectMaxSortNo(Integer platformType, String platformCode) {
return gameMapper.selectMaxSortNoBy(platformType, platformCode);
}
}

View File

@ -0,0 +1,50 @@
package com.ff.game.service.impl;
import com.ff.game.domain.Platform;
import com.ff.game.mapper.PlatformMapper;
import com.ff.game.service.IPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author cengy
*/
@Service
public class PlatformServiceImpl implements IPlatformService {
@Autowired
PlatformMapper platformMapper;
@Override
public List<Platform> selectList(Platform platform) {
return platformMapper.selectList(platform);
}
@Override
public Platform selectByPlatformCode(String platformCode) {
return platformMapper.selectByPlatformCode(platformCode);
}
@Override
public int updatePlatform(Platform platform) {
return platformMapper.updatePlatform(platform);
}
@Override
public int insertPlatform(Platform platform) {
return platformMapper.insertPlatform(platform);
}
@Override
public int deleteById(Long id) {
return platformMapper.deleteById(id);
}
@Override
public int deleteByIds(String ids) {
return platformMapper.deleteByIds(ids);
}
}

View File

@ -1,9 +1,10 @@
package com.ff.member.mapper;
import java.util.List;
import com.ff.member.domain.Member;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*

View File

@ -0,0 +1,80 @@
package com.ff.member.service;
import com.ff.member.domain.Member;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
public interface IMemberService {
/**
*
*
* @param id
* @return
*/
Member selectMemberById(Long id);
/**
*
*
* @param member
* @return
*/
List<Member> selectMemberList(Member member);
/**
*
*
* @param member
* @return
*/
int insertMember(Member member);
/**
*
*
* @param member
* @return
*/
int updateMember(Member member);
/**
*
*
* @param ids
* @return
*/
int deleteMemberByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteMemberById(Long id);
/**
*
*
* @param gameAccount
* @return {@link Member }
*/
Member selectMemberByGameAccount(String gameAccount);
/**
*
*
* @param account
* @param currencyCode
* @param platformCode
* @return {@link Member }
*/
Member selectMemberByAccount(String account, String currencyCode, String platformCode);
}

View File

@ -0,0 +1,118 @@
package com.ff.member.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.member.domain.Member;
import com.ff.member.mapper.MemberMapper;
import com.ff.member.service.IMemberService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-10
*/
@Service
public class MemberServiceImpl implements IMemberService {
@Autowired
private MemberMapper memberMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Member selectMemberById(Long id) {
return memberMapper.selectMemberById(id);
}
/**
*
*
* @param member
* @return
*/
@Override
public List<Member> selectMemberList(Member member) {
return memberMapper.selectMemberList(member);
}
/**
*
*
* @param member
* @return
*/
@Override
public int insertMember(Member member) {
member.setId(IdUtil.getSnowflakeNextId());
member.setCreateTime(DateUtils.getNowDate());
return memberMapper.insertMember(member);
}
/**
*
*
* @param member
* @return
*/
@Override
public int updateMember(Member member) {
member.setUpdateTime(DateUtils.getNowDate());
return memberMapper.updateMember(member);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteMemberByIds(Long[] ids) {
return memberMapper.deleteMemberByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteMemberById(Long id) {
return memberMapper.deleteMemberById(id);
}
/**
*
*
* @param gameAccount
* @return {@link Member }
*/
@Override
public Member selectMemberByGameAccount(String gameAccount) {
return memberMapper.selectMemberByGameAccount(gameAccount);
}
/**
*
*
* @param account
* @param currencyCode
* @param platformCode
* @return {@link Member }
*/
@Override
public Member selectMemberByAccount(String account, String currencyCode, String platformCode) {
return memberMapper.selectMemberByAccount(account, currencyCode, platformCode);
}
}

View File

@ -1,8 +1,9 @@
package com.ff.sys.mapper;
import java.util.List;
import com.ff.sys.domain.SysFeedback;
import java.util.List;
/**
* Mapper
*

View File

@ -1,8 +1,9 @@
package com.ff.sys.mapper;
import java.util.List;
import com.ff.sys.domain.SysNotice;
import java.util.List;
/**
* Mapper
*

View File

@ -1,61 +1,61 @@
package com.ff.sys.service;
import java.util.List;
import com.ff.sys.domain.SysFeedback;
import java.util.List;
/**
* Service
*
*
* @author shi
* @date 2025-02-27
*/
public interface ISysFeedbackService
{
public interface ISysFeedbackService {
/**
*
*
*
* @param id
* @return
*/
SysFeedback selectSysFeedbackById(Long id);
SysFeedback selectSysFeedbackById(Long id);
/**
*
*
*
* @param sysFeedback
* @return
*/
List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback);
List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback);
/**
*
*
*
* @param sysFeedback
* @return
*/
int insertSysFeedback(SysFeedback sysFeedback);
int insertSysFeedback(SysFeedback sysFeedback);
/**
*
*
*
* @param sysFeedback
* @return
*/
int updateSysFeedback(SysFeedback sysFeedback);
int updateSysFeedback(SysFeedback sysFeedback);
/**
*
*
*
* @param ids
* @return
*/
int deleteSysFeedbackByIds(Long[] ids);
int deleteSysFeedbackByIds(Long[] ids);
/**
*
*
*
* @param id
* @return
*/
int deleteSysFeedbackById(Long id);
int deleteSysFeedbackById(Long id);
}

View File

@ -1,61 +1,61 @@
package com.ff.sys.service;
import java.util.List;
import com.ff.sys.domain.SysNotice;
import java.util.List;
/**
* Service
*
*
* @author shi
* @date 2025-02-28
*/
public interface ISysNoticeService
{
public interface ISysNoticeService {
/**
*
*
*
* @param id
* @return
*/
SysNotice selectSysNoticeById(Long id);
SysNotice selectSysNoticeById(Long id);
/**
*
*
*
* @param sysNotice
* @return
*/
List<SysNotice> selectSysNoticeList(SysNotice sysNotice);
List<SysNotice> selectSysNoticeList(SysNotice sysNotice);
/**
*
*
*
* @param sysNotice
* @return
*/
int insertSysNotice(SysNotice sysNotice);
int insertSysNotice(SysNotice sysNotice);
/**
*
*
*
* @param sysNotice
* @return
*/
int updateSysNotice(SysNotice sysNotice);
int updateSysNotice(SysNotice sysNotice);
/**
*
*
*
* @param ids
* @return
*/
int deleteSysNoticeByIds(Long[] ids);
int deleteSysNoticeByIds(Long[] ids);
/**
*
*
*
* @param id
* @return
*/
int deleteSysNoticeById(Long id);
int deleteSysNoticeById(Long id);
}

View File

@ -1,13 +1,14 @@
package com.ff.sys.service.impl;
import java.util.List;
import com.ff.base.utils.DateUtils;
import cn.hutool.core.util.IdUtil;
import com.ff.sys.domain.SysFeedback;
import com.ff.sys.mapper.SysFeedbackMapper;
import com.ff.sys.service.ISysFeedbackService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.sys.mapper.SysFeedbackMapper;
import com.ff.sys.domain.SysFeedback;
import com.ff.sys.service.ISysFeedbackService;
import cn.hutool.core.util.IdUtil;
import java.util.List;
/**
@ -17,8 +18,7 @@ import cn.hutool.core.util.IdUtil;
* @date 2025-02-27
*/
@Service
public class SysFeedbackServiceImpl implements ISysFeedbackService
{
public class SysFeedbackServiceImpl implements ISysFeedbackService {
@Autowired
private SysFeedbackMapper sysFeedbackMapper;
@ -29,8 +29,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public SysFeedback selectSysFeedbackById(Long id)
{
public SysFeedback selectSysFeedbackById(Long id) {
return sysFeedbackMapper.selectSysFeedbackById(id);
}
@ -41,8 +40,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback)
{
public List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback) {
return sysFeedbackMapper.selectSysFeedbackList(sysFeedback);
}
@ -53,8 +51,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public int insertSysFeedback(SysFeedback sysFeedback)
{
public int insertSysFeedback(SysFeedback sysFeedback) {
sysFeedback.setId(IdUtil.getSnowflakeNextId());
sysFeedback.setCreateTime(DateUtils.getNowDate());
return sysFeedbackMapper.insertSysFeedback(sysFeedback);
@ -67,8 +64,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public int updateSysFeedback(SysFeedback sysFeedback)
{
public int updateSysFeedback(SysFeedback sysFeedback) {
sysFeedback.setUpdateTime(DateUtils.getNowDate());
return sysFeedbackMapper.updateSysFeedback(sysFeedback);
}
@ -80,8 +76,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public int deleteSysFeedbackByIds(Long[] ids)
{
public int deleteSysFeedbackByIds(Long[] ids) {
return sysFeedbackMapper.deleteSysFeedbackByIds(ids);
}
@ -92,8 +87,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
* @return
*/
@Override
public int deleteSysFeedbackById(Long id)
{
public int deleteSysFeedbackById(Long id) {
return sysFeedbackMapper.deleteSysFeedbackById(id);
}
}

View File

@ -1,13 +1,14 @@
package com.ff.sys.service.impl;
import java.util.List;
import com.ff.base.utils.DateUtils;
import cn.hutool.core.util.IdUtil;
import com.ff.sys.domain.SysNotice;
import com.ff.sys.mapper.SysNoticeMapper;
import com.ff.sys.service.ISysNoticeService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.sys.mapper.SysNoticeMapper;
import com.ff.sys.domain.SysNotice;
import com.ff.sys.service.ISysNoticeService;
import cn.hutool.core.util.IdUtil;
import java.util.List;
/**
@ -17,8 +18,7 @@ import cn.hutool.core.util.IdUtil;
* @date 2025-02-28
*/
@Service
public class SysNoticeServiceImpl implements ISysNoticeService
{
public class SysNoticeServiceImpl implements ISysNoticeService {
@Autowired
private SysNoticeMapper sysNoticeMapper;
@ -29,8 +29,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public SysNotice selectSysNoticeById(Long id)
{
public SysNotice selectSysNoticeById(Long id) {
return sysNoticeMapper.selectSysNoticeById(id);
}
@ -41,8 +40,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public List<SysNotice> selectSysNoticeList(SysNotice sysNotice)
{
public List<SysNotice> selectSysNoticeList(SysNotice sysNotice) {
return sysNoticeMapper.selectSysNoticeList(sysNotice);
}
@ -53,8 +51,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public int insertSysNotice(SysNotice sysNotice)
{
public int insertSysNotice(SysNotice sysNotice) {
sysNotice.setId(IdUtil.getSnowflakeNextId());
sysNotice.setCreateTime(DateUtils.getNowDate());
return sysNoticeMapper.insertSysNotice(sysNotice);
@ -67,8 +64,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public int updateSysNotice(SysNotice sysNotice)
{
public int updateSysNotice(SysNotice sysNotice) {
sysNotice.setUpdateTime(DateUtils.getNowDate());
return sysNoticeMapper.updateSysNotice(sysNotice);
}
@ -80,8 +76,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public int deleteSysNoticeByIds(Long[] ids)
{
public int deleteSysNoticeByIds(Long[] ids) {
return sysNoticeMapper.deleteSysNoticeByIds(ids);
}
@ -92,8 +87,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @return
*/
@Override
public int deleteSysNoticeById(Long id)
{
public int deleteSysNoticeById(Long id) {
return sysNoticeMapper.deleteSysNoticeById(id);
}
}

View File

@ -0,0 +1,61 @@
package com.ff.tenant.mapper;
import com.ff.common.domain.TenantAgentPlatform;
import java.util.List;
/**
* Mapper
*
* @author shi
* @date 2025-02-27
*/
public interface TenantAgentPlatformMapper {
/**
*
*
* @param id
* @return
*/
TenantAgentPlatform selectTenantAgentPlatformById(Long id);
/**
*
*
* @param tenantAgentPlatform
* @return
*/
List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform);
/**
*
*
* @param tenantAgentPlatform
* @return
*/
int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
/**
*
*
* @param tenantAgentPlatform
* @return
*/
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentPlatformById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentPlatformByIds(Long[] ids);
}

View File

@ -0,0 +1,82 @@
package com.ff.tenant.mapper;
import com.ff.common.domain.TenantGameQuotaFlow;
import java.math.BigDecimal;
import java.util.List;
/**
* Mapper
*
* @author shi
* @date 2025-02-12
*/
public interface TenantGameQuotaFlowMapper {
/**
*
*
* @param id
* @return
*/
TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id);
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow);
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
/**
*
*
* @param id
* @return
*/
int deleteTenantGameQuotaFlowById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantGameQuotaFlowByIds(Long[] ids);
/**
* id
*
* @param tenantGameQuotaFlow
* @return {@link BigDecimal }
*/
BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow);
/**
*
*
* @param tenantGameQuotaFlow
* @return {@link List }<{@link TenantGameQuotaFlow }>
*/
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
}

View File

@ -1,10 +1,10 @@
package com.ff.common.mapper;
import java.util.List;
package com.ff.tenant.mapper;
import com.ff.common.domain.TenantGameQuota;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
@ -27,7 +27,7 @@ public interface TenantGameQuotaMapper {
* @param tenantKey
* @return
*/
TenantGameQuota selectTenantGameQuotaByTenantKey(@Param("tenantKey") String tenantKey,@Param("quotaType") String quotaType);
TenantGameQuota selectTenantGameQuotaByTenantKey(@Param("tenantKey") String tenantKey, @Param("quotaType") String quotaType);
/**
*

View File

@ -0,0 +1,72 @@
package com.ff.tenant.mapper;
import com.ff.common.domain.TenantQuotaExchange;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author shi
* @date 2025-02-21
*/
public interface TenantQuotaExchangeMapper {
/**
*
*
* @param id
* @return
*/
TenantQuotaExchange selectTenantQuotaExchangeById(Long id);
/**
*
*
* @param tenantQuotaExchange
* @return
*/
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
/**
*
*
* @param tenantQuotaExchange
* @return
*/
int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
/**
*
*
* @param tenantQuotaExchange
* @return
*/
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
/**
*
*
* @param id
* @return
*/
int deleteTenantQuotaExchangeById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantQuotaExchangeByIds(Long[] ids);
/**
*
*
* @param currencyCode
* @param exchangeCurrencyCode
* @return {@link TenantQuotaExchange }
*/
TenantQuotaExchange getTenantQuotaExchange(@Param("currencyCode") String currencyCode, @Param("exchangeCurrencyCode") String exchangeCurrencyCode);
}

View File

@ -1,15 +1,16 @@
package com.ff.common.mapper;
package com.ff.tenant.service;
import java.util.List;
import com.ff.common.domain.TenantAgentPlatform;
import java.util.List;
/**
* Mapper
* Service
*
* @author shi
* @date 2025-02-27
*/
public interface TenantAgentPlatformMapper
public interface ITenantAgentPlatformService
{
/**
*
@ -44,18 +45,18 @@ public interface TenantAgentPlatformMapper
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
/**
*
*
*
* @param ids
* @return
*/
int deleteTenantAgentPlatformByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentPlatformById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentPlatformByIds(Long[] ids);
}

View File

@ -1,17 +1,17 @@
package com.ff.common.mapper;
package com.ff.tenant.service;
import com.ff.common.domain.TenantGameQuotaFlow;
import java.math.BigDecimal;
import java.util.List;
import com.ff.common.domain.TenantGameQuotaFlow;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
* Service
*
* @author shi
* @date 2025-02-12
*/
public interface TenantGameQuotaFlowMapper
public interface ITenantGameQuotaFlowService
{
/**
*
@ -46,22 +46,21 @@ public interface TenantGameQuotaFlowMapper
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
/**
*
*
*
* @param ids
* @return
*/
int deleteTenantGameQuotaFlowByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantGameQuotaFlowById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantGameQuotaFlowByIds(Long[] ids);
/**
* id
*
@ -77,7 +76,5 @@ public interface TenantGameQuotaFlowMapper
* @param tenantGameQuotaFlow
* @return {@link List }<{@link TenantGameQuotaFlow }>
*/
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
}

View File

@ -0,0 +1,70 @@
package com.ff.tenant.service;
import com.ff.common.domain.TenantGameQuota;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-12
*/
public interface ITenantGameQuotaService {
/**
*
*
* @param id
* @return
*/
TenantGameQuota selectTenantGameQuotaById(Long id);
/**
*
*
* @param tenantGameQuota
* @return
*/
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
/**
*
*
* @param tenantGameQuota
* @return
*/
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
/**
*
*
* @param tenantGameQuota
* @return
*/
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
/**
*
*
* @param ids
* @return
*/
int deleteTenantGameQuotaByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
int deleteTenantGameQuotaById(Long id);
/**
*
*
* @param tenantKey
* @return
*/
TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType);
}

View File

@ -1,16 +1,16 @@
package com.ff.common.mapper;
package com.ff.tenant.service;
import com.ff.common.domain.TenantQuotaExchange;
import java.util.List;
import com.ff.common.domain.TenantQuotaExchange;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
* Service
*
* @author shi
* @date 2025-02-21
*/
public interface TenantQuotaExchangeMapper
public interface ITenantQuotaExchangeService
{
/**
*
@ -28,6 +28,16 @@ public interface TenantQuotaExchangeMapper
*/
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
/**
*
*
* @param currencyCode
* @param exchangeCurrencyCode
* @return {@link TenantQuotaExchange }
*/
TenantQuotaExchange getTenantQuotaExchange(String currencyCode,String exchangeCurrencyCode);
/**
*
*
@ -44,29 +54,19 @@ public interface TenantQuotaExchangeMapper
*/
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
/**
*
*
* @param id
* @return
*/
int deleteTenantQuotaExchangeById(Long id);
/**
*
*
* @param ids
* @param ids
* @return
*/
int deleteTenantQuotaExchangeByIds(Long[] ids);
/**
*
*
* @param currencyCode
* @param exchangeCurrencyCode
* @return {@link TenantQuotaExchange }
*
*
* @param id
* @return
*/
TenantQuotaExchange getTenantQuotaExchange(@Param("currencyCode") String currencyCode, @Param("exchangeCurrencyCode") String exchangeCurrencyCode);
int deleteTenantQuotaExchangeById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.ff.tenant.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.TenantAgentPlatform;
import com.ff.tenant.mapper.TenantAgentPlatformMapper;
import com.ff.tenant.service.ITenantAgentPlatformService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-27
*/
@Service
public class TenantAgentPlatformServiceImpl implements ITenantAgentPlatformService {
@Autowired
private TenantAgentPlatformMapper tenantAgentPlatformMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantAgentPlatform selectTenantAgentPlatformById(Long id) {
return tenantAgentPlatformMapper.selectTenantAgentPlatformById(id);
}
/**
*
*
* @param tenantAgentPlatform
* @return
*/
@Override
public List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform) {
return tenantAgentPlatformMapper.selectTenantAgentPlatformList(tenantAgentPlatform);
}
/**
*
*
* @param tenantAgentPlatform
* @return
*/
@Override
public int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform) {
tenantAgentPlatform.setId(IdUtil.getSnowflakeNextId());
tenantAgentPlatform.setCreateTime(DateUtils.getNowDate());
return tenantAgentPlatformMapper.insertTenantAgentPlatform(tenantAgentPlatform);
}
/**
*
*
* @param tenantAgentPlatform
* @return
*/
@Override
public int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform) {
tenantAgentPlatform.setUpdateTime(DateUtils.getNowDate());
return tenantAgentPlatformMapper.updateTenantAgentPlatform(tenantAgentPlatform);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantAgentPlatformByIds(Long[] ids) {
return tenantAgentPlatformMapper.deleteTenantAgentPlatformByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantAgentPlatformById(Long id) {
return tenantAgentPlatformMapper.deleteTenantAgentPlatformById(id);
}
}

View File

@ -0,0 +1,116 @@
package com.ff.tenant.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.TenantGameQuotaFlow;
import com.ff.tenant.mapper.TenantGameQuotaFlowMapper;
import com.ff.tenant.service.ITenantGameQuotaFlowService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-12
*/
@Service
public class TenantGameQuotaFlowServiceImpl implements ITenantGameQuotaFlowService {
@Autowired
private TenantGameQuotaFlowMapper tenantGameQuotaFlowMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id) {
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowById(id);
}
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
@Override
public List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow) {
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowList(tenantGameQuotaFlow);
}
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
@Override
public int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
tenantGameQuotaFlow.setId(IdUtil.getSnowflakeNextId());
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
return tenantGameQuotaFlowMapper.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
}
/**
*
*
* @param tenantGameQuotaFlow
* @return
*/
@Override
public int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
tenantGameQuotaFlow.setUpdateTime(DateUtils.getNowDate());
return tenantGameQuotaFlowMapper.updateTenantGameQuotaFlow(tenantGameQuotaFlow);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantGameQuotaFlowByIds(Long[] ids) {
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantGameQuotaFlowById(Long id) {
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowById(id);
}
/**
* id
*
* @param tenantGameQuotaFlow
* @return {@link BigDecimal }
*/
@Override
public BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow) {
return tenantGameQuotaFlowMapper.getExchangeMoneyByMemberId(tenantGameQuotaFlow);
}
/**
*
*
* @param tenantGameQuotaFlow
* @return {@link List }<{@link TenantGameQuotaFlow }>
*/
@Override
public List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow) {
return tenantGameQuotaFlowMapper.getBalanceByTenantKey(tenantGameQuotaFlow);
}
}

View File

@ -0,0 +1,121 @@
package com.ff.tenant.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.TenantGameQuota;
import com.ff.tenant.mapper.TenantGameQuotaMapper;
import com.ff.tenant.service.ITenantGameQuotaService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-12
*/
@Service
public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService {
@Autowired
private TenantGameQuotaMapper tenantGameQuotaMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantGameQuota selectTenantGameQuotaById(Long id) {
return tenantGameQuotaMapper.selectTenantGameQuotaById(id);
}
/**
*
*
* @param tenantGameQuota
* @return
*/
@Override
public List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota) {
return tenantGameQuotaMapper.selectTenantGameQuotaList(tenantGameQuota);
}
/**
*
*
* @param tenantGameQuota
* @return
*/
@Override
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
tenantGameQuota.setId(IdUtil.getSnowflakeNextId());
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
}
/**
*
*
* @param tenantGameQuota
* @return
*/
@Override
public int updateTenantGameQuota(TenantGameQuota tenantGameQuota) {
tenantGameQuota.setUpdateTime(DateUtils.getNowDate());
return tenantGameQuotaMapper.updateTenantGameQuota(tenantGameQuota);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantGameQuotaByIds(Long[] ids) {
return tenantGameQuotaMapper.deleteTenantGameQuotaByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantGameQuotaById(Long id) {
return tenantGameQuotaMapper.deleteTenantGameQuotaById(id);
}
/**
*
*
* @param tenantKey
* @param quotaType
* @return {@link TenantGameQuota }
*/
@Override
public TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType) {
TenantGameQuota tenantGameQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(tenantKey, quotaType);
//如果当前钱包不存在
if (ObjectUtils.isEmpty(tenantGameQuota)) {
tenantGameQuota = TenantGameQuota.builder()
.tenantKey(tenantKey)
.id(IdUtil.getSnowflakeNextId())
.balance(BigDecimal.ZERO)
.quotaType(quotaType)
.version(0)
.build();
tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
}
return tenantGameQuota;
}
}

View File

@ -0,0 +1,104 @@
package com.ff.tenant.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ff.common.domain.TenantQuotaExchange;
import com.ff.tenant.mapper.TenantQuotaExchangeMapper;
import com.ff.tenant.service.ITenantQuotaExchangeService;
import com.ff.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author shi
* @date 2025-02-21
*/
@Service
public class TenantQuotaExchangeServiceImpl implements ITenantQuotaExchangeService {
@Autowired
private TenantQuotaExchangeMapper tenantQuotaExchangeMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TenantQuotaExchange selectTenantQuotaExchangeById(Long id) {
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeById(id);
}
/**
*
*
* @param tenantQuotaExchange
* @return
*/
@Override
public List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange) {
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeList(tenantQuotaExchange);
}
/**
*
*
* @param currencyCode
* @param exchangeCurrencyCode
* @return {@link TenantQuotaExchange }
*/
@Override
public TenantQuotaExchange getTenantQuotaExchange(String currencyCode, String exchangeCurrencyCode) {
return tenantQuotaExchangeMapper.getTenantQuotaExchange(currencyCode, exchangeCurrencyCode);
}
/**
*
*
* @param tenantQuotaExchange
* @return
*/
@Override
public int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange) {
tenantQuotaExchange.setId(IdUtil.getSnowflakeNextId());
tenantQuotaExchange.setCreateTime(DateUtils.getNowDate());
return tenantQuotaExchangeMapper.insertTenantQuotaExchange(tenantQuotaExchange);
}
/**
*
*
* @param tenantQuotaExchange
* @return
*/
@Override
public int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange) {
tenantQuotaExchange.setUpdateTime(DateUtils.getNowDate());
return tenantQuotaExchangeMapper.updateTenantQuotaExchange(tenantQuotaExchange);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTenantQuotaExchangeByIds(Long[] ids) {
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTenantQuotaExchangeById(Long id) {
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeById(id);
}
}

View File

@ -0,0 +1,67 @@
package com.ff.exception;
import com.ff.base.enums.ErrorCode;
import lombok.Getter;
import org.springframework.lang.Nullable;
/**
*
*
* @author ff
*/
@Getter
public class ApiException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer code;
/**
*
*/
private String message;
public ApiException(Integer code, String message) {
this.code = code;
this.message = message;
}
public ApiException(Integer code) {
this.code = code;
this.message = ErrorCode.findByCode(code);
}
@Override
public String getMessage() {
return message;
}
/**
*
*
* @param object
* @param code
*/
public static void notNull(@Nullable Object object, Integer code) {
if (object == null) {
throw new ApiException(code);
}
}
/**
*
*
* @param bool
* @param code
*/
public static void isTrue(@Nullable Boolean bool, Integer code) {
if (Boolean.FALSE.equals(bool)) {
throw new ApiException(code);
}
}
}

View File

@ -0,0 +1,97 @@
package com.ff.exception;
import com.ff.base.utils.MessageUtils;
import com.ff.base.utils.StringUtils;
/**
*
*
* @author ff
*/
public class BaseException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
*
*/
private String module;
/**
*
*/
private String code;
/**
*
*/
private Object[] args;
/**
*
*/
private String defaultMessage;
public BaseException(String module, String code, Object[] args, String defaultMessage)
{
this.module = module;
this.code = code;
this.args = args;
this.defaultMessage = defaultMessage;
}
public BaseException(String module, String code, Object[] args)
{
this(module, code, args, null);
}
public BaseException(String module, String defaultMessage)
{
this(module, null, null, defaultMessage);
}
public BaseException(String code, Object[] args)
{
this(null, code, args, null);
}
public BaseException(String defaultMessage)
{
this(null, null, null, defaultMessage);
}
@Override
public String getMessage()
{
String message = null;
if (!StringUtils.isEmpty(code))
{
message = MessageUtils.message(code, args);
}
if (message == null)
{
message = defaultMessage;
}
return message;
}
public String getModule()
{
return module;
}
public String getCode()
{
return code;
}
public Object[] getArgs()
{
return args;
}
public String getDefaultMessage()
{
return defaultMessage;
}
}

View File

@ -16,6 +16,11 @@
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

View File

@ -0,0 +1,946 @@
package com.ff.utils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
/**
*
*
* @author ff
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String YYYY = "yyyy";
public static String YYYY_MM = "yyyy-MM";
public static String YYYY_MM_DD = "yyyy-MM-dd";
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
public static String HHMMSS = "HH:mm:ss";
public static String DAY_START_TIME = "00:00:00";
public static String DAY_END_TIME = "23:59:59";
public static final String ISO_8601_FORMAT= "yyyy-MM-dd'T'HH:mm:ss";
public static final String ISO_8601_FORMAT_Z= "yyyy-MM-dd'T'HH:mm:ss'Z'";
/**
* Date
*
* @return Date()
*/
public static Long getNowDate() {
return Instant.now().toEpochMilli();
}
/**
*
*
* @return {@link Long }
*/
public static Date getCurrentDate() {
return new Date();
}
/**
* , yyyy-MM-dd
*
* @return String
*/
public static String getDate() {
return dateTimeNow(YYYY_MM_DD);
}
public static final String getTime() {
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
public static final String dateTimeNow() {
return dateTimeNow(YYYYMMDDHHMMSS);
}
public static final String dateTimeNow(final String format) {
return parseDateToStr(format, new Date());
}
public static final String dateTime(final Date date) {
return parseDateToStr(YYYY_MM_DD, date);
}
public static final String parseDateToStr(final String format, final Date date) {
return new SimpleDateFormat(format).format(date);
}
public static final Date dateTime(final String format, final String ts) {
try {
return new SimpleDateFormat(format).parse(ts);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
/**
* // 2018/08/08
*/
public static final String datePath() {
Date now = new Date();
return DateFormatUtils.format(now, "yyyy/MM/dd");
}
/**
* // 20180808
*/
public static final String dateTime() {
Date now = new Date();
return DateFormatUtils.format(now, "yyyyMMdd");
}
/**
*
*/
public static Date parseDate(Object str) {
if (str == null) {
return null;
}
try {
return parseDate(str.toString(), parsePatterns);
} catch (ParseException e) {
return null;
}
}
/**
*
*/
public static Date getServerStartDate() {
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
return new Date(time);
}
/**
*
*/
public static int differentDaysByMillisecond(Date date1, Date date2) {
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
}
/**
*
*
* @param endDate
* @param startTime
* @return //
*/
public static String timeDistance(Date endDate, Date startTime) {
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - startTime.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff % nd / nh;
// 计算差多少分钟
long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟";
}
/**
* LocalDateTime ==> Date
*/
public static Date toDate(LocalDateTime temporalAccessor) {
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
/**
* yymmd
*
* @return {@link String }
*/
public static String getFormattedDate() {
ZonedDateTime nowUtcMinus4 = ZonedDateTime.now(ZoneId.of("UTC-4"));
String year = String.format("%02d", nowUtcMinus4.getYear() % 100);
String month = String.format("%02d", nowUtcMinus4.getMonthValue());
String day = String.valueOf(nowUtcMinus4.getDayOfMonth());
return year + month + day;
}
/**
* gmt4
*
* @param date
* @return {@link String }
*/
public static String formatDateToGMT4(Date date) {
// 将 Date 转换为 ZonedDateTime
ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of("GMT-4"));
// 定义日期时间格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
// 格式化并返回字符串
return zdt.format(formatter);
}
/**
*
*
* @param timestamp
* @param format yyyy-MM-dd'T'HH:mm:ssXXX
* @param timeZone GMT+8UTC
* @return
*/
public static String convertTimestampToFormattedDate(long timestamp, String format, String timeZone) {
// 创建日期格式化对象
SimpleDateFormat sdf = new SimpleDateFormat(format);
// 设置时区为GMT+8
sdf.setTimeZone(TimeZone.getTimeZone(timeZone));
// 转换为 Date 对象
Date date = new Date(timestamp);
// 返回格式化后的时间字符串
return sdf.format(date);
}
/**
*
*
* @param timestampInMillis
* @param timeZone America/New_York
* @param format yyyy-MM-dd HH:mm:ss
* @return
*/
public static String convertTimeZone(long timestampInMillis, String timeZone, String format) {
// 将毫秒时间戳转换为 Instant
Instant instant = Instant.ofEpochMilli(timestampInMillis);
// 将 UTC 时间转换为指定时区的时间
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(timeZone));
// 格式化输出为指定格式的时间字符串
return zonedDateTime.format(DateTimeFormatter.ofPattern(format));
}
/**
* LocalDate ==> Date
*/
public static Date toDate(LocalDate temporalAccessor) {
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
/**
*
*
* @param timestampMillis
* @param minutes
* @return long
*/
public static long addOrSubtractMinutes(long timestampMillis, int minutes) {
// 将分钟转换为毫秒,并加到时间戳上
return timestampMillis + minutes * 60 * 1000L;
}
/**
*
*
* @param timestampDay
* @param day
* @return long
*/
public static long addOrSubtractDay(long timestampDay, int day) {
// 将分钟转换为毫秒,并加到时间戳上
return timestampDay + day * 60 * 1000L * 60 * 24;
}
/**
*
*
* @return
*/
public static Long getDayStart(Calendar calendar) {
// 设置时间为当天的 00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @param timestamp
* @param timeZoneId
* @return
*/
public static Long getDayStart(long timestamp, String timeZoneId) {
ZoneId zoneId = ZoneId.of(timeZoneId);
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), zoneId);
LocalDate localDate = zonedDateTime.toLocalDate();
LocalDateTime startOfDay = localDate.atStartOfDay();
ZonedDateTime startOfDayZoned = startOfDay.atZone(zoneId);
return startOfDayZoned.toInstant().toEpochMilli();
}
/**
*
*
* @return
*/
public static Long getDayEnd(Calendar calendar) {
// 设置时间为当天的 23:59:59
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTimeInMillis();
}
/**
*
*
* @param timestamp
* @param timeZoneId
* @return
*/
public static Long getDayEnd(long timestamp, String timeZoneId) {
ZoneId zoneId = ZoneId.of(timeZoneId);
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), zoneId);
LocalDate localDate = zonedDateTime.toLocalDate();
LocalDateTime endOfDay = localDate.atTime(23, 59, 59, 999999999);
ZonedDateTime endOfDayZoned = endOfDay.atZone(zoneId);
return endOfDayZoned.toInstant().toEpochMilli();
}
/**
*
*
* @return
*/
public static Long getYesterdayStart() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// 回溯一天
calendar.add(Calendar.DAY_OF_MONTH, -1);
// 设置时间为当天的 00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getYesterdayEnd() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// 回溯一天
calendar.add(Calendar.DAY_OF_MONTH, -1);
// 设置时间为当天的 23:59:59
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getLastWeekBegin() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// 计算上周的起始日期(周一)
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
calendar.add(Calendar.WEEK_OF_YEAR, -1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getLastWeekEnd() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// 计算上周的结束日期(周日)
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getWeekBegin(Calendar calendar) {
// 设置一周的第一天为星期一
calendar.setFirstDayOfWeek(Calendar.MONDAY);
// 获取当前日期在本周的位置
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
// 计算需要回溯的天数
int daysToSubtract = (dayOfWeek == Calendar.SUNDAY ? 6 : dayOfWeek - 2);
calendar.add(Calendar.DAY_OF_MONTH, -daysToSubtract);
// 设置时间为当天的 00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getWeekEnd(Calendar calendar) {
// 设置一周的第一天为星期一
calendar.setFirstDayOfWeek(Calendar.MONDAY);
// 获取当前日期在本周的位置
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
// 计算需要前进的天数
int daysToAdd = (dayOfWeek == Calendar.SUNDAY ? 0 : 7 - (dayOfWeek - 1));
calendar.add(Calendar.DAY_OF_MONTH, daysToAdd);
// 设置时间为当天的 23:59:59
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getMonthStart(Calendar calendar) {
// 设置时间为当月的第一天
calendar.set(Calendar.DAY_OF_MONTH, 1);
// 设置时间为当天的 00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getMonthEnd(Calendar calendar) {
// 设置时间为当月的最后一天
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
// 设置时间为当天的 23:59:59
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getLastMonthStart() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// 计算上个月的起始日期1号
calendar.add(Calendar.MONTH, -1);
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
}
/**
*
*
* @return
*/
public static Long getLastMonthEnd() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar.add(Calendar.MONTH, -1); // 回退一个月
// 计算上个月的结束日期(最后一天)
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); // 设置日期为当月最后一天
calendar.set(Calendar.HOUR_OF_DAY, 23); // 设置小时为23
calendar.set(Calendar.MINUTE, 59); // 设置分钟为59
calendar.set(Calendar.SECOND, 59); // 设置秒为59
calendar.set(Calendar.MILLISECOND, 999); // 设置毫秒为999
return calendar.getTimeInMillis();
}
/**
* A B C
*
* @param timestampA A
* @param timestampB B
* @param timestampC C
* @return true A B false A C
*/
public static boolean isCloserToB(long timestampA, long timestampB, long timestampC) {
long diffAB = Math.abs(timestampA - timestampB);
long diffAC = Math.abs(timestampA - timestampC);
return diffAB < diffAC;
}
/**
*
*
* @param utcTimestamp utc
* @param date
* @param timeZonId
* @return
*/
public static long getTomorrowTimeByZonId(long utcTimestamp, Date date, String timeZonId) {
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
// 将时间戳转换为 Instant
Instant instant = Instant.ofEpochMilli(addOrSubtractDay(utcTimestamp, 1));
ZoneId zoneId = ZoneId.of(timeZonId);
LocalDate localDate = instant.atZone(zoneId).toLocalDate();
LocalDateTime tomorrowDrawStartTime = localDate.atTime(localTime);
return tomorrowDrawStartTime.atZone(zoneId).toInstant().toEpochMilli();
}
/**
*
*
* @param date
* @param timeZonId
* @return
*/
public static long getTodayTimeByZonId(Date date, String timeZonId) {
// 获取今日指定时间后的时间戳
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
LocalDate currentDate = LocalDate.now();
LocalDateTime todayDrawStartTime = currentDate.atTime(localTime);
ZoneId zoneId = ZoneId.of(timeZonId);
return todayDrawStartTime.atZone(zoneId).toInstant().toEpochMilli();
}
/**
*
*
* @param dayOfWeek 1-7
* @param date Date
* @return UTC
*/
public static long getNextWeekTimestamp(int dayOfWeek, Date date, ZoneId zoneId) {
// 将Date对象转换为LocalDateTime对象
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
// 获取当前日期时间
ZonedDateTime now = ZonedDateTime.now(zoneId);
// 找到本周的周几
ZonedDateTime startOfWeek = now.with(dayOfWeek < now.getDayOfWeek().getValue() ? TemporalAdjusters.previousOrSame(DayOfWeek.of(dayOfWeek)) : TemporalAdjusters.nextOrSame(DayOfWeek.of(dayOfWeek)));
// 加上一个完整的星期,得到下周的周几
ZonedDateTime nextWeekStart = startOfWeek.plusWeeks(1);
// 设置指定的时间
ZonedDateTime targetDateTime = nextWeekStart.withHour(localTime.getHour()).withMinute(localTime.getMinute()).withSecond(localTime.getSecond()).withNano(0);
// 转换为时间戳(毫秒)
return targetDateTime.toInstant().toEpochMilli();
}
/**
*
*
* @param dayOfWeek 1-7
* @param date Date
* @return
*/
public static long getCurrentWeekTimestamp(int dayOfWeek, Date date, ZoneId zoneId) {
// 将Date对象转换为LocalDateTime对象
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
// 获取当前日期时间
LocalDateTime now = LocalDateTime.now();
// 获取当前周的指定周几的日期时间
LocalDateTime currentWeekDateTime = now.with(dayOfWeek < now.getDayOfWeek().getValue() ? TemporalAdjusters.previousOrSame(DayOfWeek.of(dayOfWeek)) : TemporalAdjusters.nextOrSame(DayOfWeek.of(dayOfWeek)))
.withHour(localTime.getHour())
.withMinute(localTime.getMinute())
.withSecond(localTime.getSecond())
.withNano(0);
// 将LocalDateTime转换为ZonedDateTime使用UTC时区
ZonedDateTime zonedDateTime = currentWeekDateTime.atZone(zoneId);
// 将ZonedDateTime转换为时间戳毫秒
return zonedDateTime.toInstant().toEpochMilli();
}
/**
*
*
* @param dayOfMonth 1-31
* @param date Date
* @param month
* @return
*/
public static long getNextMonthTimestamp(int dayOfMonth, Date date, ZoneId zoneId, int month) {
// 将Date对象转换为LocalDateTime对象
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
// 获取当前日期时间
LocalDateTime now = LocalDateTime.now();
// 获取下个月的年份和月份
YearMonth nextMonth = YearMonth.from(now).plusMonths(month);
int maxDayNum = nextMonth.lengthOfMonth();
if (dayOfMonth > maxDayNum) {
dayOfMonth = maxDayNum;
}
// 创建下个月指定日的LocalDateTime对象
LocalDateTime nextMonthDateTime = LocalDateTime.of(nextMonth.getYear(), nextMonth.getMonth(), dayOfMonth,
localTime.getHour(), localTime.getMinute(), localTime.getSecond(), 0);
// 将LocalDateTime转换为ZonedDateTime使用UTC时区
ZonedDateTime zonedDateTime = nextMonthDateTime.atZone(zoneId);
// 将ZonedDateTime转换为时间戳毫秒
return zonedDateTime.toInstant().toEpochMilli();
}
/**
*
*
* @param dayOfMonth 1-31
* @param date Date
* @return
*/
public static long getCurrentMonthTimestamp(int dayOfMonth, Date date, ZoneId zoneId) {
// 将Date对象转换为LocalDateTime对象
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
String format = sdf.format(date);
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
LocalTime localTime = LocalTime.parse(format, timeFormatter);
// 获取当前日期时间
LocalDateTime now = LocalDateTime.now();
// 获取本月的年份和月份
YearMonth currentMonth = YearMonth.from(now);
int maxDayNum = currentMonth.lengthOfMonth();
if (dayOfMonth > maxDayNum) {
dayOfMonth = maxDayNum;
}
// 创建本月指定日的LocalDateTime对象
LocalDateTime currentMonthDateTime = LocalDateTime.of(currentMonth.getYear(), currentMonth.getMonth(), dayOfMonth,
localTime.getHour(), localTime.getMinute(), localTime.getSecond(), 0);
// 将LocalDateTime转换为ZonedDateTime使用UTC时区
ZonedDateTime zonedDateTime = currentMonthDateTime.atZone(zoneId);
// 将ZonedDateTime转换为时间戳毫秒
return zonedDateTime.toInstant().toEpochMilli();
}
/**
* UTC0
*
* @param timeZoneId id
* @param timestamp
* @return UTC0
*/
public static long covertToUTCtimestamp(String timeZoneId, long timestamp) {
// 将时间戳转换为 Instant 对象
Instant instant = Instant.ofEpochMilli(timestamp);
// 使用指定的时区将 Instant 对象转换为 ZonedDateTime 对象
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(timeZoneId));
ZonedDateTime zonedDateTime1 = zonedDateTime.withZoneSameLocal(ZoneOffset.UTC);
// 将 ZonedDateTime 对象转换为 UTC0 时区的 Instant 对象
// 获取 UTC0 时区的时间戳(以毫秒为单位)
return zonedDateTime1.toInstant().toEpochMilli();
}
/**
* UTC
*
* @param timeZoneId id
* @param timestamp
* @return
*/
public static long covertUTCTotimeZonetimestamp(String timeZoneId, long timestamp) {
// 将时间戳转换为 Instant 对象
Instant instant = Instant.ofEpochMilli(timestamp);
// 使用指定的时区将 Instant 对象转换为 ZonedDateTime 对象
ZonedDateTime zonedDateTime = instant.atZone(ZoneOffset.UTC);
ZonedDateTime zonedDateTime1 = zonedDateTime.withZoneSameLocal(ZoneId.of(timeZoneId));
// 获取 指定 时区的时间戳(以毫秒为单位)
return zonedDateTime1.toInstant().toEpochMilli();
}
/**
* 0
*
* @param timestamp
* @param timeZone
* @return
*/
public static boolean isMidnight(long timestamp, TimeZone timeZone) {
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTimeInMillis(timestamp);
return calendar.get(Calendar.HOUR_OF_DAY) == 0 &&
calendar.get(Calendar.MINUTE) == 0 &&
calendar.get(Calendar.SECOND) == 0 &&
calendar.get(Calendar.MILLISECOND) == 0;
}
/**
* 0
*
* @param timestamp
* @param timeZone
* @return 0
*/
public static boolean isMondayMidnight(long timestamp, TimeZone timeZone) {
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTimeInMillis(timestamp);
return isMidnight(timestamp, timeZone) && calendar.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY;
}
/**
* ISO 8601
*
* @param isoDate ISO 8601 "2025-05-10T08:23:34Z"
* @return Unix epoch
*/
public static long convertToMilliseconds(String isoDate) {
Instant instant = Instant.parse(isoDate);
return instant.toEpochMilli();
}
/**
* ZoneId TimeZone
*
* @param zoneId ZoneId
* @return TimeZone
*/
public static TimeZone zoneIdToTimeZone(ZoneId zoneId) {
return TimeZone.getTimeZone(zoneId.getId());
}
/**
* UTC
*
* @param dayOfWeek 1-717
* @return UTC
*/
public static Map<String, Object> getStartAndEndUTCTimestampOfDayOfWeek(int dayOfWeek) {
if (dayOfWeek < 1 || dayOfWeek > 7) {
throw new IllegalArgumentException("dayOfWeek must be between 1 and 7");
}
// 获取当前日期
LocalDate today = LocalDate.now(ZoneOffset.UTC);
// 计算本周的开始日期(星期一)
LocalDate monday = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
// 计算指定星期几的日期
LocalDate targetDay = monday.plusDays(dayOfWeek - 1);
// 计算指定星期几的开始时间00:00:00 UTC
ZonedDateTime startOfDay = targetDay.atStartOfDay(ZoneOffset.UTC);
// 计算指定星期几的结束时间23:59:59 UTC
ZonedDateTime endOfDay = targetDay.atTime(LocalTime.MAX).atZone(ZoneOffset.UTC);
// 获取开始和结束时间戳
long startTimestamp = startOfDay.toInstant().toEpochMilli();
long endTimestamp = endOfDay.toInstant().toEpochMilli();
Map<String, Object> map = new HashMap<>();
map.put("beginTime", startTimestamp);
map.put("endTime", endTimestamp);
return map;
}
/**
* UTC
*
* @param dayOfMonth 1-31
* @return UTCMap"beginTime""endTime"
*/
public static Map<String, Object> getStartAndEndUTCTimestampOfDayOfMonth(int dayOfMonth) {
// 获取当前日期
LocalDate today = LocalDate.now(ZoneOffset.UTC);
// 获取本月的年份和月份
YearMonth currentMonth = YearMonth.from(today);
int maxDayNum = currentMonth.lengthOfMonth();
if (dayOfMonth > maxDayNum) {
dayOfMonth = maxDayNum;
}
// 获取当前年份和月份
int year = today.getYear();
int month = today.getMonthValue();
// 构建指定月几号的日期
LocalDate targetDay;
try {
targetDay = LocalDate.of(year, month, dayOfMonth);
} catch (DateTimeException e) {
throw new IllegalArgumentException("Invalid dayOfMonth for the current month", e);
}
// 计算指定月几号的开始时间00:00:00 UTC
ZonedDateTime startOfDay = targetDay.atStartOfDay(ZoneOffset.UTC);
// 计算指定月几号的结束时间23:59:59 UTC
ZonedDateTime endOfDay = targetDay.atTime(LocalTime.MAX).atZone(ZoneOffset.UTC);
// 获取开始和结束时间戳
long startTimestamp = startOfDay.toInstant().toEpochMilli();
long endTimestamp = endOfDay.toInstant().toEpochMilli();
Map<String, Object> map = new HashMap<>();
map.put("beginTime", startTimestamp);
map.put("endTime", endTimestamp);
return map;
}
/**
*
*
* @param timestamp1
* @param timestamp2
* @return truefalse
*/
public static boolean isSameDay(long timestamp1, long timestamp2) {
// 将时间戳转换为 LocalDate
LocalDate date1 = Instant.ofEpochMilli(timestamp1)
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
.toLocalDate();
LocalDate date2 = Instant.ofEpochMilli(timestamp2)
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
.toLocalDate();
// 比较日期部分是否相同
return date1.isEqual(date2);
}
/**
* UTC java.util.Date
*
* @return java.util.Date UTC
*/
public static Date getUTCDate() {
// 获取 UTC 时区的当前时间
ZonedDateTime utcTime = ZonedDateTime.now(ZoneId.of("UTC"));
// 提取 UTC 时区的日期部分
ZonedDateTime utcDateTime = utcTime.toLocalDate().atStartOfDay(ZoneId.of("UTC"));
// 将 ZonedDateTime 转换为 java.util.Date
return Date.from(utcDateTime.toInstant());
}
/**
* LocalTime Date
*
* @param localTime LocalTime
* @return Date
*/
public static Date convertToDate(LocalTime localTime) {
// 使用当前日期作为参考日期
LocalDate today = LocalDate.now();
// 将 LocalTime 和 LocalDate 结合成 LocalDateTime
LocalDateTime localDateTime = LocalDateTime.of(today, localTime);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String format = localDateTime.format(formatter);
// 将 LocalDateTime 转换为 Date
return DateUtils.parseDate(format);
}
/**
*
*
* @param value
* @param minValue
* @param maxValue
* @return
*/
public static boolean isBetween(Long value, Long minValue, Long maxValue) {
return value >= minValue && value <= maxValue;
}
}

View File

@ -0,0 +1,46 @@
package com.ff.utils;
import cn.hutool.core.lang.UUID;
/**
* ID
*
* @author ff
*/
public class IdUtils {
/**
* UUID
*
* @return UUID
*/
public static String randomUUID() {
return UUID.randomUUID().toString();
}
/**
* UUID线
*
* @return UUID线
*/
public static String simpleUUID() {
return UUID.randomUUID().toString(true);
}
/**
* UUID使ThreadLocalRandomUUID
*
* @return UUID
*/
public static String fastUUID() {
return UUID.fastUUID().toString();
}
/**
* UUID线使ThreadLocalRandomUUID
*
* @return UUID线
*/
public static String fastSimpleUUID() {
return UUID.fastUUID().toString(true);
}
}

View File

@ -0,0 +1,657 @@
package com.ff.utils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
/**
*
*
* @author ff
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
*
*/
private static final String NULLSTR = "";
/**
* 线
*/
private static final char SEPARATOR = '_';
/**
*
*/
private static final char ASTERISK = '*';
/**
*
*
* @param value defaultValue value
* @return value
*/
public static <T> T nvl(T value, T defaultValue) {
return value != null ? value : defaultValue;
}
/**
* * Collection ListSetQueue
*
* @param coll Collection
* @return true false
*/
public static boolean isEmpty(Collection<?> coll) {
return isNull(coll) || coll.isEmpty();
}
/**
* * CollectionListSetQueue
*
* @param coll Collection
* @return true false
*/
public static boolean isNotEmpty(Collection<?> coll) {
return !isEmpty(coll);
}
/**
* *
*
* @param objects
* * @return true false
*/
public static boolean isEmpty(Object[] objects) {
return isNull(objects) || (objects.length == 0);
}
/**
* *
*
* @param objects
* @return true false
*/
public static boolean isNotEmpty(Object[] objects) {
return !isEmpty(objects);
}
/**
* * Map
*
* @param map Map
* @return true false
*/
public static boolean isEmpty(Map<?, ?> map) {
return isNull(map) || map.isEmpty();
}
/**
* * Map
*
* @param map Map
* @return true false
*/
public static boolean isNotEmpty(Map<?, ?> map) {
return !isEmpty(map);
}
/**
* *
*
* @param str String
* @return true false
*/
public static boolean isEmpty(String str) {
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* *
*
* @param str String
* @return true false
*/
public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
/**
* *
*
* @param object Object
* @return true false
*/
public static boolean isNull(Object object) {
return object == null;
}
/**
* *
*
* @param object Object
* @return true false
*/
public static boolean isNotNull(Object object) {
return !isNull(object);
}
/**
* * Java
*
* @param object
* @return true false
*/
public static boolean isArray(Object object) {
return isNotNull(object) && object.getClass().isArray();
}
/**
*
*/
public static String trim(String str) {
return (str == null ? "" : str.trim());
}
/**
* "*"
*
* @param str
* @param startInclude
* @param endExclude
* @return
*/
public static String hide(CharSequence str, int startInclude, int endExclude) {
if (isEmpty(str)) {
return NULLSTR;
}
final int strLength = str.length();
if (startInclude > strLength) {
return NULLSTR;
}
if (endExclude > strLength) {
endExclude = strLength;
}
if (startInclude > endExclude) {
// 如果起始位置大于结束位置,不替换
return NULLSTR;
}
final char[] chars = new char[strLength];
for (int i = 0; i < strLength; i++) {
if (i >= startInclude && i < endExclude) {
chars[i] = ASTERISK;
} else {
chars[i] = str.charAt(i);
}
}
return new String(chars);
}
/**
*
*
* @param str
* @param start
* @return
*/
public static String substring(final String str, int start) {
if (str == null) {
return NULLSTR;
}
if (start < 0) {
start = str.length() + start;
}
if (start < 0) {
start = 0;
}
if (start > str.length()) {
return NULLSTR;
}
return str.substring(start);
}
/**
*
*
* @param str
* @param start
* @param end
* @return
*/
public static String substring(final String str, int start, int end) {
if (str == null) {
return NULLSTR;
}
if (end < 0) {
end = str.length() + end;
}
if (start < 0) {
start = str.length() + start;
}
if (end > str.length()) {
end = str.length();
}
if (start > end) {
return NULLSTR;
}
if (start < 0) {
start = 0;
}
if (end < 0) {
end = 0;
}
return str.substring(start, end);
}
/**
*
*
* @param str value
* @return
*/
public static boolean hasText(String str) {
return (str != null && !str.isEmpty() && containsText(str));
}
private static boolean containsText(CharSequence str) {
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
}
return false;
}
// /**
// * 格式化文本, {} 表示占位符<br>
// * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
// * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
// * 例:<br>
// * 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
// * 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
// * 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
// *
// * @param template 文本模板,被替换的部分用 {} 表示
// * @param params 参数值
// * @return 格式化后的文本
// */
// public static String format(String template, Object... params) {
// if (isEmpty(params) || isEmpty(template)) {
// return template;
// }
// return StrFormatter.format(template, params);
// }
// /**
// * 是否为http(s)://开头
// *
// * @param link 链接
// * @return 结果
// */
// public static boolean ishttp(String link) {
// return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
// }
/**
* set
*
* @param str
* @param sep
* @return set
*/
public static final Set<String> str2Set(String str, String sep) {
return new HashSet<String>(str2List(str, sep, true, false));
}
/**
* list
*
* @param str
* @param sep
* @param filterBlank
* @param trim
* @return list
*/
public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
List<String> list = new ArrayList<String>();
if (StringUtils.isEmpty(str)) {
return list;
}
// 过滤空白字符串
if (filterBlank && StringUtils.isBlank(str)) {
return list;
}
String[] split = str.split(sep);
for (String string : split) {
if (filterBlank && StringUtils.isBlank(string)) {
continue;
}
if (trim) {
string = string.trim();
}
list.add(string);
}
return list;
}
/**
* collectionarray arrayvalue
*
* @param collection
* @param array
* @return boolean
*/
public static boolean containsAny(Collection<String> collection, String... array) {
if (isEmpty(collection) || isEmpty(array)) {
return false;
} else {
for (String str : array) {
if (collection.contains(str)) {
return true;
}
}
return false;
}
}
/**
*
*
* @param cs
* @param searchCharSequences
* @return
*/
public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
if (isEmpty(cs) || isEmpty(searchCharSequences)) {
return false;
}
for (CharSequence testStr : searchCharSequences) {
if (containsIgnoreCase(cs, testStr)) {
return true;
}
}
return false;
}
/**
* 线
*/
public static String toUnderScoreCase(String str) {
if (str == null) {
return null;
}
StringBuilder sb = new StringBuilder();
// 前置字符是否大写
boolean preCharIsUpperCase = true;
// 当前字符是否大写
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (i > 0) {
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
} else {
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < (str.length() - 1)) {
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
sb.append(SEPARATOR);
} else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
/**
*
*
* @param str
* @param strs
* @return true
*/
public static boolean inStringIgnoreCase(String str, String... strs) {
if (str != null && strs != null) {
for (String s : strs) {
if (str.equalsIgnoreCase(trim(s))) {
return true;
}
}
}
return false;
}
/**
* 线线 HELLO_WORLD->HelloWorld
*
* @param name 线
* @return
*/
public static String convertToCamelCase(String name) {
StringBuilder result = new StringBuilder();
// 快速检查
if (name == null || name.isEmpty()) {
// 没必要转换
return "";
} else if (!name.contains("_")) {
// 不含下划线,仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
for (String camel : camels) {
// 跳过原始字符串中开头、结尾的下换线或双重下划线
if (camel.isEmpty()) {
continue;
}
// 首字母大写
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
return result.toString();
}
/**
*
* user_name->userName
*/
public static String toCamelCase(String s) {
if (s == null) {
return null;
}
if (s.indexOf(SEPARATOR) == -1) {
return s;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == SEPARATOR) {
upperCase = true;
} else if (upperCase) {
sb.append(Character.toUpperCase(c));
upperCase = false;
} else {
sb.append(c);
}
}
return sb.toString();
}
// /**
// * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
// *
// * @param str 指定字符串
// * @param strs 需要检查的字符串数组
// * @return 是否匹配
// */
// public static boolean matches(String str, List<String> strs) {
// if (isEmpty(str) || isEmpty(strs)) {
// return false;
// }
// for (String pattern : strs) {
// if (isMatch(pattern, str)) {
// return true;
// }
// }
// return false;
// }
// /**
// * 判断url是否与规则配置:
// * ? 表示单个字符;
// * * 表示一层路径内的任意字符串,不可跨层级;
// * ** 表示任意层路径;
// *
// * @param pattern 匹配规则
// * @param url 需要匹配的url
// * @return
// */
// public static boolean isMatch(String pattern, String url) {
// AntPathMatcher matcher = new AntPathMatcher();
// return matcher.match(pattern, url);
// }
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj) {
return (T) obj;
}
/**
* 0使size size
*
* @param num
* @param size
* @return
*/
public static final String padl(final Number num, final int size) {
return padl(num.toString(), size, '0');
}
/**
* ssizesize
*
* @param s
* @param size
* @param c
* @return
*/
public static final String padl(final String s, final int size, final char c) {
final StringBuilder sb = new StringBuilder(size);
if (s != null) {
final int len = s.length();
if (s.length() <= size) {
for (int i = size - len; i > 0; i--) {
sb.append(c);
}
sb.append(s);
} else {
return s.substring(len - size, len);
}
} else {
for (int i = size; i > 0; i--) {
sb.append(c);
}
}
return sb.toString();
}
/**
*
*
* @param code
* @param suffix
* @return {@link String }
*/
public static String addSuffix(String code, Object suffix) {
return code +"_"+ suffix;
}
/**
*
*
* @param original
* @return
*/
public static String removeLastOccurrence(String original, String suffix) {
// 查找位置
if (original.endsWith(suffix)) {
return original.substring(0, original.length() - suffix.length());
}
return original;
}
/**
*
*
* @param prefix "PG"
* @param length
* @return
*/
public static String generateOrderId(String prefix, int length) {
if (length <= prefix.length()) {
throw new IllegalArgumentException("订单号长度必须大于前缀长度");
}
// 获取当前时间戳
long timestamp = System.currentTimeMillis();
// 使用UUID生成一个随机的字符串并去掉 "-"
String randomString = UUID.randomUUID().toString().replace("-", "");
// 拼接时间戳和随机字符串
String source = prefix + timestamp + randomString;
// 截取指定长度的部分(确保符合需求的长度)
String orderId = getMD5Hash(source).substring(0, length - prefix.length());
return prefix + orderId;
}
/**
* 使MD5
*
* @param source
* @return
*/
private static String getMD5Hash(String source) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digest = md.digest(source.getBytes());
StringBuilder hexString = new StringBuilder();
// 转换为16进制
for (byte b : digest) {
String hex = Integer.toHexString(0xFF & b);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex);
}
return hexString.toString(); // 返回32位MD5哈希
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -0,0 +1,66 @@
package com.ff.enums;
import lombok.Getter;
import java.util.Optional;
import java.util.stream.Stream;
/**
*
*
* @author shi
* @date 2025/02/19
*/
@Getter
public enum ErrorCode {
ERROR(500, "业务异常"),
GAME_ACCOUNT_CREATION_FAILED(1001, "当前游戏账号已存在"),
ACCOUNT_NOT_EXIST(1002, "当前游戏账号不存在"),
PLATFORM_NOT_EXIST(1003, "游戏平台不存在"),
CURRENCY_NOT_EXIST(1004, "游戏平台不支持的货币"),
GAME_NOT_EXIST(1005, "游戏不存在"),
CURRENCY_EXCHANGE(1006, "不支持币种的汇率"),
FREQUENT_INTERFACE_REQUESTS(1007, "接口请求频繁"),
BALANCE_TRANSFER_FAILED(1008, "余额转移失败"),
LANG_NOT_EXIST(1009, "游戏平台不支持的语言"),
ORDER_NOT_EXIST(1010, "订单不存在"),
PLAYERS_ARE_PLAYING(1011, "玩家游玩中"),
INSUFFICIENT_PLAYER_BALANCE(1012, "玩家余额不足"),
KICK_OUT_AILED(1013, "玩家踢出失败"),
ACCOUNT_NOT_ONLINE(1014, "账号不在线"),
FREQUENT_BALANCE_TRANSFER(1015, "当前游戏账号余额转移频繁"),
PLATFORM_NOT_METHODS(1016, "游戏平台不支持的方法"),
Create_Member_Failure(1017, "创建会员失败"),
Transfer_In_Failure(1018, "转入失败"),
Transfer_Out_Failure(1019, "转出失败"),
Get_Member_Info_Failure(1020, "获取会员信息失败"),
Transfer_Not_Exist(1021, "转帐操作不存在"),
Get_Url_Failure(1022, "获取URL失败"),
Miss_Config(1023, "缺少配置"),
;
// 获取错误码
private final int code;
// 获取错误信息
private final String message;
// 构造函数
ErrorCode(int code, String message) {
this.code = code;
this.message = message;
}
/**
*
*
* @param code
* @return {@link String }
*/
public static String findByCode(Integer code) {
Optional<String> system = Stream.of(ErrorCode.values())
.filter(errorCode -> errorCode.getCode() == code)
.map(ErrorCode::getMessage)
.findFirst();
return system.orElse(null);
}
}

View File

@ -0,0 +1,31 @@
package com.ff.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
*
* @author shi
* @date 2025/03/25
*/
@Getter
@AllArgsConstructor
public enum PlatformType {
ELECTRONIC(1, "电子"),
CARD_GAME(2, "棋牌"),
GAME_HALL(3, "游戏大厅"),
FISHING(4, "捕鱼"),
BETTING_MACHINE(5, "押分机 (含宾果)"),
VIDEO(6, "视讯"),
LOTTERY(7, "彩票"),
SPORTS(8, "体育"),
HUNTING(9, "捕猎"),
BaiRen(10, "百人场");
private final int code;
private final String name;
}

View File

@ -0,0 +1,24 @@
package com.ff.enums;
import lombok.Getter;
/**
*
*
* @author shi
* @date 2025/03/12
*/
@Getter
public enum StatusType {
IN_PROGRESS(0, "进行中"),
SUCCESS(1, "成功"),
FAILURE(2, "失败");
private final Integer value;
private final String description;
StatusType(Integer value, String description) {
this.value = value;
this.description = description;
}
}

View File

@ -1,72 +0,0 @@
package com.ff.agent.mapper;
import com.ff.agent.domain.TenantAgentInviteRegister;
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
import java.util.List;
/**
* Mapper
*
* @author shi
* @date 2025-02-25
*/
public interface TenantAgentInviteRegisterMapper
{
/**
*
*
* @param id
* @return
*/
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
/**
* dto
*
* @param tenantAgentInviteRegisterDTO dto
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
*/
List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param tenantAgentInviteRegister
* @return
*/
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
/**
*
*
* @param id
* @return
*/
int deleteTenantAgentInviteRegisterById(Long id);
/**
*
*
* @param ids
* @return
*/
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
}

View File

@ -1,8 +1,9 @@
package com.ff.agent.service;
import com.ff.agent.domain.TenantAgentCommission;
import java.math.BigDecimal;
import java.util.List;
import com.ff.agent.domain.TenantAgentCommission;
/**
* Service

View File

@ -1,8 +1,9 @@
package com.ff.agent.service;
import java.util.List;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.agent.service;
import java.util.List;
import com.ff.agent.domain.TenantAgentInvite;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.agent.service;
import java.util.List;
import com.ff.agent.domain.TenantAgentWithdrawal;
import java.util.List;
/**
* Service
*

View File

@ -1,15 +1,15 @@
package com.ff.agent.service.impl;
import java.math.BigDecimal;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentCommission;
import com.ff.agent.mapper.TenantAgentCommissionMapper;
import com.ff.agent.service.ITenantAgentCommissionService;
import com.ff.base.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.agent.mapper.TenantAgentCommissionMapper;
import com.ff.agent.domain.TenantAgentCommission;
import com.ff.agent.service.ITenantAgentCommissionService;
import java.math.BigDecimal;
import java.util.List;
/**
* Service

View File

@ -1,13 +1,14 @@
package com.ff.agent.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
import com.ff.agent.service.ITenantAgentInvitePlatformService;
import com.ff.base.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
import com.ff.agent.domain.TenantAgentInvitePlatform;
import com.ff.agent.service.ITenantAgentInvitePlatformService;
import cn.hutool.core.util.IdUtil;
import java.util.List;
/**

View File

@ -1,18 +1,16 @@
package com.ff.agent.service.impl;
import java.util.Collections;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInviteRegister;
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
import com.ff.agent.service.ITenantAgentInviteRegisterService;
import com.ff.base.utils.DateUtils;
import com.ff.base.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*

View File

@ -1,17 +1,17 @@
package com.ff.agent.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentInvite;
import com.ff.agent.mapper.TenantAgentInviteMapper;
import com.ff.agent.service.ITenantAgentInviteService;
import com.ff.base.utils.DateUtils;
import com.ff.base.utils.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.agent.mapper.TenantAgentInviteMapper;
import com.ff.agent.domain.TenantAgentInvite;
import com.ff.agent.service.ITenantAgentInviteService;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* Service
*

View File

@ -1,13 +1,14 @@
package com.ff.agent.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.agent.domain.TenantAgentWithdrawal;
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
import com.ff.agent.service.ITenantAgentWithdrawalService;
import com.ff.base.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
import com.ff.agent.domain.TenantAgentWithdrawal;
import com.ff.agent.service.ITenantAgentWithdrawalService;
import cn.hutool.core.util.IdUtil;
import java.util.List;
/**

View File

@ -1,8 +1,9 @@
package com.ff.common.service;
import java.util.List;
import com.ff.common.domain.Currency;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.common.service;
import java.util.List;
import com.ff.common.domain.Lang;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.common.service;
import java.util.List;
import com.ff.common.domain.TenantAgentPlatform;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.common.service;
import com.ff.common.domain.TenantGameQuotaFlow;
import java.math.BigDecimal;
import java.util.List;
import com.ff.common.domain.TenantGameQuotaFlow;
/**
* Service

View File

@ -1,14 +1,12 @@
package com.ff.common.service;
import java.math.BigDecimal;
import java.util.List;
import com.ff.agent.dto.AgentCreateTenantDTO;
import com.ff.common.domain.TenantGameQuota;
import com.ff.common.dto.BalanceChangesDTO;
import com.ff.common.dto.BalanceRealChangesDTO;
import com.ff.common.dto.GameBalanceExchange;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* Service

View File

@ -1,8 +1,8 @@
package com.ff.common.service;
import java.util.List;
import com.ff.common.domain.TenantQuotaExchange;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
/**
* Service

View File

@ -1,14 +1,14 @@
package com.ff.common.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.common.domain.Currency;
import com.ff.common.mapper.CurrencyMapper;
import com.ff.common.service.ICurrencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.common.mapper.CurrencyMapper;
import com.ff.common.domain.Currency;
import com.ff.common.service.ICurrencyService;
import java.util.List;
/**
* Service

View File

@ -1,14 +1,14 @@
package com.ff.common.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.common.domain.Lang;
import com.ff.common.mapper.LangMapper;
import com.ff.common.service.ILangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.common.mapper.LangMapper;
import com.ff.common.domain.Lang;
import com.ff.common.service.ILangService;
import java.util.List;
/**
* Service

View File

@ -1,13 +1,14 @@
package com.ff.common.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.common.domain.TenantAgentPlatform;
import com.ff.tenant.mapper.TenantAgentPlatformMapper;
import com.ff.common.service.ITenantAgentPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.common.mapper.TenantAgentPlatformMapper;
import com.ff.common.domain.TenantAgentPlatform;
import com.ff.common.service.ITenantAgentPlatformService;
import cn.hutool.core.util.IdUtil;
import java.util.List;
/**

View File

@ -1,15 +1,15 @@
package com.ff.common.service.impl;
import java.math.BigDecimal;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.common.domain.TenantGameQuotaFlow;
import com.ff.tenant.mapper.TenantGameQuotaFlowMapper;
import com.ff.common.service.ITenantGameQuotaFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.common.mapper.TenantGameQuotaFlowMapper;
import com.ff.common.domain.TenantGameQuotaFlow;
import com.ff.common.service.ITenantGameQuotaFlowService;
import java.math.BigDecimal;
import java.util.List;
/**
* Service

View File

@ -17,7 +17,7 @@ import com.ff.common.domain.TenantQuotaExchange;
import com.ff.common.dto.BalanceChangesDTO;
import com.ff.common.dto.BalanceRealChangesDTO;
import com.ff.common.dto.GameBalanceExchange;
import com.ff.common.mapper.TenantGameQuotaMapper;
import com.ff.tenant.mapper.TenantGameQuotaMapper;
import com.ff.common.service.ITenantGameQuotaFlowService;
import com.ff.common.service.ITenantGameQuotaService;
import com.ff.common.service.ITenantQuotaExchangeService;

View File

@ -1,14 +1,14 @@
package com.ff.common.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.common.domain.TenantQuotaExchange;
import com.ff.tenant.mapper.TenantQuotaExchangeMapper;
import com.ff.common.service.ITenantQuotaExchangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.common.mapper.TenantQuotaExchangeMapper;
import com.ff.common.domain.TenantQuotaExchange;
import com.ff.common.service.ITenantQuotaExchangeService;
import java.util.List;
/**
* Service

View File

@ -1,11 +1,9 @@
package com.ff.game.service;
import java.util.List;
import com.ff.game.domain.Game;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.dto.GameBettingDetailsDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Service

View File

@ -1,11 +1,10 @@
package com.ff.game.service;
import java.util.List;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.domain.GameExchangeMoney;
import com.ff.game.dto.GameExchangeMoneyDTO;
import java.util.List;
/**
* Service
*

View File

@ -1,8 +1,9 @@
package com.ff.game.service;
import java.util.List;
import com.ff.game.domain.GameFreeRecord;
import java.util.List;
/**
* Service
*

View File

@ -1,16 +1,15 @@
package com.ff.game.service.impl;
import java.util.Collections;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.dto.GameBettingDetailsDTO;
import com.ff.game.mapper.GameBettingDetailsMapper;
import com.ff.game.service.IGameBettingDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.game.mapper.GameBettingDetailsMapper;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.service.IGameBettingDetailsService;
import java.util.List;
/**
* Service

View File

@ -1,20 +1,18 @@
package com.ff.game.service.impl;
import java.util.Collections;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.enums.GamePlatforms;
import com.ff.base.utils.DateUtils;
import com.ff.base.utils.StringUtils;
import com.ff.game.domain.GameExchangeMoney;
import com.ff.game.dto.GameExchangeMoneyDTO;
import com.ff.game.mapper.GameExchangeMoneyMapper;
import com.ff.game.service.IGameExchangeMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.game.mapper.GameExchangeMoneyMapper;
import com.ff.game.domain.GameExchangeMoney;
import com.ff.game.service.IGameExchangeMoneyService;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* Service
*

View File

@ -1,14 +1,14 @@
package com.ff.game.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.utils.DateUtils;
import com.ff.game.domain.GameFreeRecord;
import com.ff.game.mapper.GameFreeRecordMapper;
import com.ff.game.service.IGameFreeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.game.mapper.GameFreeRecordMapper;
import com.ff.game.domain.GameFreeRecord;
import com.ff.game.service.IGameFreeRecordService;
import java.util.List;
/**
* Service

View File

@ -1,11 +1,11 @@
package com.ff.game.service.impl;
import com.ff.base.constant.CacheConstants;
import com.ff.base.core.redis.RedisCache;
import com.ff.base.datasource.DynamicDataSourceContextHolder;
import com.ff.game.domain.Platform;
import com.ff.game.mapper.PlatformMapper;
import com.ff.game.service.IPlatformService;
import com.ff.redis.GRedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,10 +21,8 @@ public class PlatformServiceImpl implements IPlatformService {
@Autowired
PlatformMapper platformMapper;
@Autowired
GRedisCache gRedisCache;
RedisCache redisCache;
@Override
public List<Platform> selectList(Platform platform) {
@ -65,14 +63,14 @@ public class PlatformServiceImpl implements IPlatformService {
DynamicDataSourceContextHolder.setDataSourceType(key.toString());
List<Platform> list = selectList(new Platform());
for (Platform pp : list) {
gRedisCache.setCacheObject(getCacheKey(pp.getPlatformCode()), pp);
redisCache.setCacheObject(getCacheKey(pp.getPlatformCode()), pp);
}
}
}
@Override
public Platform get(String platformCode) {
return gRedisCache.getCacheObject(getCacheKey(platformCode));
return redisCache.getCacheObject(getCacheKey(platformCode));
}
private String getCacheKey(String configKey) {

View File

@ -1,8 +1,9 @@
package com.ff.member.service;
import java.util.List;
import com.ff.member.domain.Member;
import java.util.List;
/**
* Service
*

View File

@ -1,19 +1,18 @@
package com.ff.member.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ff.base.enums.GamePlatforms;
import com.ff.base.enums.PlatformType;
import com.ff.base.utils.DateUtils;
import com.ff.base.utils.RandomGeneratorUtils;
import com.ff.member.domain.Member;
import com.ff.member.mapper.MemberMapper;
import com.ff.member.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.member.mapper.MemberMapper;
import com.ff.member.domain.Member;
import com.ff.member.service.IMemberService;
import org.springframework.util.ObjectUtils;
import java.util.List;
/**
* Service
*

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ff.common.mapper.TenantAgentPlatformMapper">
<mapper namespace="com.ff.tenant.mapper.TenantAgentPlatformMapper">
<resultMap type="TenantAgentPlatform" id="TenantAgentPlatformResult">
<result property="id" column="id" />

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ff.common.mapper.TenantGameQuotaFlowMapper">
<mapper namespace="com.ff.tenant.mapper.TenantGameQuotaFlowMapper">
<resultMap type="TenantGameQuotaFlow" id="TenantGameQuotaFlowResult">
<result property="id" column="id"/>
<result property="tenantKey" column="tenant_key"/>

Some files were not shown because too many files have changed in this diff Show More