| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMemberPayment; |
| | | import cc.mrbird.febs.mall.service.IApiMallAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMallMemberWithdrawService; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.vip.service.IMallVipBenefitsService; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-09-16 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(value = "/api/member") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "ApiMallMemberController", tags = "商城用户接口类") |
| | | public class ApiMallMemberController { |
| | | |
| | | private final IApiMallMemberService memberService; |
| | | private final IMallMemberWithdrawService mallMemberWithdrawService; |
| | | private final IApiMallMemberWalletService walletService; |
| | | private final IApiMallAgentService iApiMallAgentService; |
| | | private final IMallVipBenefitsService mallVipBenefitsService; |
| | | |
| | | /** |
| | | * 小程序接收用户数据,更新用户信息 |
| | | */ |
| | | @ApiOperation(value = "小程序接收用户数据", notes = "小程序接收用户数据") |
| | | @PostMapping(value = "/xcxSaveInfo") |
| | | public FebsResponse xcxSaveInfo(@RequestBody ApiXcxSaveInfoDto apiXcxSaveInfoDto){ |
| | | return memberService.xcxSaveInfo(apiXcxSaveInfoDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取商城用户信息", notes = "获取商城用户信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallMemberVo.class) |
| | | }) |
| | | @GetMapping(value = "/findMemberInfo") |
| | | public FebsResponse findMemberInfo() { |
| | | return memberService.findMemberInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "推出登录", notes = "推出登录") |
| | | @PostMapping(value = "/logout") |
| | | public FebsResponse logout() { |
| | | return memberService.logout(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取购物车、订单等角标数量") |
| | | @GetMapping(value = "/findMarkCnt") |
| | | public FebsResponse findMarkCnt() { |
| | | return memberService.findMemberMarkCnt(); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置支付密码") |
| | | @PostMapping(value = "/setTradePwd") |
| | | public FebsResponse setTradePwd(@RequestBody ForgetPwdDto forgetPwdDto) { |
| | | return memberService.setTradePwd(forgetPwdDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户信息") |
| | | @PostMapping(value = "/modifyInfo") |
| | | public FebsResponse modifyInfo(@RequestBody ModifyMemberInfoDto modifyMemberInfoDto) { |
| | | return memberService.modifyMemberInfo(modifyMemberInfoDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的团队列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MyTeamVo.class) |
| | | }) |
| | | @PostMapping(value = "/teamList") |
| | | public FebsResponse teamList(@RequestBody TeamListDto teamListDto) { |
| | | return memberService.teamList(teamListDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "资金流水列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MoneyFlowVo.class) |
| | | }) |
| | | @PostMapping(value = "/moneyFlow") |
| | | public FebsResponse moneyFlow(@RequestBody MoneyFlowDto moneyFlowDto) { |
| | | return memberService.moneyFlows(moneyFlowDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody @Validated TransferDto transferDto) { |
| | | memberService.transfer(transferDto); |
| | | return new FebsResponse().success().message("转账成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "提现规则", notes = "提现规则") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = CashOutSettingVo.class) |
| | | }) |
| | | @GetMapping(value = "/cashOutSetting") |
| | | public FebsResponse cashOutSetting() { |
| | | return new FebsResponse().success().data(memberService.cashOutSetting()); |
| | | } |
| | | |
| | | @ApiOperation(value = "提现") |
| | | @PostMapping(value = "/withdrawal") |
| | | public FebsResponse withdrawal(@RequestBody @Validated WithdrawalDto withdrawalDto) { |
| | | mallMemberWithdrawService.withdrawal(withdrawalDto); |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置收款方式") |
| | | @PostMapping(value = "/setPayment") |
| | | public FebsResponse setPayment(@RequestBody MallMemberPayment mallMemberPayment) { |
| | | memberService.setPayment(mallMemberPayment); |
| | | return new FebsResponse().success().message("设置成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取收款方式") |
| | | @GetMapping(value = "/findPayment") |
| | | public FebsResponse findPayment() { |
| | | return new FebsResponse().success().data(memberService.findMemberPayment()); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定手机号") |
| | | @PostMapping(value = "/bindPhone") |
| | | public FebsResponse bindPhone(@RequestBody AccountAndCodeDto accountAndCodeDto) { |
| | | memberService.bindPhone(accountAndCodeDto); |
| | | return new FebsResponse().success().message("绑定成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "可提现金额") |
| | | @GetMapping(value = "/canWithdrawal") |
| | | public FebsResponse canWithdrawal() { |
| | | return new FebsResponse().success().data(memberService.canMoney()); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户消费排名") |
| | | @PostMapping(value = "/findRankList") |
| | | public FebsResponse findRankList(@RequestBody RankListDto rankListDto) { |
| | | return new FebsResponse().success().data(memberService.findRankList(rankListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据邀请码或者手机号获取昵称") |
| | | @PostMapping(value = "/findMemberInfoByAccount/{phone}") |
| | | public FebsResponse findMemberInfoByAccount(@PathVariable("phone") String phone) { |
| | | MallMember account = memberService.findMemberInfoByAccount(phone); |
| | | if (account == null) { |
| | | return new FebsResponse().fail().message("用户不存在"); |
| | | } |
| | | |
| | | MallMemberVo member = new MallMemberVo(); |
| | | member.setName(account.getName()); |
| | | return new FebsResponse().success().data(member); |
| | | } |
| | | |
| | | @ApiOperation(value = "佣金划转") |
| | | @PostMapping(value = "/commissionChange") |
| | | public FebsResponse commissionChange(@RequestBody @Validated CommissionChangeDto commissionChange) { |
| | | walletService.commissionChange(commissionChange); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的权益") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = MyCommissionVo.class) |
| | | ) |
| | | @PostMapping(value = "/myCommission") |
| | | public FebsResponse myCommission() { |
| | | return new FebsResponse().success().data(memberService.myCommission()); |
| | | } |
| | | |
| | | @ApiOperation(value = "商铺申请是否存在") |
| | | @PostMapping(value = "/shopApplyIsExist") |
| | | public FebsResponse shopApplyIsExist() { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "充值余额") |
| | | @PostMapping(value = "/rechargeWallet") |
| | | public FebsResponse rechargeWallet(@RequestBody @Validated ApiRechargeWalletDto apiRechargeWalletDto) { |
| | | return memberService.rechargeWallet(apiRechargeWalletDto); |
| | | } |
| | | |
| | | /** |
| | | * 申请代理 |
| | | * @param apiAgentApplyDto |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "申请代理") |
| | | @PostMapping(value = "/agentApply") |
| | | public FebsResponse agentApply(@RequestBody @Validated ApiAgentApplyDto apiAgentApplyDto) { |
| | | return iApiMallAgentService.agentApply(apiAgentApplyDto); |
| | | } |
| | | |
| | | /** |
| | | * 绑定默认推荐人 |
| | | */ |
| | | @ApiOperation(value = "绑定默认推荐人") |
| | | @PostMapping(value = "/setInvite") |
| | | public FebsResponse setInvite(@RequestBody @Validated ApiSetInviteDto apiSetInviteDto) { |
| | | return memberService.setInvite(apiSetInviteDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "代理申请信息") |
| | | @GetMapping(value = "/agentApplyInfo") |
| | | public FebsResponse agentApplyInfo() { |
| | | return memberService.agentApplyInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "合伙人权益") |
| | | @GetMapping(value = "/agentDetail") |
| | | public FebsResponse agentDetail() { |
| | | return memberService.agentDetail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动公告") |
| | | @GetMapping(value = "/activityInfo") |
| | | public FebsResponse activityInfo() { |
| | | return memberService.activityInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过邀请链接领取优惠卷") |
| | | @PostMapping(value = "/getCoupon") |
| | | public FebsResponse getCoupon(@RequestBody GetCouponDto getCouponDto) { |
| | | return memberService.getCoupon(getCouponDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "扫码推销员领取优惠卷") |
| | | @PostMapping(value = "/scanCoupon") |
| | | public FebsResponse scanCoupon(@RequestBody GetCouponDto getCouponDto) { |
| | | return memberService.scanCoupon(getCouponDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "优惠卷列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallMemberCouponVo.class) |
| | | }) |
| | | @PostMapping(value = "/memberCoupon") |
| | | public FebsResponse memberCoupon(@RequestBody MallMemberCouponDto mallMemberCouponDto) { |
| | | return memberService.memberCoupon(mallMemberCouponDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单优惠卷列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallMemberCouponVo.class) |
| | | }) |
| | | @PostMapping(value = "/memberPayCoupon") |
| | | public FebsResponse memberPayCoupon(@RequestBody MallMemberCouponDto mallMemberCouponDto) { |
| | | return memberService.memberPayCoupon(mallMemberCouponDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "优惠卷详情", notes = "优惠卷详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallMemberCouponVo.class) |
| | | }) |
| | | @GetMapping(value = "/couponDetails/{id}") |
| | | public FebsResponse couponDetails(@PathVariable("id") Long id) { |
| | | return memberService.couponDetails(id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "登录事件", notes = "登录事件") |
| | | @GetMapping(value = "/birthdayEvent") |
| | | public FebsResponse birthdayEvent() { |
| | | Map<String, Object> birthdayEvent = mallVipBenefitsService.birthdayEvent(); |
| | | return new FebsResponse().success().data(birthdayEvent); |
| | | } |
| | | |
| | | @ApiOperation(value = "登录事件", notes = "登录事件") |
| | | @GetMapping(value = "/loginEvent") |
| | | public FebsResponse loginEvent() { |
| | | Map<String, Object> loginEvent = memberService.loginEvent(); |
| | | return new FebsResponse().success().data(loginEvent); |
| | | } |
| | | |
| | | @ApiOperation(value = "店铺列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallStoreVo.class) |
| | | }) |
| | | @PostMapping(value = "/storeList") |
| | | public FebsResponse storeList(@RequestBody MallStoreDto mallStoreDto) { |
| | | return memberService.storeList(mallStoreDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "店铺机器列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallStoreItemVo.class) |
| | | }) |
| | | @PostMapping(value = "/storeItemList") |
| | | public FebsResponse storeItemList(@RequestBody MallStoreItemDto mallStoreItemDto) { |
| | | return memberService.storeItemList(mallStoreItemDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定用户") |
| | | @PostMapping(value = "/bindStoreMember") |
| | | public FebsResponse bindStoreMember(@RequestBody @Validated BindStoreMemberDto bindStoreMemberDto) { |
| | | return memberService.bindStoreMember(bindStoreMemberDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallStoreMemberVo.class) |
| | | }) |
| | | @PostMapping(value = "/bindList") |
| | | public FebsResponse bindList() { |
| | | return memberService.bindList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取检测结果") |
| | | @PostMapping(value = "/bindResult") |
| | | public FebsResponse bindResult(@RequestBody @Validated BindResultDto bindResultDto) { |
| | | return memberService.bindResult(bindResultDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "去授权") |
| | | @PostMapping(value = "/bindDoctor") |
| | | public FebsResponse bindDoctor(@RequestBody @Validated ApiDoctorBindDto dto) { |
| | | return memberService.bindDoctor(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的检测用户") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiDoctorListVo.class) |
| | | }) |
| | | @PostMapping(value = "/doctorList") |
| | | public FebsResponse doctorList(@RequestBody ApiDoctorListDto dto) { |
| | | |
| | | return memberService.doctorList(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的授权记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiDoctorListVo.class) |
| | | }) |
| | | @PostMapping(value = "/authList") |
| | | public FebsResponse authList() { |
| | | |
| | | return memberService.authList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的授权记录-删除") |
| | | @PostMapping(value = "/authDel") |
| | | public FebsResponse authDel(@RequestBody @Validated ApiDoctorAuthDeleteDto dto) { |
| | | |
| | | return memberService.authDel(dto); |
| | | } |
| | | |
| | | |
| | | } |