| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.StoreClient; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/recommend") |
| | | @GetMapping("/recommend") |
| | | @ApiOperation(value = "推广中心", tags = {"小程序-推广中心"}) |
| | | public R<AppUser> recommend(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | user.setBottomUsers(list); |
| | | |
| | | return R.ok(user); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/change") |
| | | @ApiOperation(value = "推广中心", tags = {"小程序-推广中心"}) |
| | | public R<AppUser> change(@ApiParam("换绑用户手机号") String phone){ |
| | | Long userId1 = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser byId = appUserService.getById(userId1); |
| | | //获取绑定门店 |
| | | AppUser user = appUserService.lambdaQuery().eq(AppUser::getPhone,phone).one(); |
| | | if (user==null){ |
| | | return R.fail("当前手机号未注册"); |
| | | } |
| | | byId.setInviteUserId(user.getId()); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的直帮上级用户 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getSuperiorLeader") |
| | | @ApiOperation(value = "获取用户的直帮上级用户") |
| | | public R<AppUser> getSuperiorLeader(@RequestParam("id") Long id) { |
| | | AppUser superiorLeader = appUserService.getSuperiorLeader(id); |
| | | return R.ok(superiorLeader); |
| | | } |
| | | |
| | | |
| | | |
| | | } |