refactor: 通知公告的优化

通知公告的优化
This commit is contained in:
Theo
2024-09-21 21:43:20 +08:00
parent 29b23e5c04
commit 0691b93112
10 changed files with 15 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import com.youlai.boot.common.result.PageResult;
import com.youlai.boot.common.result.Result;
import com.youlai.boot.system.model.form.NoticeForm;
import com.youlai.boot.system.model.query.NoticeQuery;
import com.youlai.boot.system.model.vo.NoticeStatusVO;
import com.youlai.boot.system.model.vo.NoticeVO;
import com.youlai.boot.system.service.NoticeService;
import com.youlai.boot.system.service.NoticeStatusService;
@@ -123,8 +124,8 @@ public class NoticeController {
@Operation(summary = "获取我的通知公告")
@GetMapping("/my/page")
public PageResult<NoticeVO> getMyNoticePage(NoticeQuery queryParams) {
IPage<NoticeVO> result = noticeService.getMyNoticePage(queryParams);
public PageResult<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams) {
IPage<NoticeStatusVO> result = noticeService.getMyNoticePage(queryParams);
return PageResult.success(result);
}
}

View File

@@ -34,5 +34,5 @@ public interface NoticeStatusMapper extends BaseMapper<NoticeStatus> {
* @param queryParams 查询参数
* @return 通知公告分页列表
*/
IPage<NoticeVO> getMyNoticePage(Page<NoticeVO> page, @Param("queryParams") NoticeQuery queryParams);
IPage<NoticeStatusVO> getMyNoticePage(Page<NoticeVO> page, @Param("queryParams") NoticeQuery queryParams);
}

View File

@@ -25,7 +25,7 @@ public class NoticeDetailVO {
private String content;
@Schema(description = "通知类型")
private String noticeTypeLabel;
private String noticeType;
@Schema(description = "发布人")
private String releaseBy;

View File

@@ -23,7 +23,7 @@ public class NoticeStatusVO {
private String title;
@Schema(description = "通知类型")
private String noticeTypeLabel;
private String noticeType;
@Schema(description = "发布人")
private String releaseBy;

View File

@@ -29,7 +29,7 @@ public class NoticeVO implements Serializable {
private String title;
@Schema(description = "通知类型")
private String noticeTypeLabel;
private String noticeType;
@Schema(description = "发布人")
private String releaseBy;

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.youlai.boot.system.model.entity.Notice;
import com.youlai.boot.system.model.form.NoticeForm;
import com.youlai.boot.system.model.query.NoticeQuery;
import com.youlai.boot.system.model.vo.NoticeStatusVO;
import com.youlai.boot.system.model.vo.NoticeVO;
import com.youlai.boot.system.model.vo.NoticeDetailVO;
@@ -92,5 +93,5 @@ public interface NoticeService extends IService<Notice> {
* @param queryParams 查询参数
* @return 通知公告分页列表
*/
IPage<NoticeVO> getMyNoticePage(NoticeQuery queryParams);
IPage<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams);
}

View File

@@ -34,7 +34,7 @@ public interface NoticeStatusService extends IService<NoticeStatus> {
* 分页获取我的通知公告
* @param page 分页对象
* @param queryParams 查询参数
* @return 通知公告分页列表
* @return 我的通知公告分页列表
*/
IPage<NoticeVO> getMyNoticePage(Page<NoticeVO> page, NoticeQuery queryParams);
IPage<NoticeStatusVO> getMyNoticePage(Page<NoticeVO> page, NoticeQuery queryParams);
}

View File

@@ -269,7 +269,7 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
* @return 通知公告分页列表
*/
@Override
public IPage<NoticeVO> getMyNoticePage(NoticeQuery queryParams) {
public IPage<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams) {
Long userId = SecurityUtils.getUserId();
queryParams.setUserId(userId);
return noticeStatusService.getMyNoticePage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),queryParams);

View File

@@ -59,7 +59,7 @@ public class NoticeStatusServiceImpl extends ServiceImpl<NoticeStatusMapper, Not
* @return 通知公告分页列表
*/
@Override
public IPage<NoticeVO> getMyNoticePage(Page<NoticeVO> page, NoticeQuery queryParams) {
public IPage<NoticeStatusVO> getMyNoticePage(Page<NoticeVO> page, NoticeQuery queryParams) {
return this.getBaseMapper().getMyNoticePage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),queryParams);
}