| | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.security.annotation.InnerAuth; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.model.AppCaptchaBody; |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.service.AppUserService; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/getUserByCondition") |
| | | R<AppUser> getUserByCondition(@RequestBody AppUserDTO dto){ |
| | | R<Optional<AppUser>> getUserByCondition(@RequestBody AppUserDTO dto) { |
| | | return R.ok(appUserService.getUserByCondition(dto)); |
| | | } |
| | | @InnerAuth |
| | | @PostMapping("/getUserByCondition1") |
| | | R<Optional<AppUser>> getUserByCondition1(@RequestBody AppUserDTO dto) { |
| | | return R.ok(appUserService.getUserByCondition1(dto)); |
| | | } |
| | | |
| | | /** |
| | | * app用户注册 |
| | | * APP用户注册 |
| | | * @param appUserDTO |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/registerAppUser") |
| | | R<Boolean> registerAppUser(@RequestBody AppUserDTO appUserDTO){ |
| | | R<AppUser> registerAppUser(@RequestBody AppUserDTO appUserDTO) { |
| | | return R.ok(appUserService.registerAppUser(appUserDTO)); |
| | | } |
| | | |
| | | /** |
| | | * APP微信登录 |
| | | * |
| | | * @param body |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/wxLogin") |
| | | R<AppLoginUser> wxLogin(@RequestBody AppWXLoginBody body) { |
| | | return R.ok(appUserService.wxLogin(body)); |
| | | } |
| | | |
| | | /** |
| | | * APP苹果登录 |
| | | * |
| | | * @param appleId |
| | | * @param source |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/appleLogin") |
| | | R<AppLoginUser> appleLogin(@RequestParam("appleId") String appleId,@RequestParam("device") String device) { |
| | | return R.ok(appUserService.appleLogin(appleId,device)); |
| | | } |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * |
| | | * @param body |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/captchaLogin") |
| | | R<AppLoginUser> appCaptchaLogin(@RequestBody AppCaptchaBody body) { |
| | | return R.ok(appUserService.appCaptchaLogin(body)); |
| | | } |
| | | |
| | | /** |
| | | * 微信苹果登录验证手机号码操作 |
| | | * |
| | | * @param body |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/verifyCellPhone") |
| | | R<AppLoginUser> verifyCellPhone(@RequestBody AppVerifyCellPhoneBody body) { |
| | | return R.ok(appUserService.verifyCellPhone(body)); |
| | | } |
| | | |
| | | /** |
| | | * 更新APP用户信息 |
| | | * |
| | | * @param dto APP用户数据传输对象 |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/updateAppUser") |
| | | R<?> updateAppUser(@RequestBody AppUserDTO dto) { |
| | | appUserService.updateAppUser(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | * |
| | | * @param appUserIdSet 用户id列表 |
| | | * @param source 请求来源 |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/getAppUserList") |
| | | R<List<AppUser>> getAppUserList(@RequestBody Collection<Long> appUserIdSet) { |
| | | return R.ok(appUserService.listByIds(appUserIdSet)); |
| | | } |
| | | } |