| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.DataDicEnum; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.entity.DappCoinPrice; |
| | | import cc.mrbird.febs.dapp.entity.DappHdRecord; |
| | | import cc.mrbird.febs.dapp.entity.PlatformBanner; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.service.IAdminBannerService; |
| | | import cc.mrbird.febs.dapp.vo.CoinSetVo; |
| | | import cc.mrbird.febs.rabbit.producer.ChainProducer; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | private final IAdminBannerService iAdminBannerService; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final RedisUtils redisUtils; |
| | | private final DappSystemService dappSystemService; |
| | | private final ChainProducer chainProducer; |
| | | |
| | | /** |
| | | * 价格---列表 |
| | |
| | | @GetMapping("coinPrice") |
| | | public FebsResponse coinPrice(DappCoinPrice dappCoinPrice, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(iAdminBannerService.findCoinPriceInPage(dappCoinPrice, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 价格---列表 |
| | | */ |
| | | @GetMapping("hdRecord") |
| | | public FebsResponse hdRecord(DappHdRecord dappHdRecord, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(iAdminBannerService.findHdRecordInPage(dappHdRecord, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | |
| | | public FebsResponse platformBannerAdds(@Valid PlatformBanner platformBannerEntity) { |
| | | iAdminBannerService.platformBannerAdd(platformBannerEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/hdSubmit") |
| | | @ControllerEndpoint(operation = "滑点释放", exceptionMessage = "操作失败") |
| | | public FebsResponse hdSubmit() { |
| | | log.info("滑点奖励"); |
| | | BigDecimal usdtAmount = new BigDecimal( |
| | | redisUtils.getString(DataDicEnum.GFA_HUA_DIAN_WALLET_USDT_AMOUNT.getValue()) |
| | | ).setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal coinAmount = new BigDecimal( |
| | | redisUtils.getString(DataDicEnum.GFA_HUA_DIAN_WALLET_COIN_AMOUNT.getValue()) |
| | | ).setScale(2,BigDecimal.ROUND_DOWN); |
| | | if(BigDecimal.ZERO.compareTo(usdtAmount) > 0){ |
| | | return new FebsResponse().fail().message("请设置钱包USDT"); |
| | | } |
| | | if(BigDecimal.ZERO.compareTo(coinAmount) > 0){ |
| | | return new FebsResponse().fail().message("请设置钱包GFA"); |
| | | } |
| | | // dappSystemService.tradeProfitDistribute(1L); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/cashOutSetting") |
| | |
| | | DataDicEnum.GFA_DAYS.getValue(), |
| | | coinSetVo.getGfaDays() |
| | | ); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode( |
| | | DataDicEnum.MEMBER_ZHIYA_TIME.getValue(), |
| | | DataDicEnum.MEMBER_ZHIYA_TIME.getValue(), |
| | | coinSetVo.getZhiyaTime() |
| | | ); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode( |
| | | DataDicEnum.MEMBER_ZHIYA_AMOUNT.getValue(), |
| | | DataDicEnum.MEMBER_ZHIYA_AMOUNT.getValue(), |
| | | coinSetVo.getZhiyaAmount() |
| | | ); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |