| | |
| | | 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.entity.DappNodeOrderEntity; |
| | | 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 cc.mrbird.febs.dapp.vo.*; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author |
| | |
| | | return new FebsResponse().success().data(walletInfoVo); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户信息", notes = "获取用户信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = DappMemberInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/memberInfo") |
| | | public FebsResponse memberInfo() { |
| | | return dappMemberService.getMemberInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户购买节点信息", notes = "获取用户购买节点信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = DappMemberNodeVo.class) |
| | | }) |
| | | @PostMapping(value = "/memberNode") |
| | | public FebsResponse memberNode() { |
| | | return dappMemberService.getMemberNode(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取节点信息", notes = "获取节点信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = DappNodeOrderVo.class) |
| | | }) |
| | | @PostMapping(value = "/nodeInfo") |
| | | public FebsResponse nodeInfo() { |
| | | return dappMemberService.getNodeInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "转账", notes = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody TransferDto transferDto) { |
| | | return new FebsResponse().success().data(dappWalletService.transfer(transferDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "买入A币", notes = "买入A币") |
| | | @PostMapping(value = "/transferA") |
| | | public FebsResponse transferA(@RequestBody TransferADto transferADto) { |
| | | return new FebsResponse().success().data(dappWalletService.transferA(transferADto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "A币K线", notes = "A币K线") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = AKLineVo.class) |
| | | }) |
| | | @PostMapping(value = "/aKLine") |
| | | public FebsResponse aKLine(@RequestBody AKLineDto aKLineDto) { |
| | | return new FebsResponse().success().data(dappMemberService.aKLine(aKLineDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "兑换AUSD", notes = "兑换AUSD") |
| | | @PostMapping(value = "/transferAusd") |
| | | public FebsResponse transferAusd(@RequestBody TransferAusdDto transferAusdDto) { |
| | | return new FebsResponse().success().data(dappWalletService.transferAusd(transferAusdDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "闪兑-资产钱包转帐到闪兑钱包3% 手续费(扣币)", notes = "资产钱包转帐到闪兑钱包3% 手续费(扣币)") |
| | | @PostMapping(value = "/mineToCoin") |
| | | public FebsResponse mineToCoin(@RequestBody MineToCoinDto mineToCoinDto) { |
| | | dappWalletService.mineToCoin(mineToCoinDto); |
| | | return new FebsResponse().success().data("success"); |
| | | } |
| | | |
| | | @ApiOperation(value = "记录列表", notes = "记录列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = DappFundFlowVo.class) |
| | | }) |
| | | @PostMapping(value = "/recordInPage") |
| | | public FebsResponse recordInPage(@RequestBody RecordInPageDto recordInPageDto) { |
| | | return new FebsResponse().success().data(dappWalletService.recordInPage(recordInPageDto)); |
| | | // return new FebsResponse().success().data(dappWalletService.recordInPage(recordInPageDto)); |
| | | return new FebsResponse().success().data(dappWalletService.getRecordVoInPage(recordInPageDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "计算最新价", notes = "计算最新价") |
| | | @PostMapping(value = "/calPrice") |
| | | public FebsResponse calPrice(@RequestBody PriceDto priceDto) { |
| | | return new FebsResponse().success().data(dappWalletService.calPrice(priceDto)); |
| | | } |
| | | |
| | | @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()); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的推广码", notes = "我的推广码") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ActiveNftListVo.class) |
| | | @ApiResponse(code = 200, message = "success", response = MyInviteInfoVo.class) |
| | | }) |
| | | @ApiOperation(value = "开盲盒", notes = "开盲盒") |
| | | @PostMapping(value = "/boxSurprise") |
| | | public FebsResponse boxSurprise() { |
| | | ActiveNftListVo data = dappWalletService.boxSurprise(); |
| | | return new FebsResponse().success().data(data); |
| | | @PostMapping(value = "/inviteInfo") |
| | | public FebsResponse inviteInfo() { |
| | | return new FebsResponse().success().data(dappMemberService.findInviteInfo()); |
| | | } |
| | | |
| | | @ApiOperation(value = "激活卡牌", notes = "激活卡牌") |
| | | @PostMapping(value = "/activeNft") |
| | | public FebsResponse activeNft(@RequestBody @Valid ActiveDto activeDto) { |
| | | dappWalletService.activeNft(activeDto); |
| | | return new FebsResponse().success().message("激活成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "动能信息", notes = "动能信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ActiveNftListVo.class) |
| | | @ApiResponse(code = 200, message = "success", response = ApiRunListInfoVo.class) |
| | | }) |
| | | @ApiOperation(value = "卡牌列表", notes = "卡牌列表") |
| | | @PostMapping(value = "/findNftList") |
| | | public FebsResponse findNftList() { |
| | | return new FebsResponse().success().data(dappWalletService.findUnActiveNftList()); |
| | | @PostMapping(value = "/runListInfo") |
| | | public FebsResponse runListInfo() { |
| | | return new FebsResponse().success().data(dappMemberService.findRunListInfo()); |
| | | } |
| | | |
| | | // @ApiOperation(value = "我的团队", notes = "我的团队") |
| | | // @ApiResponses({ |
| | | // @ApiResponse(code = 200, message = "success", response = TeamListVo.class) |
| | | // }) |
| | | // @PostMapping(value = "/team") |
| | | // 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)); |
| | | } |
| | | } |