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.common.result.Result;
|
||||||
import com.youlai.boot.system.model.form.NoticeForm;
|
import com.youlai.boot.system.model.form.NoticeForm;
|
||||||
import com.youlai.boot.system.model.query.NoticeQuery;
|
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.NoticeVO;
|
||||||
import com.youlai.boot.system.service.NoticeService;
|
import com.youlai.boot.system.service.NoticeService;
|
||||||
import com.youlai.boot.system.service.NoticeStatusService;
|
import com.youlai.boot.system.service.NoticeStatusService;
|
||||||
@@ -123,8 +124,8 @@ public class NoticeController {
|
|||||||
|
|
||||||
@Operation(summary = "获取我的通知公告")
|
@Operation(summary = "获取我的通知公告")
|
||||||
@GetMapping("/my/page")
|
@GetMapping("/my/page")
|
||||||
public PageResult<NoticeVO> getMyNoticePage(NoticeQuery queryParams) {
|
public PageResult<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams) {
|
||||||
IPage<NoticeVO> result = noticeService.getMyNoticePage(queryParams);
|
IPage<NoticeStatusVO> result = noticeService.getMyNoticePage(queryParams);
|
||||||
return PageResult.success(result);
|
return PageResult.success(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,5 +34,5 @@ public interface NoticeStatusMapper extends BaseMapper<NoticeStatus> {
|
|||||||
* @param queryParams 查询参数
|
* @param queryParams 查询参数
|
||||||
* @return 通知公告分页列表
|
* @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;
|
private String content;
|
||||||
|
|
||||||
@Schema(description = "通知类型")
|
@Schema(description = "通知类型")
|
||||||
private String noticeTypeLabel;
|
private String noticeType;
|
||||||
|
|
||||||
@Schema(description = "发布人")
|
@Schema(description = "发布人")
|
||||||
private String releaseBy;
|
private String releaseBy;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class NoticeStatusVO {
|
|||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Schema(description = "通知类型")
|
@Schema(description = "通知类型")
|
||||||
private String noticeTypeLabel;
|
private String noticeType;
|
||||||
|
|
||||||
@Schema(description = "发布人")
|
@Schema(description = "发布人")
|
||||||
private String releaseBy;
|
private String releaseBy;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class NoticeVO implements Serializable {
|
|||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Schema(description = "通知类型")
|
@Schema(description = "通知类型")
|
||||||
private String noticeTypeLabel;
|
private String noticeType;
|
||||||
|
|
||||||
@Schema(description = "发布人")
|
@Schema(description = "发布人")
|
||||||
private String releaseBy;
|
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.entity.Notice;
|
||||||
import com.youlai.boot.system.model.form.NoticeForm;
|
import com.youlai.boot.system.model.form.NoticeForm;
|
||||||
import com.youlai.boot.system.model.query.NoticeQuery;
|
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.NoticeVO;
|
||||||
import com.youlai.boot.system.model.vo.NoticeDetailVO;
|
import com.youlai.boot.system.model.vo.NoticeDetailVO;
|
||||||
|
|
||||||
@@ -92,5 +93,5 @@ public interface NoticeService extends IService<Notice> {
|
|||||||
* @param queryParams 查询参数
|
* @param queryParams 查询参数
|
||||||
* @return 通知公告分页列表
|
* @return 通知公告分页列表
|
||||||
*/
|
*/
|
||||||
IPage<NoticeVO> getMyNoticePage(NoticeQuery queryParams);
|
IPage<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public interface NoticeStatusService extends IService<NoticeStatus> {
|
|||||||
* 分页获取我的通知公告
|
* 分页获取我的通知公告
|
||||||
* @param page 分页对象
|
* @param page 分页对象
|
||||||
* @param queryParams 查询参数
|
* @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 通知公告分页列表
|
* @return 通知公告分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<NoticeVO> getMyNoticePage(NoticeQuery queryParams) {
|
public IPage<NoticeStatusVO> getMyNoticePage(NoticeQuery queryParams) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
queryParams.setUserId(userId);
|
queryParams.setUserId(userId);
|
||||||
return noticeStatusService.getMyNoticePage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),queryParams);
|
return noticeStatusService.getMyNoticePage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),queryParams);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class NoticeStatusServiceImpl extends ServiceImpl<NoticeStatusMapper, Not
|
|||||||
* @return 通知公告分页列表
|
* @return 通知公告分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@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);
|
return this.getBaseMapper().getMyNoticePage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),queryParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,11 @@
|
|||||||
sn.release_time DESC
|
sn.release_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMyNoticePage" resultType="com.youlai.boot.system.model.vo.NoticeVO">
|
<select id="getMyNoticePage" resultType="com.youlai.boot.system.model.vo.NoticeStatusVO">
|
||||||
SELECT
|
SELECT
|
||||||
sn.id,
|
sn.id,
|
||||||
sn.title,
|
sn.title,
|
||||||
|
sn.notice_type,
|
||||||
sn.release_by,
|
sn.release_by,
|
||||||
sn.priority,
|
sn.priority,
|
||||||
sn.release_time,
|
sn.release_time,
|
||||||
|
|||||||
Reference in New Issue
Block a user