| | |
| | | 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.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Api(tags = {"登录注册-小程序"}) |
| | | @RestController |
| | | @RequestMapping("/app-user") |
| | | public class AppUserController { |
| | | public class AppUserController extends BaseController { |
| | | |
| | | |
| | | |
| | |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | @PostMapping("getAppUserById") |
| | | AppUser getAppUserById(@RequestParam("id") Long id){ |
| | | return appUserService.getById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/appletLogin") |
| | | @ApiOperation(value = "小程序一键登录") |
| | | public AjaxResult<LoginVo> appletLogin(@RequestBody AppletLogin appletLogin){ |
| | | public R<LoginVo> appletLogin(@RequestBody AppletLogin appletLogin){ |
| | | return appUserService.appletLogin(appletLogin); |
| | | } |
| | | |
| | |
| | | public R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser){ |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录") |
| | | public R<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | return R.ok(count); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getSMSCode") |
| | | @ApiOperation(value = "获取短信验证码") |
| | | public AjaxResult getSMSCode(@RequestBody SMSCode smsCode){ |
| | | public R getSMSCode(@RequestBody SMSCode smsCode){ |
| | | return appUserService.getSMSCode(smsCode); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/registerAccount") |
| | | @ApiOperation(value = "注册新账号") |
| | | public AjaxResult<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){ |
| | | public R<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){ |
| | | return appUserService.registerAccount(registerAccount); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "推荐人id", required = true, dataType = "long") |
| | | }) |
| | | public AjaxResult<String> getReferrer(@PathVariable("id") Long id){ |
| | | public R<String> getReferrer(@PathVariable("id") Long id){ |
| | | AppUser appUser = appUserService.getById(id); |
| | | String phone = appUser.getPhone(); |
| | | phone = phone.substring(0, 3) + "****" + phone.substring(7); |
| | | return AjaxResult.success(appUser.getName() + "-" + phone); |
| | | return R.ok(appUser.getName() + "-" + phone); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的祖籍列表 |
| | | */ |
| | | @GetMapping("/getUserAncestorList") |
| | | public R<List<AppUser>> getUserAncestorList(Long id){ |
| | | List<AppUser> list = appUserService.getUserAncestorList(id,null); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | } |