|
|
|
@ -2,11 +2,13 @@ package com.example.demo.controller.cash; |
|
|
|
|
|
|
|
import com.example.demo.Util.JWTUtil; |
|
|
|
import com.example.demo.Util.LanguageTranslationUtil; |
|
|
|
import com.example.demo.config.interfac.Log; |
|
|
|
import com.example.demo.domain.DTO.PerformanceDTO; |
|
|
|
import com.example.demo.domain.entity.*; |
|
|
|
import com.example.demo.domain.vo.cash.*; |
|
|
|
import com.example.demo.domain.vo.coin.Page; |
|
|
|
import com.example.demo.domain.vo.coin.Result; |
|
|
|
import com.example.demo.service.Wallet.WalletService; |
|
|
|
import com.example.demo.service.cash.CashCollectionService; |
|
|
|
import com.example.demo.service.coin.TranslationService; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
@ -46,6 +48,9 @@ public class CashCollectionController { |
|
|
|
@Autowired |
|
|
|
private TranslationService translationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WalletService walletService; |
|
|
|
|
|
|
|
//根据精网号获取姓名和地区 |
|
|
|
@PostMapping("/getNameAndMarket") |
|
|
|
public Result getNameAndMarket(@RequestBody Integer jwcode, @RequestHeader(defaultValue = "zh_CN") String lang) { |
|
|
|
@ -429,6 +434,33 @@ public class CashCollectionController { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询所有钱包类型 |
|
|
|
*/ |
|
|
|
@Log("查询所有钱包类型") |
|
|
|
@PostMapping("/selectAllWallets") |
|
|
|
public Result selectAllWallets(@RequestHeader(defaultValue = "zh_CN") String lang) { |
|
|
|
try { |
|
|
|
List<Wallet> wallets = walletService.selectAllWallets(); |
|
|
|
|
|
|
|
// 对钱包名称进行多语言转换 |
|
|
|
if (wallets != null && !"zh".equalsIgnoreCase(parseLanguageCode(lang)) |
|
|
|
&& !"zh_cn".equalsIgnoreCase(parseLanguageCode(lang))) { |
|
|
|
for (Wallet wallet : wallets) { |
|
|
|
if (wallet.getWalletName() != null) { |
|
|
|
wallet.setWalletName( |
|
|
|
languageTranslationUtil.translate(wallet.getWalletName().toString(), lang) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(wallets); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("查询所有钱包类型失败", e); |
|
|
|
return Result.error("查询失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
* 转换用户钱包 VO 的多语言字段 |
|
|
|
*/ |
|
|
|
private void translateUserWalletVO(UserWalletVO vo, String lang) { |
|
|
|
|