| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.dapp.dto.ApproveDto; |
| | | 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 lombok.RequiredArgsConstructor; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @author |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | |
| | | @CrossOrigin("*") |
| | | @RestController |
| | | @Api(value = "dapp公共接口", tags = "dapp公共接口") |
| | | @RequestMapping(value = "/dapp/common") |
| | | @RequestMapping(value = "/dapi/common") |
| | | public class ApiCommonController { |
| | | |
| | | private final DappMemberService dappMemberService; |
| | | private final DappSystemService dappSystemService; |
| | | private final DappSimulateDataService dappSimulateDataService; |
| | | |
| | | @ApiOperation(value = "授权接口", notes = "授权接口") |
| | | @PostMapping(value = "/approve") |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "是否授权接口", notes = "是否授权接口") |
| | | @GetMapping(value = "/isApprove/{address}") |
| | | public FebsResponse isApprove(@PathVariable("address") String address) { |
| | | boolean isApprove = dappMemberService.isApprove(address); |
| | | if (isApprove) { |
| | | return new FebsResponse().success().message("已授权"); |
| | | } |
| | | return new FebsResponse().fail().message("未授权"); |
| | | @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 = "/totalIncome") |
| | | public FebsResponse totalIncome() { |
| | | return new FebsResponse().success().data(dappSystemService.findTotalInComeAndList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "全局设置", notes = "全局设置") |
| | | @GetMapping(value = "/globalSetting") |
| | | public FebsResponse globalSetting() { |
| | | return new FebsResponse().success().data(dappSystemService.globalSetting()); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |