注释完善

This commit is contained in:
万佳 2021-09-08 14:32:17 +08:00
parent 0e53da8715
commit 981c422f9c
3 changed files with 49 additions and 0 deletions

View File

@ -6,6 +6,7 @@ public class NewSysNotificationVo {
private long sender;
//接受者id单个id或多个 example:"1"/"1,2,3"
private String receivers;
private String content;

View File

@ -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);
}

View File

@ -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);