注释完善
This commit is contained in:
parent
0e53da8715
commit
981c422f9c
|
|
@ -6,6 +6,7 @@ public class NewSysNotificationVo {
|
|||
|
||||
private long sender;
|
||||
|
||||
//接受者id,单个id或多个 example:"1"/"1,2,3"
|
||||
private String receivers;
|
||||
|
||||
private String content;
|
||||
|
|
|
|||
|
|
@ -8,15 +8,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import java.util.List;
|
||||
|
||||
public interface SysNotificationService extends IService<SysNotification> {
|
||||
//给用户发送消息
|
||||
boolean addSysNotificationForUsers(NewSysNotificationVo sysNotification);
|
||||
|
||||
//变更消息状态
|
||||
int changeStatusByNotificationIds(String platform, String notificationIds, Integer status);
|
||||
|
||||
//获取全部未读消息数量
|
||||
int getAllNewSysNotificationNumber(String platform, Integer receiver);
|
||||
|
||||
//获取未读消息列表
|
||||
List<SysNotification> getUnreadSysNotificationsList(String platform, Integer receiver, Integer notificationNumber);
|
||||
|
||||
//根据类型获取未读系统消息数量
|
||||
int getSysNotificationNumberByType(String platform, Integer receiver, Integer type);
|
||||
|
||||
//获取全部消息分页列表
|
||||
Page<SysNotification> getAllSysNotificationsPageList(int curPage, int pageSize, String orderBy, String platform, Integer receiver);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ import java.util.List;
|
|||
@Service(value = "sysNotificationServiceImpl")
|
||||
public class SysNotificationServiceImpl extends ServiceImpl<SysNotificationMapper, SysNotification> implements SysNotificationService {
|
||||
|
||||
/**
|
||||
* @Description: 给用户发送消息
|
||||
* @Param: [newSysNotificationVo]
|
||||
* @return: boolean
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean addSysNotificationForUsers(NewSysNotificationVo newSysNotificationVo) {
|
||||
|
|
@ -31,27 +38,62 @@ public class SysNotificationServiceImpl extends ServiceImpl<SysNotificationMappe
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 变更消息状态
|
||||
* @Param: [platform:平台编码, notificationIds:消息id example-"23,24,25", status:1-未读2-已读]
|
||||
* @return: int
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
public int changeStatusByNotificationIds(String platform, String notificationIds, Integer status) {
|
||||
return baseMapper.updateStatusByNotificationId(platform, notificationIds, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 获取全部未读消息数量
|
||||
* @Param: [platform:平台编码, receiver:接收者id]
|
||||
* @return: int
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
public int getAllNewSysNotificationNumber(String platform, Integer receiver) {
|
||||
return baseMapper.getNewSysNotificationNumber(platform, receiver);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 获取未读消息列表
|
||||
* @Param: [platform:平台编码, receiver:接收者id, notificationNumber:消息limit数]
|
||||
* @return: java.util.List<SysNotification>
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
public List<SysNotification> getUnreadSysNotificationsList(String platform, Integer receiver, Integer notificationNumber) {
|
||||
List<SysNotification> sysNotificationList = baseMapper.getUnreadSysNotificationsList(platform, receiver, 1, notificationNumber);
|
||||
return sysNotificationList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 根据类型获取未读系统消息数量
|
||||
* @Param: [platform:平台编码, receiver:接收者id, type:消息类型1-系统消息2-@我]
|
||||
* @return: int
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
public int getSysNotificationNumberByType(String platform, Integer receiver, Integer type) {
|
||||
return baseMapper.getSysNotificationNumberByType(platform, receiver, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 获取全部消息分页列表
|
||||
* @Param: [curPage, pageSize, orderBy, platform:平台编码, receiver:接受者id]
|
||||
* @return: Page<SysNotification>
|
||||
* @Author: wanjia
|
||||
* @Date: 2021/9/8
|
||||
*/
|
||||
@Override
|
||||
public Page<SysNotification> getAllSysNotificationsPageList(int curPage, int pageSize, String orderBy, String platform, Integer receiver) {
|
||||
Page page = new Page<SysNotification>(curPage, pageSize);
|
||||
|
|
|
|||
Loading…
Reference in New Issue