| | |
| | | |
| | | 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.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BaseTable; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Api(tags = {"登录注册-小程序"}) |
| | | @RestController |
| | | @RequestMapping("/app-user") |
| | | public class AppUserController { |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/appletLogin") |
| | | @ApiOperation(value = "小程序一键登录", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "小程序一键登录") |
| | | public AjaxResult<LoginVo> appletLogin(@RequestBody AppletLogin appletLogin){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | return appUserService.appletLogin(appletLogin); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "手机号登录") |
| | | public AjaxResult<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getSMSCode") |
| | | @ApiOperation(value = "获取短信验证码", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "获取短信验证码") |
| | | public AjaxResult getSMSCode(@RequestBody SMSCode smsCode){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | return appUserService.getSMSCode(smsCode); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/registerAccount") |
| | | @ApiOperation(value = "注册新账号", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "注册新账号") |
| | | public AjaxResult<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | return appUserService.registerAccount(registerAccount); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getReferrer/{id}") |
| | | @ApiOperation(value = "获取推荐人信息", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "获取推荐人信息") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "推荐人id", required = true, dataType = "long") |
| | | }) |
| | | public AjaxResult<String> getReferrer(@PathVariable("id") Long id){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | AppUser appUser = appUserService.getById(id); |
| | | String phone = appUser.getPhone(); |
| | | phone = phone.substring(0, 3) + "****" + phone.substring(7); |
| | | return AjaxResult.success(appUser.getName() + "-" + phone); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getNearbyReferrer") |
| | | @ApiOperation(value = "获取附近推荐人列表", tags = {"登录注册-小程序"}) |
| | | @ApiOperation(value = "获取附近推荐人列表") |
| | | public AjaxResult<BaseTable<NearbyReferrerVo>> getNearbyReferrer(NearbyReferrer nearbyReferrer){ |
| | | // todo 待完善 pu |
| | | return AjaxResult.success(); |
| | | BaseTable<NearbyReferrerVo> baseTable = appUserService.getNearbyReferrer(nearbyReferrer); |
| | | return AjaxResult.success(baseTable); |
| | | } |
| | | |
| | | |