bug
This commit is contained in:
@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.peanut.common.utils.MD5Utils;
|
import com.peanut.common.utils.MD5Utils;
|
||||||
import com.peanut.common.utils.MailUtil;
|
import com.peanut.common.utils.MailUtil;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.modules.common.entity.MyUserEntity;
|
import com.peanut.modules.common.entity.MyUserEntity;
|
||||||
|
import com.peanut.modules.common.entity.UserVip;
|
||||||
import com.peanut.modules.common.service.MyUserService;
|
import com.peanut.modules.common.service.MyUserService;
|
||||||
|
import com.peanut.modules.common.service.UserVipService;
|
||||||
import com.peanut.modules.sys.service.SysUserTokenService;
|
import com.peanut.modules.sys.service.SysUserTokenService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -15,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -33,6 +38,8 @@ public class UserController {
|
|||||||
private StringRedisTemplate redisTemplate;
|
private StringRedisTemplate redisTemplate;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserTokenService sysUserTokenService;
|
private SysUserTokenService sysUserTokenService;
|
||||||
|
@Autowired
|
||||||
|
private UserVipService userVipService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常规注册 发短信验证码
|
* 常规注册 发短信验证码
|
||||||
@@ -94,6 +101,22 @@ public class UserController {
|
|||||||
return MailUtil.sendMail("疯子读书邮箱验证码",code,email);
|
return MailUtil.sendMail("疯子读书邮箱验证码",code,email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getUserInfo")
|
||||||
|
public R getUserInfo(){
|
||||||
|
int uid = ShiroUtils.getUId();
|
||||||
|
MyUserEntity userEntity = userService.getById(uid);
|
||||||
|
if(!userEntity.getVip().equals("0")){
|
||||||
|
List<UserVip> userVips = userVipService.getBaseMapper().selectList(new LambdaQueryWrapper<UserVip>()
|
||||||
|
.eq(UserVip::getUserId, uid).eq(UserVip::getState,0));
|
||||||
|
if (userVips.size()==1){
|
||||||
|
userEntity.setUserVip(userVips.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.ok().put("result",userEntity);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定电话号
|
* 绑定电话号
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -143,4 +143,7 @@ public class MyUserEntity implements Serializable {
|
|||||||
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private UserVip userVip;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user