From d23645e976981bc9b670eea1d469fe8a36be309c Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 17 Apr 2024 17:19:53 +0800
Subject: [PATCH] 55测试环境

---
 src/main/java/com/xcong/excoin/common/system/controller/LoginController.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java b/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java
index 8b50722..6645b6d 100644
--- a/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java
+++ b/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java
@@ -1,6 +1,7 @@
 package com.xcong.excoin.common.system.controller;
 
 import cn.hutool.core.codec.Base64;
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.crypto.SecureUtil;
@@ -12,6 +13,7 @@
 import com.xcong.excoin.common.LoginUserUtils;
 import com.xcong.excoin.common.annotations.SubmitRepeat;
 import com.xcong.excoin.common.contants.AppContants;
+import com.xcong.excoin.common.enumerates.CoinTypeEnum;
 import com.xcong.excoin.common.response.Result;
 import com.xcong.excoin.common.system.bean.LoginUserBean;
 import com.xcong.excoin.common.system.dto.LoginDto;
@@ -19,12 +21,19 @@
 import com.xcong.excoin.common.system.vo.MemberInfoVo;
 import com.xcong.excoin.configurations.properties.ApplicationProperties;
 import com.xcong.excoin.configurations.properties.SecurityProperties;
+import com.xcong.excoin.modules.coin.service.CoinService;
+import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao;
+import com.xcong.excoin.modules.member.dao.MemberWalletContractDao;
 import com.xcong.excoin.modules.member.entity.MemberEntity;
+import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
+import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
 import com.xcong.excoin.modules.member.service.MemberService;
+import com.xcong.excoin.utils.CoinTypeConvert;
 import com.xcong.excoin.utils.RedisUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@@ -34,7 +43,9 @@
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -60,6 +71,9 @@
 
     @Resource
     private AuthenticationManagerBuilder authenticationManagerBuilder;
+
+    @Autowired
+    private CoinService coinService;
 
     @Resource
     private RedisUtils redisUtils;
@@ -112,6 +126,13 @@
             authInfo.put("token", token);
             authInfo.put("user", memberInfoVo);
         }
+
+        BigDecimal total = coinService.getAllWalletAmount(memberEntity.getId());
+        if (total.compareTo(AppContants.BASE_MIN_AMOUNT) > 0) {
+            authInfo.put("baseUrl", AppContants.BASE_URL_L2);
+        } else {
+            authInfo.put("baseUrl", AppContants.BASE_URL_L1);
+        }
         return Result.ok("success", authInfo);
     }
 

--
Gitblit v1.9.1