Merge pull request '更新预约(新增获取用户信息)' (#6) from syl into master

Reviewed-on: #6
master
syl 2023-12-12 21:26:21 +08:00
commit b0241c68f2
2 changed files with 12 additions and 7 deletions

View File

@ -9,6 +9,7 @@
<file url="file://$PROJECT_DIR$/bwie-common/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-gateway/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-gateway/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-gateway/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-gateway/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-models/bwie-list/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-models/bwie-user/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-models/bwie-user/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-models/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-models/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-models/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/bwie-models/src/main/resources" charset="UTF-8" />

View File

@ -1,7 +1,11 @@
package com.bwie.list.service.impl; package com.bwie.list.service.impl;
import com.alibaba.fastjson.JSON;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.pojo.User;
import com.bwie.common.pojo.vo.VOLogMake; import com.bwie.common.pojo.vo.VOLogMake;
import com.bwie.common.result.Result; import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.list.mapper.ParkingMapper; import com.bwie.list.mapper.ParkingMapper;
import com.bwie.list.service.ParkingService; import com.bwie.list.service.ParkingService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,13 +27,13 @@ public class ParkingServiceImpl implements ParkingService {
public Result makeAppointment(VOLogMake voLogMake) { public Result makeAppointment(VOLogMake voLogMake) {
//1.获取用户信息 //1.获取用户信息
// String token = request.getHeader("token"); String token = request.getHeader("token");
// String userKey = JwtUtils.getUserKey(token); String userKey = JwtUtils.getUserKey(token);
// String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey); String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
// User user = JSON.parseObject(s, User.class); User user = JSON.parseObject(s, User.class);
// if (user != null) { if (user != null) {
// voLogMake.setUserId(user.getUserId()); voLogMake.setUserId(user.getUserId());
// } }
//2.添加预约信息 //2.添加预约信息
System.out.println("开始添加"); System.out.println("开始添加");
Integer i = parkingMapper.makeAppointment(voLogMake); Integer i = parkingMapper.makeAppointment(voLogMake);