| | |
| | | package com.xiaopeng.account.service.impl; |
| | | |
| | | import com.xiaopeng.account.mapper.XpOperationsUserNotificationMapper; |
| | | import com.xiaopeng.account.service.IXpOperationsUserNotificationService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.account.mapper.XpOperationsUserNotificationMapper; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserNotificationPageQuery; |
| | | import com.xiaopeng.account.service.IXpOperationsUserNotificationService; |
| | | import com.xiaopeng.api.model.account.XpOperationsUserNotification; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class XpOperationsUserNotificationServiceImpl extends ServiceImpl<XpOperationsUserNotificationMapper, XpOperationsUserNotification> implements IXpOperationsUserNotificationService { |
| | | |
| | | @Override |
| | | public PageInfo<XpOperationsUserNotification> selectNotificationPageByUserId( |
| | | XpOperationsUserNotificationPageQuery query) { |
| | | |
| | | // 创建分页对象 |
| | | Page<XpOperationsUserNotification> page = new Page<>( |
| | | query.getPageNum(), |
| | | query.getPageSize() |
| | | ); |
| | | |
| | | // 执行分页查询 |
| | | Page<XpOperationsUserNotification> resultPage = baseMapper.selectNotificationPageByUserId( |
| | | page, |
| | | query |
| | | ); |
| | | |
| | | // 封装分页结果 |
| | | PageInfo<XpOperationsUserNotification> pageInfo = new PageInfo<>(); |
| | | pageInfo.setRecords(resultPage.getRecords()); |
| | | pageInfo.setTotal(resultPage.getTotal()); |
| | | |
| | | return pageInfo; |
| | | } |
| | | } |