| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.EncryptEnable; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.dapp.dto.ApproveDto; |
| | | import cc.mrbird.febs.dapp.dto.ConnectDto; |
| | | import cc.mrbird.febs.dapp.dto.SystemDto; |
| | | import cc.mrbird.febs.dapp.chain.TrxUsdtUpdateService; |
| | | import cc.mrbird.febs.dapp.dto.*; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.service.DappSimulateDataService; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.vo.SimulateDataVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @author |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RequiredArgsConstructor |
| | | @CrossOrigin("*") |
| | | @RestController |
| | |
| | | return new FebsResponse().success().data(dappSystemService.findTotalInComeAndList()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "系统参数", notes = "系统参数") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = SystemDto.class) |
| | | }) |
| | | @GetMapping(value = "/system") |
| | | public FebsResponse system() { |
| | | return new FebsResponse().success().data(dappSystemService.system()); |
| | | @PostMapping(value = "/encrypt") |
| | | public FebsResponse encryptTest(@RequestBody EncryptDto encryptDto) { |
| | | System.out.println(encryptDto.getTest()); |
| | | return new FebsResponse().success().data("123"); |
| | | } |
| | | |
| | | // @ApiOperation(value = "全局设置", notes = "全局设置") |
| | | // @GetMapping(value = "/globalSetting") |
| | | // public FebsResponse globalSetting() { |
| | | // return new FebsResponse().success().data(dappSystemService.globalSetting()); |
| | | // } |
| | | @ApiOperation(value = "IGT获取验证码", notes = "获取验证码") |
| | | @GetMapping("/captcha") |
| | | public FebsResponse captcha() throws IOException { |
| | | return dappMemberService.captchaCreator(); |
| | | } |
| | | |
| | | // @ApiOperation(value = "获取模拟数据", notes = "获取模拟数据") |
| | | // @GetMapping(value = "/findSimulateData/{batchNo}") |
| | | // public FebsResponse findSimulateData(@PathVariable("batchNo") String batchNo) { |
| | | // SimulateDataVo simulateData = dappSimulateDataService.findSimulateData(batchNo); |
| | | // return new FebsResponse().success().data(simulateData); |
| | | // } |
| | | @ApiOperation(value = "IGT注册接口", notes = "注册接口") |
| | | @PostMapping(value = "/register") |
| | | public FebsResponse register(@RequestBody @Validated RegisterDto registerDto) { |
| | | return dappMemberService.register(registerDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "IGT账号密码登录接口", notes = "账号密码登录接口") |
| | | @PostMapping(value = "/toLogin") |
| | | public FebsResponse login(@RequestBody LoginDto loginDto) { |
| | | return dappMemberService.toLogin(loginDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "IGT游客身份登录", notes = "游客身份登录") |
| | | @PostMapping(value = "/touristLogin") |
| | | public FebsResponse touristLogin(@RequestBody TouristLoginDto touristLoginDto) { |
| | | return dappMemberService.touristLogin(touristLoginDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "IGT获取版本信息") |
| | | @GetMapping(value = "/appVersion") |
| | | public FebsResponse appVersion() { |
| | | return new FebsResponse().success().data(dappMemberService.findAppVersion()); |
| | | } |
| | | |
| | | private final TrxUsdtUpdateService trxUsdtUpdateService; |
| | | |
| | | @ApiOperation(value = "IGT充值未到账,比对本地地址 同步充值USDT-TRC20") |
| | | @GetMapping(value = "/updateAddress") |
| | | public FebsResponse updateAddress(@RequestBody UpdateAddressDto updateAddressDto) { |
| | | if("xy".equals(updateAddressDto.getSymbol())){ |
| | | long blockHeight = Long.parseLong(updateAddressDto.getBlockHeight()); |
| | | trxUsdtUpdateService.monitorCoinListener(blockHeight); |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |