散户下单接口问题修复2

wxpay
LI-CCONG\李聪聪 8 months ago
parent a076727389
commit 8ff3b2c30a

@ -41,7 +41,7 @@ public class RecycleOrderCreateVO {
@ApiModelProperty(value = "当前位置", required = true)
@NotNull(message = "位置定位信息未授权")
@Valid
private LocationDTO locationDTO;
private LocationDTO location;
@ApiModelProperty(value = "预约上门时间起", required = true, example = "2024-03-01 15:58:49")
@NotNull(message = "预约上门时间起不能为空")

@ -29,10 +29,14 @@ public class LoginInterceptor implements HandlerInterceptor {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 1.获取请求头中的 token
String token = request.getHeader("authorization");
log.info("request token = {}", token);
if (ObjectUtil.isEmpty(token)) {
throw new UnauthorizedException("请登录后访问!");
}
// 2.缓存中读取token信息
boolean existsKey = redisTool.existsKey(CommonService.TOKEN_KEY + token);
if (!existsKey) {
throw new UnauthorizedException("token已过期");
throw new UnauthorizedException("登录过期,请重新登录!");
}
// 这里userInfo可以来自缓存 todo
// 3.校验token

@ -94,8 +94,8 @@ public class RecycleOrderServiceImpl extends ServiceImpl<RecycleOrderMapper, Rec
throw new DbException("散户不存在");
}
RecycleOrder recycleOrder = BeanUtils.copyBean(orderCreateVO, RecycleOrder.class, (source, target) -> {
target.setLatitude(source.getLocationDTO().getLatitude());
target.setLongitude(source.getLocationDTO().getLongitude());
target.setLatitude(source.getLocation().getLatitude());
target.setLongitude(source.getLocation().getLongitude());
});
String idNumber = CommonUtil.getIdNumber(BusinessCodeEnum.ORDER.getCode());
recycleOrder.setClientId(client.getId());

Loading…
Cancel
Save