|
|
|
@ -87,7 +87,8 @@ public class ExportController { |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportRecharge(dto); |
|
|
|
@ -117,7 +118,8 @@ public class ExportController { |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportRefund(dto); |
|
|
|
@ -153,14 +155,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportLive") |
|
|
|
public Result export(@Valid @RequestBody LiveDTO dto) { |
|
|
|
public Result export(@Valid @RequestBody LiveDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang) { |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportLive(dto); |
|
|
|
@ -171,14 +174,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportFan") |
|
|
|
public Result export(@Valid @RequestBody FanDTO dto){ |
|
|
|
public Result export(@Valid @RequestBody FanDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang){ |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportFan(dto); |
|
|
|
@ -189,14 +193,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportArticle") |
|
|
|
public Result export(@Valid @RequestBody ArticleDTO dto){ |
|
|
|
public Result export(@Valid @RequestBody ArticleDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang){ |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportArticle(dto); |
|
|
|
@ -207,14 +212,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportBean") |
|
|
|
public Result export(@Valid @RequestBody BeanRechargeDTO dto){ |
|
|
|
public Result export(@Valid @RequestBody BeanRechargeDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang){ |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportBean(dto); |
|
|
|
@ -225,14 +231,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportol") |
|
|
|
public Result exportol(@Valid @RequestBody OnlineDTO dto) throws Exception { |
|
|
|
public Result exportol(@Valid @RequestBody OnlineDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang) throws Exception { |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportOnline(dto); |
|
|
|
@ -246,14 +253,15 @@ public class ExportController { |
|
|
|
* 负责人退款导出 |
|
|
|
*/ |
|
|
|
@PostMapping("/exportFinance") |
|
|
|
public Result exportFinance(@Valid @RequestBody FinanceDTO dto) { |
|
|
|
public Result exportFinance(@Valid @RequestBody FinanceDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang) { |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportFinance(dto); |
|
|
|
@ -264,14 +272,15 @@ public class ExportController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/exportCash") |
|
|
|
public Result exportCash(@Valid @RequestBody CashDTO dto) { |
|
|
|
public Result exportCash(@Valid @RequestBody CashDTO dto, @RequestHeader(defaultValue = "zh_CN") String lang) { |
|
|
|
String lockKey = "export:lock:" + dto.getToken(); |
|
|
|
String requestId = UUID.randomUUID().toString(); |
|
|
|
long expireTime = 5000; |
|
|
|
try { |
|
|
|
// 尝试获取锁 |
|
|
|
if (!redisLockUtil.tryLock(lockKey, requestId, expireTime)) { |
|
|
|
throw new BusinessException("操作太频繁,请稍后重试"); |
|
|
|
String errorMsg = languageTranslationUtil.translate("操作太频繁,请稍后重试", lang); |
|
|
|
throw new BusinessException(errorMsg); |
|
|
|
} |
|
|
|
// 执行业务逻辑 |
|
|
|
return exportService.addExportCash(dto); |
|
|
|
|