Compare commits
2 Commits
34fb667a10
...
d1e6e5e15a
Author | SHA1 | Date | |
---|---|---|---|
|
d1e6e5e15a | ||
|
3221c3bcc9 |
|
@ -14,4 +14,10 @@ auth:
|
|||
- /maku/t_user/register
|
||||
- /maku/t_user/logout
|
||||
- /maku/t_user/info
|
||||
- /maku/t_user/recharge
|
||||
- /maku/t_book/list/search
|
||||
- /maku/t_book/{id}
|
||||
- /maku/t_book/{id}
|
||||
- /user/login
|
||||
- /maku/t_shopping_trolley/aaa
|
||||
|
||||
|
||||
|
|
|
@ -38,26 +38,7 @@ import java.util.List;
|
|||
public class TBookCommentController {
|
||||
private final TBookCommentService tBookCommentService;
|
||||
private final RedisCache redisCache;
|
||||
@PostMapping("/comment")
|
||||
public Result setshoppingtrolly(HttpServletRequest request, @RequestBody TBookCommentVO vo) {
|
||||
// 首先验证token的有效性,然后从Redis中获取用户信息
|
||||
String token = request.getHeader("token");
|
||||
if(token==null || token.isEmpty()){
|
||||
return Result.error("token is error");
|
||||
}
|
||||
TUserEntity tUserEntity = (TUserEntity) redisCache.get(token);
|
||||
Integer userId=tUserEntity.getId();
|
||||
LocalDateTime currentTime = LocalDateTime.now();
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
|
||||
//DATE没有时区二localDateTime有时区,为了将 LocalDateTime 转换为 Date,你需要指定一个时区,因为 Date 是基于UTC的
|
||||
// 将LocalDateTime转换为ZonedDateTime,然后转换为Instant,最后转换为Date
|
||||
// ZonedDateTime zdt = currentTime.atZone(zoneId);
|
||||
// Date date = Date.from(zdt.toInstant());
|
||||
// tBookCollectionService.save(userId,bookId,date);
|
||||
return Result.ok("加入购物车成功");
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
|
|
Loading…
Reference in New Issue
Block a user