| | |
| | | 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.entity.DappMemberEntity; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author |
| | | * @author |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RequiredArgsConstructor |
| | | @CrossOrigin("*") |
| | | @RestController |
| | |
| | | |
| | | private final DappMemberService dappMemberService; |
| | | private final DappSystemService dappSystemService; |
| | | private final DappSimulateDataService dappSimulateDataService; |
| | | |
| | | // @ApiOperation(value = "授权接口", notes = "授权接口") |
| | | // @PostMapping(value = "/approve") |
| | | // public FebsResponse approve(@RequestBody ApproveDto approveDto) { |
| | | // dappMemberService.approve(approveDto); |
| | | // return new FebsResponse().success().message("授权成功"); |
| | | // } |
| | | // |
| | | // @ApiOperation(value = "是否授权接口", notes = "是否授权接口") |
| | | // @GetMapping(value = "/isApprove/{chain}/{address}") |
| | | // public FebsResponse isApprove(@PathVariable("address") String address,@PathVariable("chain") String chain) { |
| | | // return new FebsResponse().success().message("获取成功").data(dappMemberService.isApprove(address, chain)); |
| | | // } |
| | | @ApiOperation(value = "地址是否存在", notes = "地址是否存在") |
| | | @GetMapping(value = "/exist/{address}") |
| | | public FebsResponse exist(@PathVariable("address") String address) { |
| | | DappMemberEntity member = dappMemberService.findByAddress(address, "BSC"); |
| | | |
| | | int result = member == null ? 2 : 1; |
| | | return new FebsResponse().success().data(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "链接接口", notes = "链接接口") |
| | | @PostMapping(value = "/connect") |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "头部数据", notes = "头部数据") |
| | | @GetMapping(value = "/totalIncome") |
| | | public FebsResponse totalIncome() { |
| | | 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()); |
| | | } |
| | | } |