| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.EncryptEnable; |
| | | import cc.mrbird.febs.common.configure.i18n.MessageSourceUtils; |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.dto.*; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.dapp.vo.ActiveNftListVo; |
| | | import cc.mrbird.febs.dapp.vo.TeamListVo; |
| | | import cc.mrbird.febs.dapp.vo.WalletInfoVo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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 |
| | |
| | | private final DappWalletService dappWalletService; |
| | | private final DappSystemService dappSystemService; |
| | | private final DappMemberService dappMemberService; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @ApiOperation(value = "获取账户信息接口", notes = "获取账号信息接口") |
| | | @ApiResponses({ |
| | |
| | | @ApiOperation(value = "转账", notes = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody TransferDto transferDto) { |
| | | dappWalletService.transfer(transferDto); |
| | | return new FebsResponse().success(); |
| | | return new FebsResponse().success().data(dappWalletService.transfer(transferDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "记录列表", notes = "记录列表") |
| | |
| | | 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)); |
| | | } |
| | | } |