移动端手机设备码更新
This commit is contained in:
@@ -164,4 +164,20 @@ public class AppUserController extends BaseController {
|
|||||||
appUserService.rebindPhone(userId,phoneNew,code,devCode);
|
appUserService.rebindPhone(userId,phoneNew,code,devCode);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户登录成功后,更新手机设备码
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("updateDevCode")
|
||||||
|
@ApiOperation("更新用户手机设备码")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
public HttpResult<Object> updateDevCode(String userId,String devCode) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateDevCode");
|
||||||
|
appUserService.updateDevCode(userId,devCode);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,4 +46,9 @@ public interface IAppUserService {
|
|||||||
*/
|
*/
|
||||||
void rebindPhone(String userId, String phoneNew, String code, String devCode);
|
void rebindPhone(String userId, String phoneNew, String code, String devCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户设备码
|
||||||
|
*/
|
||||||
|
void updateDevCode(String userId, String devCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import com.aliyuncs.exceptions.ClientException;
|
|||||||
import com.aliyuncs.http.MethodType;
|
import com.aliyuncs.http.MethodType;
|
||||||
import com.aliyuncs.profile.DefaultProfile;
|
import com.aliyuncs.profile.DefaultProfile;
|
||||||
import com.aliyuncs.profile.IClientProfile;
|
import com.aliyuncs.profile.IClientProfile;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -292,6 +294,13 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
|
|||||||
this.updateById(user2);
|
this.updateById(user2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDevCode(String userId, String devCode) {
|
||||||
|
LambdaUpdateWrapper<User> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.set(User::getDevCode,devCode).eq(User::getId,userId);
|
||||||
|
this.update(lambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义获取验证码,固定为字母和数字的组合
|
* 自定义获取验证码,固定为字母和数字的组合
|
||||||
|
|||||||
Reference in New Issue
Block a user