提交 6ec5c575 authored 作者: wudepeng's avatar wudepeng

Merge remote-tracking branch 'origin/master'

......@@ -301,6 +301,11 @@ public class ItemController {
// 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));
c.setUserName(newNick);
//旧数据不是存的图片链接
if (StringUtils.isBlank(c.getUrls()) || !c.getUrls().startsWith("http")) {
c.setUrls(null);
c.setImgLength(0);
}
if (!StringUtils.isBlank(userId)) {
String liked = (String) redisCache.get(key + userId + "_" + c.getId());
c.setLike(liked == null ? false : true);
......
......@@ -7,6 +7,7 @@ import org.hibernate.annotations.Formula;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Nullable;
......@@ -119,6 +120,8 @@ public class TbCfItemComment {
private double score;
@Transient
private double totalScore;
@Transient
private Integer imgLength;
private String attributs;
......@@ -269,11 +272,11 @@ public class TbCfItemComment {
}
public String[] getImgs() {
return urls != null ? urls.split(";") : null;
return !StringUtils.isBlank(urls) ? urls.split(";") : null;
}
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 {
public void setLikeCount(int likeCount) {
this.likeCount = likeCount;
}
public void setImgLength(Integer imgLength) {
this.imgLength = imgLength;
}
}
......@@ -71,7 +71,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
"/goodsType/**", "/home/**", "/spider/**", "/store/**", "/shopify/**", "/community/**", "/version/**",
"/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**", "/paypal/**", "/discover/bonus/**",
"/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()
.anyRequest().authenticated();
......
......@@ -2,7 +2,7 @@ server.servlet.context-path=/zion
spring.jpa.hibernate.ddl-auto=update
server.port=8083
spring.profiles.active=test
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliant\TimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.password=Diaoyunnuli.8
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
......@@ -25,5 +25,5 @@ spring.servlet.multipart.max-request-size=456128KB
bezkoder.app.jwtSecret=bezKoderSecretKey
bezkoder.app.jwtExpirationMs=86400000
#spring.jpa.show-sql=true
#spring.jpa.properties.hibernate.format_sql=true
\ No newline at end of file
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论