| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.EncryptEnable; |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author |
| | | * @author |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RequiredArgsConstructor |
| | | @CrossOrigin("*") |
| | | @RestController |
| | |
| | | return new FebsResponse().success().data(walletInfoVo); |
| | | } |
| | | |
| | | @ApiOperation(value = "购买节点", notes = "购买节点") |
| | | @PostMapping(value = "/buyNode") |
| | | public FebsResponse buyNode(@RequestBody BuyNodeDto buyNodeDto) { |
| | | return new FebsResponse().success().data(dappWalletService.buyNode(buyNodeDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "转账", notes = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody TransferDto transferDto) { |
| | |
| | | return new FebsResponse().success().data(dappWalletService.recordInPage(recordInPageDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "计算最新价", notes = "计算最新价") |
| | | @PostMapping(value = "/calPrice") |
| | | public FebsResponse calPrice() { |
| | | return new FebsResponse().success().data(dappWalletService.calPrice()); |
| | | } |
| | | |
| | | @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()); |
| | | @ApiOperation(value = "提现", notes = "提现") |
| | | @PostMapping(value = "/withdraw") |
| | | public FebsResponse withdraw(@RequestBody @Valid WithdrawDto withdrawDto) { |
| | | dappWalletService.withdraw(withdrawDto); |
| | | return new FebsResponse().success().message("success"); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的团队", notes = "我的团队") |
| | |
| | | @ApiResponse(code = 200, message = "success", response = TeamListVo.class) |
| | | }) |
| | | @PostMapping(value = "/team") |
| | | public FebsResponse team(@RequestBody TeamListDto teamListDto) { |
| | | return new FebsResponse().success().data(dappMemberService.findTeamList(teamListDto)); |
| | | public FebsResponse team() { |
| | | return new FebsResponse().success().data(dappMemberService.findTeamList()); |
| | | } |
| | | |
| | | @PostMapping(value = "/logout") |
| | | public FebsResponse logout() { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_SIGN, member.getAddress()); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_MEMBER_INFO, member.getAddress()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "计算手续费", notes = "计算手续费") |
| | | @PostMapping(value = "/calPrice") |
| | | public FebsResponse calPrice(@RequestBody PriceDto priceDto) { |
| | | return new FebsResponse().success().data(dappWalletService.calPrice(priceDto)); |
| | | } |
| | | } |