refactor: 通知公告的优化
通知公告的优化
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NoticeDetailVO {
|
||||
private String content;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private String noticeTypeLabel;
|
||||
private String noticeType;
|
||||
|
||||
@Schema(description = "发布人")
|
||||
private String releaseBy;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class NoticeStatusVO {
|
||||
private String title;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private String noticeTypeLabel;
|
||||
private String noticeType;
|
||||
|
||||
@Schema(description = "发布人")
|
||||
private String releaseBy;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user