更新 UserInfoService.java

master
wangsiyuan 2024-01-18 21:27:47 +08:00
parent a788440b3b
commit 84206e653d
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,9 @@
package com.gao.finalhw.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gao.finalhw.controller.UserController;
import com.gao.finalhw.mapper.UserInfoMapper;
import com.gao.finalhw.model.Orders;
import com.gao.finalhw.model.UserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -15,7 +17,10 @@ public class UserInfoService {
UserInfoMapper userInfoMapper;
public UserInfo getUserInfo(int id){
UserInfo result = userInfoMapper.selectById(id);
logger.info("id: {}",id);
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", id);
UserInfo result = userInfoMapper.selectOne(queryWrapper);
logger.info("select user info result: {}",result);
return result;