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

修改评论bug

...@@ -301,6 +301,11 @@ public class ItemController { ...@@ -301,6 +301,11 @@ public class ItemController {
// String newNick = nick.substring(0, 1) + "***" + nick.substring(nick.length() - 1); // String newNick = nick.substring(0, 1) + "***" + nick.substring(nick.length() - 1);
String newNick = String.format("%s***%s", nick.charAt(0), nick.charAt(nick.length() - 1)); String newNick = String.format("%s***%s", nick.charAt(0), nick.charAt(nick.length() - 1));
c.setUserName(newNick); c.setUserName(newNick);
//旧数据不是存的图片链接
if (StringUtils.isBlank(c.getUrls()) || !c.getUrls().startsWith("http")) {
c.setUrls(null);
c.setImgLength(0);
}
if (!StringUtils.isBlank(userId)) { if (!StringUtils.isBlank(userId)) {
String liked = (String) redisCache.get(key + userId + "_" + c.getId()); String liked = (String) redisCache.get(key + userId + "_" + c.getId());
c.setLike(liked == null ? false : true); c.setLike(liked == null ? false : true);
......
...@@ -7,6 +7,7 @@ import org.hibernate.annotations.Formula; ...@@ -7,6 +7,7 @@ import org.hibernate.annotations.Formula;
import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction; import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Nullable; import javax.annotation.Nullable;
...@@ -119,6 +120,8 @@ public class TbCfItemComment { ...@@ -119,6 +120,8 @@ public class TbCfItemComment {
private double score; private double score;
@Transient @Transient
private double totalScore; private double totalScore;
@Transient
private Integer imgLength;
private String attributs; private String attributs;
...@@ -269,11 +272,11 @@ public class TbCfItemComment { ...@@ -269,11 +272,11 @@ public class TbCfItemComment {
} }
public String[] getImgs() { public String[] getImgs() {
return urls != null ? urls.split(";") : null; return !StringUtils.isBlank(urls) ? urls.split(";") : null;
} }
public Integer getImgLength() { public Integer getImgLength() {
return urls != null ? urls.split(";").length : 0; return !StringUtils.isBlank(urls) ? urls.split(";").length : 0;
} }
/** /**
...@@ -429,4 +432,8 @@ public class TbCfItemComment { ...@@ -429,4 +432,8 @@ public class TbCfItemComment {
public void setLikeCount(int likeCount) { public void setLikeCount(int likeCount) {
this.likeCount = likeCount; this.likeCount = likeCount;
} }
public void setImgLength(Integer imgLength) {
this.imgLength = imgLength;
}
} }
...@@ -71,7 +71,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -71,7 +71,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
"/goodsType/**", "/home/**", "/spider/**", "/store/**", "/shopify/**", "/community/**", "/version/**", "/goodsType/**", "/home/**", "/spider/**", "/store/**", "/shopify/**", "/community/**", "/version/**",
"/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**", "/paypal/**", "/discover/bonus/**", "/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**", "/paypal/**", "/discover/bonus/**",
"/problem/**", "/cube/**", "/activity/**", "/attributes/**", "/stripe/**", "/coupon/**", "/logistics/freeShippingThreshold", "/problem/**", "/cube/**", "/activity/**", "/attributes/**", "/stripe/**", "/coupon/**", "/logistics/freeShippingThreshold",
"/visit/**", "/search/**", "/country/**", "/term/**", "/api/upload", "/cart/**", "/address/**","/screen/**").permitAll() "/visit/**", "/search/**", "/country/**", "/term/**", "/api/upload", "/cart/**", "/address/**","/screen/**","/discover/post/**").permitAll()
.antMatchers("/api/test/**").permitAll() .antMatchers("/api/test/**").permitAll()
.anyRequest().authenticated(); .anyRequest().authenticated();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论