代码提交
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
package com.njcn.user.controller.app;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.pojo.vo.app.AppUserResultVO;
|
||||
import com.njcn.user.service.IAppUserService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.app.AESUtil;
|
||||
import com.njcn.web.utils.app.XssFilterUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bouncycastle.asn1.ocsp.ResponseData;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/7 8:51
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appUser")
|
||||
@Api(tags = "App用户信息管理")
|
||||
@AllArgsConstructor
|
||||
public class AppUserController extends BaseController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AppUserController.class);
|
||||
|
||||
private final IAppUserService appUserService;
|
||||
|
||||
/**
|
||||
* 获取(登录、注册、忘记密码、重新绑定手机)验证码
|
||||
*/
|
||||
@PostMapping("authCode")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "获取验证码", notes = "获取验证码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "type", value = "验证码类型", required = true, paramType = "query"),
|
||||
})
|
||||
public HttpResult<String> authCode(String phone, String devCode, String type) {
|
||||
String methodDescribe = getMethodDescribe("authCode");
|
||||
appUserService.setMessage(phone,devCode,type);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机app注册
|
||||
*/
|
||||
@PostMapping("register")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "注册入口", notes = "用户注册")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||
})
|
||||
public HttpResult<AppUserResultVO> register(String phone, String code, String devCode) {
|
||||
String methodDescribe = getMethodDescribe("register");
|
||||
AppUserResultVO appUserResultVo = appUserService.register(phone,code,devCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appUserResultVo, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机app密码设置
|
||||
*/
|
||||
@PostMapping("setPsd")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "设置密码", notes = "设置密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户索引", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||
})
|
||||
public HttpResult<String> setPsd(String userId, String password, String devCode) {
|
||||
String methodDescribe = getMethodDescribe("setPsd");
|
||||
appUserService.setPsd(userId, devCode, password);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机app登录入口
|
||||
*/
|
||||
@PostMapping("login")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "登录入口", notes = "APP登录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "type", value = "登录类型", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "key", value = "验证码/密码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||
})
|
||||
public HttpResult<AppUserResultVO> login(String phone, String type, String key, String devCode, HttpServletRequest request) {
|
||||
String methodDescribe = getMethodDescribe("login");
|
||||
AppUserResultVO appUserResultVo = appUserService.login(phone,type,key,devCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appUserResultVo, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user