消息--添加--获取点赞列表
This commit is contained in:
parent
2b5624a55b
commit
73f23e669d
@ -1514,6 +1514,22 @@ public class AppSystemController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
//消息--获取点赞列表
|
||||
@Transactional
|
||||
@GetMapping("/getWorkLikeList")
|
||||
public TableDataInfo getWorkLikeList()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
|
||||
// 点了之后所有的点赞信息应该已读
|
||||
userNotificationService.readNotifiaction(userId, "2", "1");
|
||||
|
||||
// 先从系统通知中获取
|
||||
List<WorkLikeDto> addLikeList = userNotificationService.getWorkLikeList(userId);
|
||||
return getDataTable(addLikeList);
|
||||
|
||||
}
|
||||
|
||||
// 新增点赞信息
|
||||
@GetMapping("/addLike/{workId}")
|
||||
@Transactional
|
||||
|
||||
@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class WorkLikeDto {
|
||||
|
||||
private Long id;
|
||||
private Long userId;
|
||||
private String nickName;
|
||||
private String avatar;
|
||||
private Long workId;
|
||||
private String workName;
|
||||
private String workAddress;
|
||||
private String detail;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public Long getWorkId() {
|
||||
return workId;
|
||||
}
|
||||
|
||||
public void setWorkId(Long workId) {
|
||||
this.workId = workId;
|
||||
}
|
||||
|
||||
public String getWorkName() {
|
||||
return workName;
|
||||
}
|
||||
|
||||
public void setWorkName(String workName) {
|
||||
this.workName = workName;
|
||||
}
|
||||
|
||||
public String getWorkAddress() {
|
||||
return workAddress;
|
||||
}
|
||||
|
||||
public void setWorkAddress(String workAddress) {
|
||||
this.workAddress = workAddress;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserNotification;
|
||||
import com.ruoyi.system.domain.dto.SysNotificationDto;
|
||||
import com.ruoyi.system.domain.dto.WorkLikeDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -83,4 +84,10 @@ public interface SysUserNotificationMapper
|
||||
* 消息--查看系统消息
|
||||
* */
|
||||
public List<SysNotificationDto> getSystemMessage(Long userId);
|
||||
|
||||
/*
|
||||
|
||||
*消息--查看新增点赞消息
|
||||
*/
|
||||
public List<WorkLikeDto> getWorkLikeList(Long userId);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
import com.ruoyi.system.domain.dto.WorkLikeDto;
|
||||
|
||||
/**
|
||||
* 用户点赞Service接口
|
||||
@ -62,4 +63,6 @@ public interface ISysUserLikeService
|
||||
/*
|
||||
* 根据userId和用户作品id, 查询给这个用户点赞的消息*/
|
||||
public List<SysUserLike> selectSysUserLikeByUserIdAndTargetId(Long userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.system.service;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserNotification;
|
||||
import com.ruoyi.system.domain.dto.SysNotificationDto;
|
||||
import com.ruoyi.system.domain.dto.WorkLikeDto;
|
||||
import com.ruoyi.system.domain.vo.UserMessageVo;
|
||||
|
||||
/**
|
||||
@ -85,4 +86,8 @@ public interface ISysUserNotificationService
|
||||
* */
|
||||
public List<SysNotificationDto> getSystemMessage(Long userId);
|
||||
|
||||
/*
|
||||
* 消息--查看点赞消息列表
|
||||
* */
|
||||
public List<WorkLikeDto> getWorkLikeList(Long userId);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.SysUserFollow;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
import com.ruoyi.system.domain.dto.SysNotificationDto;
|
||||
import com.ruoyi.system.domain.dto.WorkLikeDto;
|
||||
import com.ruoyi.system.domain.vo.UserMessageVo;
|
||||
import com.ruoyi.system.service.ISysUserFollowService;
|
||||
import com.ruoyi.system.service.ISysUserLikeService;
|
||||
@ -189,4 +190,12 @@ public class SysUserNotificationServiceImpl implements ISysUserNotificationServi
|
||||
public List<SysNotificationDto> getSystemMessage(Long userId){
|
||||
return sysUserNotificationMapper.getSystemMessage(userId);
|
||||
}
|
||||
|
||||
/*
|
||||
* 消息--查看点赞消息列表
|
||||
* */
|
||||
@Override
|
||||
public List<WorkLikeDto> getWorkLikeList(Long userId){
|
||||
return sysUserNotificationMapper.getWorkLikeList(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="detail" column="detail"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="WorkLikeDtoResult" type="WorkLikeDto">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="workId" column="work_id" />
|
||||
<result property="workName" column="work_name" />
|
||||
<result property="workAddress" column="work_address" />
|
||||
<result property="detail" column="detail" />
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysUserNotificationVo">
|
||||
select id, user_id, sender_id, type, target_id, target_type, status, create_time, update_time , detail from sys_user_notification
|
||||
</sql>
|
||||
@ -67,6 +80,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from sys_user_notification
|
||||
where user_id = #{userId} and status = '0' and type = '2'
|
||||
</select>
|
||||
<select id="getWorkLikeList" resultMap="WorkLikeDtoResult">
|
||||
select n.id, n.user_id, u.nick_name, u.avatar, w.work_id, w.work_name, w.work_address, n.create_time, n.detail
|
||||
from sys_user_notification n
|
||||
left join sys_user u on n.sender_id = u.user_id
|
||||
left join user_work w on n.target_id = w.work_id
|
||||
where n.user_id = #{userId} and n.type = '2'
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserNotification" parameterType="SysUserNotification" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_user_notification
|
||||
|
||||
Loading…
Reference in New Issue
Block a user