消息--添加--获取新增点赞数

This commit is contained in:
haotianmingyue 2024-12-30 15:58:16 +08:00
parent 0b29628ab5
commit 2b5624a55b
5 changed files with 36 additions and 1 deletions

View File

@ -1502,6 +1502,18 @@ public class AppSystemController extends BaseController {
return success(sysUserNotification);
}
//消息--查看新增喜爱数
@GetMapping("/addLikeCount")
public AjaxResult addLikeCount()
{
Long userId = getUserId();
Long count = userNotificationService.getAddLikeCount(userId);
System.out.println("count : "+count);
return success(count);
}
// 新增点赞信息
@GetMapping("/addLike/{workId}")
@Transactional

View File

@ -69,6 +69,11 @@ public interface SysUserNotificationMapper
* */
public Long getAddFollowerCount(Long userId);
/*
* 查看新增点赞数
* */
public Long getAddLikeCount(Long userId);
/*
* 读消息
* */

View File

@ -70,6 +70,11 @@ public interface ISysUserNotificationService
* */
public Long getAddFollowerCount(Long userId);
/*
* 查看新增点赞数
* */
public Long getAddLikeCount(Long userId);
/*
* 读消息
* */

View File

@ -165,6 +165,14 @@ public class SysUserNotificationServiceImpl implements ISysUserNotificationServi
return sysUserNotificationMapper.getAddFollowerCount(userId);
}
/*
* 查看新增点赞数
* */
@Override
public Long getAddLikeCount(Long userId){
return sysUserNotificationMapper.getAddLikeCount(userId);
}
/*
* 读消息
* */

View File

@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAddFollowerCount" resultType="java.lang.Long">
select count(*)
from sys_user_notification
where user_id = #{userId} and status = '0'
where user_id = #{userId} and status = '0' and type = '1'
</select>
<select id="getSystemMessage" resultMap="SysNotificationDtoResult">
select id, type, status, detail, create_time
@ -62,6 +62,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where user_id = #{userId} and type != '1' and type != '2'
</select>
<select id="getAddLikeCount" resultType="java.lang.Long">
select count(*)
from sys_user_notification
where user_id = #{userId} and status = '0' and type = '2'
</select>
<insert id="insertSysUserNotification" parameterType="SysUserNotification" useGeneratedKeys="true" keyProperty="id">
insert into sys_user_notification