From 17c94afc50e7957b8fd98413cdc9cbbdc4c7967a Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Thu, 18 Jul 2024 17:41:19 +0800 Subject: [PATCH] 逻辑 --- src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java b/src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java index 0f07765..9913912 100644 --- a/src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java +++ b/src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java @@ -1,7 +1,13 @@ package cc.mrbird.febs.dapp.controller; +import cc.mrbird.febs.common.contants.AppContants; import cc.mrbird.febs.common.entity.FebsConstant; import cc.mrbird.febs.common.utils.FebsUtil; +import cc.mrbird.febs.common.utils.RedisUtils; +import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; +import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; +import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; +import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo; import lombok.RequiredArgsConstructor; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; @@ -10,14 +16,19 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import java.math.BigDecimal; + /** - * @author wzy + * @author * @date 2022-03-21 **/ @Controller("dappView") @RequestMapping(FebsConstant.VIEW_PREFIX + "dappView") @RequiredArgsConstructor public class ViewController { + + private final RedisUtils redisUtils; + private final DataDictionaryCustomMapper dataDictionaryCustomMapper; @GetMapping(value = "admin") @RequiresPermissions("admin:view") @@ -45,7 +56,7 @@ @GetMapping(value = "admin/simulateResult/{batch}") public String simulateResult(@PathVariable("batch") String batch, Model model) { - String url = "http://120.27.238.55:8000/dapp/index.html?isDev=true&batchNo=" + batch; + String url = "https://birdworld.vip/index.html?isDev=true&batchNo=" + batch; model.addAttribute("url", url); return FebsUtil.view("dapp/simulate-result"); } @@ -100,4 +111,33 @@ return FebsUtil.view("dapp/agent-return"); } + + @GetMapping(value = "priceSetting") + @RequiresPermissions("price:setting:view") + public String priceSetting(Model model) { + BigDecimal price = (BigDecimal) redisUtils.get(AppContants.REDIS_KEY_ETH_NEW_PRICE); + model.addAttribute("newestPrice", price); + return FebsUtil.view("dapp/newest-price-setting"); + } + + //费率设置 + @GetMapping(value = "systemFeeSet") + @RequiresPermissions("fee:setting:view") + public String systemFeeSet(Model model) { + AdminSystemFeeVo adminSystemFeeVo = new AdminSystemFeeVo(); + + + DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( + DataDictionaryEnum.FEE_ADDRESS_KEY.getType(), + DataDictionaryEnum.FEE_ADDRESS_KEY.getCode()); + adminSystemFeeVo.setAddressKey(dataDictionaryCustom.getValue()); + + DataDictionaryCustom addressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( + DataDictionaryEnum.FEE_ADDRESS.getType(), + DataDictionaryEnum.FEE_ADDRESS.getCode()); + adminSystemFeeVo.setAddress(addressDic.getValue()); + + model.addAttribute("systemFee", adminSystemFeeVo); + return FebsUtil.view("dapp/system-fee-set"); + } } -- Gitblit v1.9.1