| | |
| | | package com.ruoyi.account.controller; |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.StoreClient; |
| | | import org.junit.Test; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | @Resource |
| | | private UserCouponService userCouponService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录") |
| | | public R<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录") |
| | | public R<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | @PostMapping("/getAppUserById") |
| | | public AppUser getAppUserById(@RequestParam("id") Long id){ |
| | | return appUserService.getById(id); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editAppUserById") |
| | | public R<Void> editAppUserById(@RequestBody AppUser appUser) { |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getCouponCount") |
| | | public R<Long> getCouponCount(@RequestParam("userId")Long userId, @RequestParam("couponId") Integer couponId ){ |
| | | Long count = userCouponService.lambdaQuery().eq(UserCoupon::getAppUserId, userId).eq(UserCoupon::getCouponId, couponId).count(); |
| | | return R.ok(count); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getVipCount") |
| | | public R<Long> getVipCount(@RequestParam("userId")Long userId, @RequestParam("vipId") Integer vipId ){ |
| | | Long count = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, userId).eq(AppUser::getVipId, vipId).count(); |
| | | return R.ok(count); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | private UserCancellationLogService userCancellationLogService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/unregis") |
| | | @GetMapping("/unregis") |
| | | @ApiOperation(value = "注销", tags = {"小程序-个人中心首页-我的资料"}) |
| | | public R unregis(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/index") |
| | | |
| | | |
| | | @GetMapping("/index") |
| | | @ApiOperation(value = "个人中心首页", tags = {"小程序-个人中心首页"}) |
| | | public R<AppUser> index(){ |
| | | System.err.println("=-===="); |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/index/change") |
| | | @ApiOperation(value = "修改个人资料", tags = {"小程序-个人中心首页"}) |
| | | public R<AppUser> indexchange(String avatar,String name){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | //当前用户信息 |
| | | AppUser user = appUserService.getById(userId); |
| | | user.setName(name); |
| | | user.setAvatar(avatar); |
| | | appUserService.updateById(user); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 获取用户的祖籍列表 |
| | | */ |
| | | @GetMapping("/getUserAncestorList") |
| | | public R<List<AppUser>> getUserAncestorList(Long id){ |
| | | List<AppUser> list = appUserService.getUserAncestorList(id,null); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | } |