同城数据异常,视频详情评论数

This commit is contained in:
abu 2025-05-25 13:55:07 +08:00
parent da407669c8
commit 5272e2197c
3 changed files with 19 additions and 4 deletions

View File

@ -26,9 +26,12 @@ nacos:
counts: 10 counts: 10
# 整合mybatis # 整合mybatis
mybatis: mybatis:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
type-aliases-package: com.imooc.pojo,com.imooc.vo,com.imooc.mo,com.imooc.bo # 所有pojo类所在的包路径 type-aliases-package: com.imooc.pojo,com.imooc.vo,com.imooc.mo,com.imooc.bo # 所有pojo类所在的包路径
mapper-locations: classpath:mapper/*.xml # mapper映射文件 mapper-locations: classpath:mapper/*.xml # mapper映射文件
# 通用mapper工具的配置 # 通用mapper工具的配置
mapper: mapper:
mappers: com.imooc.my.mapper.MyMapper # 配置MyMapper包含了一些封装好的CRUD方法 mappers: com.imooc.my.mapper.MyMapper # 配置MyMapper包含了一些封装好的CRUD方法
@ -44,6 +47,8 @@ pagehelper:
logging: logging:
level: level:
root: info root: info
com.imooc.mapper: DEBUG
org.apache.ibatis: DEBUG
@ -58,3 +63,6 @@ minio:
fileSize: 1024 # 文件大小限制单位m fileSize: 1024 # 文件大小限制单位m

View File

@ -30,7 +30,7 @@
WHERE WHERE
v.is_private = 0 v.is_private = 0
<choose> <choose>
<when test="paramMap.status != null and paramMap.status!=''"> <when test="paramMap.status != null">
AND v.status = #{paramMap.status} AND v.status = #{paramMap.status}
</when> </when>
<otherwise> <otherwise>
@ -38,7 +38,7 @@
</otherwise> </otherwise>
</choose> </choose>
AND v.first_frame_img IS NOT NULL AND v.first_frame_img IS NOT NULL
<if test="paramMap.cityCode != null and paramMap.cityCode != ''"> <if test="paramMap.cityCode != null">
AND v.city_code = #{paramMap.cityCode} AND v.city_code = #{paramMap.cityCode}
</if> </if>
<if test="paramMap.search != null and paramMap.search != ''"> <if test="paramMap.search != null and paramMap.search != ''">

View File

@ -166,11 +166,16 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
map.put("search", search); map.put("search", search);
} }
if (StringUtils.isNotBlank(cityCode)) { if (StringUtils.isNotBlank(cityCode)) {
map.put("cityCode", cityCode); map.put("cityCode", Integer.parseInt(cityCode));
} }
if (StringUtils.isNotBlank(status)) { if (StringUtils.isNotBlank(status)) {
map.put("status", status); map.put("status", Integer.parseInt(status));
} }
for (Map.Entry<String, Object> entry : map.entrySet()) {
System.err.println("key = " + entry.getKey() + ", value = " + entry.getValue()
+ ", type = " + (entry.getValue() != null ? entry.getValue().getClass().getName() : "null"));
}
if(StringUtils.isNotBlank(userId)){ if(StringUtils.isNotBlank(userId)){
// 从redis中获取举报信息 // 从redis中获取举报信息
String redisKey = REDIS_VIDEO_BLOCK + ":" + userId; String redisKey = REDIS_VIDEO_BLOCK + ":" + userId;
@ -256,6 +261,8 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
// 获得当前视频被点赞过的总数 // 获得当前视频被点赞过的总数
v.setLikeCounts(getVlogBeLikedCounts(vlogId)); v.setLikeCounts(getVlogBeLikedCounts(vlogId));
// 评论数
v.setCommentsCounts(getVlogComment(vlogId));
return v; return v;
} }