bug
This commit is contained in:
@@ -152,6 +152,23 @@ public class MyUserController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核用户是否有某书的权限
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/checkUserBook")
|
||||
public R checkUserBook(@RequestBody Map<String,Object> param){
|
||||
Integer userId = Integer.valueOf(param.get("userId").toString());
|
||||
Integer bookId = Integer.valueOf(param.get("bookId").toString());
|
||||
boolean b = userService.checkUserBook(userId, bookId);
|
||||
if (b){
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("鉴权失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@@ -45,6 +45,8 @@ public interface MyUserService extends IService<MyUserEntity> {
|
||||
//第三方微信登录
|
||||
R getUserInfoByApp(UserAppAuthorEntity userAppAuthorEntity);
|
||||
|
||||
boolean checkUserBook(Integer userId,Integer bookId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -391,8 +391,16 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
|
||||
return R.ok("sec");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkUserBook(Integer userId, Integer bookId) {
|
||||
LambdaQueryWrapper<UserEbookBuyEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
|
||||
wrapper.eq(UserEbookBuyEntity::getBookId,bookId);
|
||||
UserEbookBuyEntity userEbookBuyEntity = userEbookBuyService.getBaseMapper().selectOne(wrapper);
|
||||
return userEbookBuyEntity != null;
|
||||
}
|
||||
|
||||
private void sendCode(String phone, String code,Integer areaCode) throws Exception {
|
||||
private void sendCode(String phone, String code, Integer areaCode) throws Exception {
|
||||
com.aliyun.dysmsapi20170525.Client client = Sample.createClient(smsConfig.getAccessKeyId(),smsConfig.getAccessKeySecret());
|
||||
String tem;
|
||||
if(areaCode!=null&&areaCode>0&&areaCode!=86){
|
||||
|
||||
Reference in New Issue
Block a user