| | |
| | | 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.EncryptDto; |
| | | import cc.mrbird.febs.dapp.dto.SystemDto; |
| | | 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.*; |
| | |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RequiredArgsConstructor |
| | | @CrossOrigin("*") |
| | | @RestController |
| | |
| | | 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 = "授权接口") |
| | | // @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 = "链接接口") |
| | | @PostMapping(value = "/connect") |
| | | public FebsResponse connect(@RequestBody ConnectDto connectDto) { |
| | | dappMemberService.connect(connectDto); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @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 = "总收入和列表") |
| | | @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); |
| | | @PostMapping(value = "/encrypt") |
| | | public FebsResponse encryptTest(@RequestBody EncryptDto encryptDto) { |
| | | System.out.println(encryptDto.getTest()); |
| | | return new FebsResponse().success().data("123"); |
| | | } |
| | | } |