| | |
| | | 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 cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.dto.BuyNodeDto; |
| | | import cc.mrbird.febs.dapp.dto.RecordInPageDto; |
| | | import cc.mrbird.febs.dapp.dto.WalletOperateDto; |
| | | import cc.mrbird.febs.dapp.dto.WithdrawDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.dapp.vo.WalletInfoVo; |
| | | import cc.mrbird.febs.dapp.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @author |
| | | * @date 2022-03-17 |
| | | **/ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RequiredArgsConstructor |
| | | @CrossOrigin(origins = "*") |
| | | @CrossOrigin("*") |
| | | @RestController |
| | | @Api(value = "dapp接口", tags = "dapp接口") |
| | | @RequestMapping(value = "/dapp/member") |
| | | @RequestMapping(value = "/dapi/member") |
| | | public class ApiDappMemberController { |
| | | |
| | | private final DappWalletService dappWalletService; |
| | | private final DappMemberService dappMemberService; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @ApiOperation(value = "大单排名前十", notes = "大单排名前十") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiStorageInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/storageIndex") |
| | | public FebsResponse storageIndex() { |
| | | return new FebsResponse().success().data(dappWalletService.storageIndex()); |
| | | } |
| | | |
| | | @ApiOperation(value = "直推有效人数排名前十", notes = "直推有效人数排名前十") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiDirectInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/directIndex") |
| | | public FebsResponse directIndex() { |
| | | return new FebsResponse().success().data(dappWalletService.directNumIndex()); |
| | | } |
| | | |
| | | @ApiOperation(value = "直推总业绩排名前十", notes = "直推总业绩排名前十") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiStorageInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/directIndexV2") |
| | | public FebsResponse directIndexV2() { |
| | | return new FebsResponse().success().data(dappWalletService.directIndex()); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页六项数据", notes = "首页六项数据") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiIndexInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/indexInfo") |
| | | public FebsResponse indexInfo() { |
| | | return new FebsResponse().success().data(dappWalletService.indexInfo()); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取账户信息接口", notes = "获取账号信息接口") |
| | | @ApiResponses({ |
| | |
| | | return new FebsResponse().success().data(walletInfoVo); |
| | | } |
| | | |
| | | @ApiOperation(value = "兑换接口", notes = "兑换") |
| | | @PostMapping(value = "/change") |
| | | public FebsResponse change(@RequestBody WalletOperateDto walletOperateDto) { |
| | | dappWalletService.change(walletOperateDto); |
| | | return new FebsResponse().success().message("兑换成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "提现接口", notes = "提现接口") |
| | | @PostMapping(value = "/withdraw") |
| | | public FebsResponse withdraw(@RequestBody WalletOperateDto walletOperateDto) { |
| | | dappWalletService.withdraw(walletOperateDto); |
| | | return new FebsResponse().success().message("申请成功, 等待审核"); |
| | | } |
| | | |
| | | @ApiOperation(value = "记录列表", notes = "记录列表") |
| | | @ApiOperation(value = "资金流水", notes = "资金流水") |
| | | @PostMapping(value = "/recordInPage") |
| | | public FebsResponse recordInPage(@RequestBody RecordInPageDto recordInPageDto) { |
| | | return new FebsResponse().success().data(dappWalletService.recordInPage(recordInPageDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的团队-上半部分", notes = "我的团队-上半部分") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = TeamUpVo.class) |
| | | }) |
| | | @PostMapping(value = "/teamUp") |
| | | public FebsResponse teamUp() { |
| | | return new FebsResponse().success().data(dappMemberService.teamUp()); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的团队-列表", notes = "我的团队-列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = TeamDownVo.class) |
| | | }) |
| | | @PostMapping(value = "/teamDown") |
| | | public FebsResponse teamDown() { |
| | | return new FebsResponse().success().data(dappMemberService.teamDown()); |
| | | } |
| | | |
| | | @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 = "/withdraw") |
| | | public FebsResponse withdraw(@RequestBody @Valid WithdrawDto withdrawDto) { |
| | | dappWalletService.withdraw(withdrawDto); |
| | | return new FebsResponse().success().message("success"); |
| | | } |
| | | |
| | | @ApiOperation(value = "退出", notes = "退出") |
| | | @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(); |
| | | } |
| | | } |