提交 565c33bb authored 作者: 吴德鹏's avatar 吴德鹏

评论

上级 d53fd962
...@@ -223,6 +223,7 @@ public class ItemController { ...@@ -223,6 +223,7 @@ public class ItemController {
//商品详情 //商品详情
Optional<TbCfItemDesc> byId = descRepository.findById(itemId); Optional<TbCfItemDesc> byId = descRepository.findById(itemId);
map.put("score", item.getTotalScore()); map.put("score", item.getTotalScore());
map.put("itemScore",item.getItemScore());
map.put("isCollection", userId != null && !userId.isEmpty() && collectionRepository.existsByUserIdAndItemItemId(userId, itemId)); map.put("isCollection", userId != null && !userId.isEmpty() && collectionRepository.existsByUserIdAndItemItemId(userId, itemId));
map.put("optionList", categoryList); map.put("optionList", categoryList);
map.put("itemDetail", skusList); map.put("itemDetail", skusList);
......
...@@ -562,7 +562,7 @@ public class OrderController extends Controller { ...@@ -562,7 +562,7 @@ public class OrderController extends Controller {
@PostMapping("/add/comment") @PostMapping("/add/comment")
public Result addComment(TbCfItemComment comment) throws Exception { public Result addComment(TbCfItemComment comment) throws Exception {
logger.info("上传files:", comment.getFiles()); logger.info("上传files:", comment);
TbCfUserInfo user = this.user.user(); TbCfUserInfo user = this.user.user();
......
...@@ -133,6 +133,8 @@ public class TbCfStationItem { ...@@ -133,6 +133,8 @@ public class TbCfStationItem {
@Formula(value = "(SELECT IFNULL(ROUND(SUM((a.item_score+a.service_score+a.logistics_score+a.price_score)/4)/COUNT(a.item_id),1),5.0) FROM tb_cf_item_comment a WHERE a.item_id=item_id)") @Formula(value = "(SELECT IFNULL(ROUND(SUM((a.item_score+a.service_score+a.logistics_score+a.price_score)/4)/COUNT(a.item_id),1),5.0) FROM tb_cf_item_comment a WHERE a.item_id=item_id)")
private double totalScore; private double totalScore;
@Formula(value = "(SELECT IFNULL(ROUND(SUM((a.item_score+a.service_score+a.logistics_score+a.price_score)/4)/COUNT(a.item_id),1),5.0) FROM tb_cf_item_comment a WHERE a.item_id=item_id)")
private double itemScore;
@JsonIgnore @JsonIgnore
@OneToMany(mappedBy = "item", cascade = CascadeType.ALL) @OneToMany(mappedBy = "item", cascade = CascadeType.ALL)
...@@ -159,6 +161,14 @@ public class TbCfStationItem { ...@@ -159,6 +161,14 @@ public class TbCfStationItem {
this.labelList = labelList; this.labelList = labelList;
} }
public double getItemScore() {
return itemScore;
}
public void setItemScore(double itemScore) {
this.itemScore = itemScore;
}
/** /**
* 获取:商品id * 获取:商品id
*/ */
......
...@@ -28,7 +28,7 @@ public class JwtUtils { ...@@ -28,7 +28,7 @@ public class JwtUtils {
return Jwts.builder() return Jwts.builder()
.setSubject((userPrincipal.getId())) .setSubject((userPrincipal.getId()))
.setIssuedAt(new Date()) .setIssuedAt(new Date())
.setExpiration(new Date((new Date()).getTime() + (jwtExpirationMs * 20))) .setExpiration(new Date((new Date()).getTime() + (jwtExpirationMs * 365)))
.signWith(SignatureAlgorithm.HS512, jwtSecret) .signWith(SignatureAlgorithm.HS512, jwtSecret)
.compact(); .compact();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论