Compare commits
No commits in common. "d1e6e5e15a4f628c3737bbe5776f09cc54fa8233" and "34fb667a107111583f444706b2a67d64ff306de5" have entirely different histories.
d1e6e5e15a
...
34fb667a10
|
@ -14,10 +14,4 @@ auth:
|
||||||
- /maku/t_user/register
|
- /maku/t_user/register
|
||||||
- /maku/t_user/logout
|
- /maku/t_user/logout
|
||||||
- /maku/t_user/info
|
- /maku/t_user/info
|
||||||
- /maku/t_book/list/search
|
- /maku/t_user/recharge
|
||||||
- /maku/t_book/{id}
|
|
||||||
- /maku/t_book/{id}
|
|
||||||
- /user/login
|
|
||||||
- /maku/t_shopping_trolley/aaa
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,26 @@ import java.util.List;
|
||||||
public class TBookCommentController {
|
public class TBookCommentController {
|
||||||
private final TBookCommentService tBookCommentService;
|
private final TBookCommentService tBookCommentService;
|
||||||
private final RedisCache redisCache;
|
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")
|
@GetMapping("page")
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user