[fix]自己的视频默认是关注的,自己的喜欢显示数量
This commit is contained in:
parent
485834b2cd
commit
25c5f3466b
@ -16,11 +16,13 @@
|
|||||||
<!-- 控制台输出 -->
|
<!-- 控制台输出 -->
|
||||||
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>${log.path}/sys-console.log</file>
|
<file>${log.path}/sys-console.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!-- 日志文件名格式 -->
|
<!-- 日志文件名格式 -->
|
||||||
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
<!-- 日志最大 1天 -->
|
<!-- 日志最大 1天 -->
|
||||||
<maxHistory>1</maxHistory>
|
<maxHistory>1</maxHistory>
|
||||||
|
<!-- 日志文件最大大小 -->
|
||||||
|
<maxFileSize>10MB</maxFileSize>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
@ -35,12 +37,14 @@
|
|||||||
<!-- 系统日志输出 -->
|
<!-- 系统日志输出 -->
|
||||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>${log.path}/sys-info.log</file>
|
<file>${log.path}/sys-info.log</file>
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
<!-- 循环政策:基于时间和大小创建日志文件 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!-- 日志文件名格式 -->
|
<!-- 日志文件名格式 -->
|
||||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
<!-- 日志最大的历史 60天 -->
|
<!-- 日志最大的历史 60天 -->
|
||||||
<maxHistory>60</maxHistory>
|
<maxHistory>60</maxHistory>
|
||||||
|
<!-- 日志文件最大大小 -->
|
||||||
|
<maxFileSize>10MB</maxFileSize>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
@ -57,12 +61,14 @@
|
|||||||
|
|
||||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>${log.path}/sys-error.log</file>
|
<file>${log.path}/sys-error.log</file>
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
<!-- 循环政策:基于时间和大小创建日志文件 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!-- 日志文件名格式 -->
|
<!-- 日志文件名格式 -->
|
||||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
<!-- 日志最大的历史 60天 -->
|
<!-- 日志最大的历史 60天 -->
|
||||||
<maxHistory>60</maxHistory>
|
<maxHistory>60</maxHistory>
|
||||||
|
<!-- 日志文件最大大小 -->
|
||||||
|
<maxFileSize>10MB</maxFileSize>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
@ -98,24 +104,24 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 整合 skywalking 控制台输出 tid -->
|
<!-- 整合 skywalking 控制台输出 tid -->
|
||||||
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
|
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
|
||||||
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
||||||
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
||||||
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
||||||
<!-- </layout>-->
|
<!-- </layout>-->
|
||||||
<!-- <charset>utf-8</charset>-->
|
<!-- <charset>utf-8</charset>-->
|
||||||
<!-- </encoder>-->
|
<!-- </encoder>-->
|
||||||
<!-- </appender>-->
|
<!-- </appender>-->
|
||||||
|
|
||||||
<!-- 整合 skywalking 推送采集日志 -->
|
<!-- 整合 skywalking 推送采集日志 -->
|
||||||
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
|
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
|
||||||
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
||||||
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
||||||
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
||||||
<!-- </layout>-->
|
<!-- </layout>-->
|
||||||
<!-- <charset>utf-8</charset>-->
|
<!-- <charset>utf-8</charset>-->
|
||||||
<!-- </encoder>-->
|
<!-- </encoder>-->
|
||||||
<!-- </appender>-->
|
<!-- </appender>-->
|
||||||
|
|
||||||
<!--系统操作日志-->
|
<!--系统操作日志-->
|
||||||
<root level="debug">
|
<root level="debug">
|
||||||
@ -123,7 +129,7 @@
|
|||||||
<appender-ref ref="async_info" />
|
<appender-ref ref="async_info" />
|
||||||
<appender-ref ref="async_error" />
|
<appender-ref ref="async_error" />
|
||||||
<appender-ref ref="file_console" />
|
<appender-ref ref="file_console" />
|
||||||
<!-- <appender-ref ref="sky_log"/>-->
|
<!-- <appender-ref ref="sky_log"/>-->
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -250,12 +250,15 @@ public class VlogServiceImpl extends ServiceImpl<VlogMapper, Vlog> implements Vl
|
|||||||
}
|
}
|
||||||
//先检查是否已经点过赞了
|
//先检查是否已经点过赞了
|
||||||
if (myLikeVlogService.doILikeVlog(vlogId, Long.valueOf(userId))) {
|
if (myLikeVlogService.doILikeVlog(vlogId, Long.valueOf(userId))) {
|
||||||
throw new ServiceException("您已经点过赞了");
|
return;
|
||||||
}
|
}
|
||||||
// 我点赞的视频,关联关系保存到数据库
|
// 我点赞的视频,关联关系保存到数据库
|
||||||
myLikeVlogService.like(vlogId, Long.valueOf(vlog.getMemberId()), Long.valueOf(userId));
|
myLikeVlogService.like(vlogId, Long.valueOf(vlog.getMemberId()), Long.valueOf(userId));
|
||||||
clearMemberVlogCache(vlogId, userId,vlog.getMemberId());
|
clearMemberVlogCache(vlogId, userId,vlog.getMemberId());
|
||||||
//发送消息
|
//发送消息
|
||||||
|
if(userId.equals(vlog.getMemberId())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
MqUtil.sendIMMessage(buildMessage(vlog));
|
MqUtil.sendIMMessage(buildMessage(vlog));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,8 +328,9 @@ public class VlogServiceImpl extends ServiceImpl<VlogMapper, Vlog> implements Vl
|
|||||||
|
|
||||||
likedPage.getRecords().stream().forEach(
|
likedPage.getRecords().stream().forEach(
|
||||||
liked -> {
|
liked -> {
|
||||||
liked.setDoIFollowVloger(true);
|
liked.setDoIFollowVloger(fansService.queryDoIFollowVloger(user.getUserId(), Long.valueOf(liked.getMemberId())));
|
||||||
liked.setDoILikeThisVlog(true);
|
liked.setDoILikeThisVlog(true);
|
||||||
|
liked.setLikeCounts(myLikeVlogService.getVLogLikeCount(liked.getId()));
|
||||||
});
|
});
|
||||||
return likedPage;
|
return likedPage;
|
||||||
}
|
}
|
||||||
|
@ -151,6 +151,9 @@ public class FansServiceImpl extends ServiceImpl<FansMapper, Fans> implements IF
|
|||||||
@Override
|
@Override
|
||||||
@Cacheable(cacheNames = GlobalConstants.GLOBAL_MEMBER_DOIFOLLOW, key = "#myId" + "-" + "#vloggerId")
|
@Cacheable(cacheNames = GlobalConstants.GLOBAL_MEMBER_DOIFOLLOW, key = "#myId" + "-" + "#vloggerId")
|
||||||
public boolean queryDoIFollowVloger(Long myId, Long vloggerId) {
|
public boolean queryDoIFollowVloger(Long myId, Long vloggerId) {
|
||||||
|
if (myId.equals(vloggerId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return baseMapper.selectCount(new LambdaQueryWrapper<Fans>().eq(Fans::getFanId, myId).eq(Fans::getVloggerId, vloggerId)) > 0;
|
return baseMapper.selectCount(new LambdaQueryWrapper<Fans>().eq(Fans::getFanId, myId).eq(Fans::getVloggerId, vloggerId)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user