# v2.6.0 升级至 v2.7.0

# 组件更改说明

该升级指南以v2.6.0版本为基准,更早的版本请先参考之前版本的升级文档。

将diboot所有的组件版本号替换至2.7.0的最新版本,然后按照下述内容进行相关更改即可。

# diboot-core 内核

  • BaseController 中移除弃用方法 buildLambdaQueryWrapper*,使用 buildQueryWrapper* 代替

# message 消息组件

该版本新增系统消息功能,需在MessageController中添加两个接口用于系统消息,如下:

@Slf4j
@RestController
@RequestMapping("/message")
@BindPermission(name = "消息通知")
public class MessageController extends BaseCrudRestController<Message> {
    @Autowired
    private MessageService messageService;

    /**
     * 获取当前登录用的消息
     *
     * @param unread     是否获取未读消息
     * @param pagination
     * @return
     */
    @GetMapping("/own")
    public JsonResult<?> getCurrentUserMessages(@RequestParam(required = false) boolean unread, Pagination pagination) {
        LambdaQueryWrapper<Message> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(Message::getChannel, Cons.MESSAGE_CHANNEL.SYS_MSG.name());
        queryWrapper.eq(Message::getReceiver, IamSecurityUtils.getUserTypeAndId());
        queryWrapper.ne(unread, Message::getStatus, Cons.MESSAGE_STATUS.READ.name());
        List<MessageListVO> viewObjectList = messageService.getViewObjectList(queryWrapper, pagination, MessageListVO.class);
        return JsonResult.OK(viewObjectList).bindPagination(pagination);
    }

    /**
     * 标记消息已读
     *
     * @param ids 消息ID列表
     * @return
     */
    @PostMapping("/read")
    public JsonResult<?> markRead(@RequestBody List<Long> ids) {
        LambdaUpdateWrapper<Message> updateWrapper = Wrappers.lambdaUpdate();
        updateWrapper.in(Message::getId, ids).set(Message::getStatus, Cons.MESSAGE_STATUS.READ.name());
        return new JsonResult<>(messageService.updateEntity(updateWrapper));
    }
    
    // ...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

# 前端升级说明

  • diboot-antd-admin前端调整

升级前请下载diboot-antd-admin 2.7.0 (opens new window)源码包,以下升级流程将依赖此包。

  • diboot-element-admin前端调整

升级前请下载diboot-element-admin 2.7.0 (opens new window)源码包,以下升级流程将依赖此包。

  • 对比新旧版本的相关页面及代码,替换或合并至本地。