| | |
| | | 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.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author |
| | | * @author |
| | | * @date 2022-03-21 |
| | | **/ |
| | | @Controller("dappView") |
| | |
| | | public class ViewController { |
| | | |
| | | private final RedisUtils redisUtils; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @GetMapping(value = "admin") |
| | | @RequiresPermissions("admin:view") |
| | |
| | | |
| | | @GetMapping(value = "admin/simulateResult/{batch}") |
| | | public String simulateResult(@PathVariable("batch") String batch, Model model) { |
| | | String url = "https://antethvip.com/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"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping(value ="priceSetting") |
| | | @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 rebateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.REBATE_PERCENT.getType(), DataDictionaryEnum.REBATE_PERCENT.getCode()); |
| | | if (ObjectUtil.isNotEmpty(rebateDic)) { |
| | | String value = rebateDic.getValue() == null ? "0" : rebateDic.getValue(); |
| | | adminSystemFeeVo.setRebatePercent(value); |
| | | } |
| | | DataDictionaryCustom memberFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_FEE.getType(), DataDictionaryEnum.MEMBER_FEE.getCode()); |
| | | if (ObjectUtil.isNotEmpty(memberFeeDic)) { |
| | | String value = memberFeeDic.getValue() == null ? "0" : memberFeeDic.getValue(); |
| | | adminSystemFeeVo.setMemberFee(value); |
| | | } |
| | | DataDictionaryCustom serviceFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getType(), DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getCode()); |
| | | if (ObjectUtil.isNotEmpty(serviceFeeDic)) { |
| | | String value = serviceFeeDic.getValue() == null ? "0" : serviceFeeDic.getValue(); |
| | | adminSystemFeeVo.setServiceFee(value); |
| | | } |
| | | |
| | | DataDictionaryCustom symbolPrice = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SYMBOL_PRICE.getType(), DataDictionaryEnum.SYMBOL_PRICE.getCode()); |
| | | if (ObjectUtil.isNotEmpty(symbolPrice)) { |
| | | String value = symbolPrice.getValue() == null ? "0" : symbolPrice.getValue(); |
| | | adminSystemFeeVo.setSymbolPrice(value); |
| | | } |
| | | model.addAttribute("systemFee", adminSystemFeeVo); |
| | | return FebsUtil.view("dapp/system-fee-set"); |
| | | } |
| | | } |