苍穹外卖学习笔记(二十七)

客户催单

OrderController

java 复制代码
    /**
     * 催单
     */
    @GetMapping("/reminder/{id}")
    @ApiOperation("催单")
    public Result reminder(@PathVariable("id") Long id) {
        orderService.reminder(id);
        return Result.success();
    }

OrderServer

java 复制代码
    /**
     * 催单
     */
    void reminder(Long id);

OrderServerImpl

java 复制代码
    /**
     * 催单
     */
    @Override
    public void reminder(Long id) {
        Orders ordersDB = orderMapper.selectById(id);

        if (ordersDB == null) {
            throw new OrderBusinessException(MessageConstant.ORDER_NOT_FOUND);
        }
        Map map = new HashMap();
        map.put("type", 2);//2表示催单提醒
        map.put("orderId", ordersDB.getId());
        map.put("content", "订单号: " + ordersDB.getNumber() + " 有催单,请及时处理!");
        String json = JSON.toJSONString(map);
        webSocketServer.sendToAllClient(json);
    }
相关推荐
2601_949809597 小时前
flutter_for_openharmony家庭相册app实战+照片详情实现
android·java·flutter
4311媒体网7 小时前
Libvio.link 页面布局与数据分布
java·php
白日梦想家6817 小时前
JavaScript性能优化实战系列(三篇完整版)
开发语言·javascript·性能优化
请注意这个女生叫小美7 小时前
C语言 实例20 25
c语言·开发语言·算法
fundroid7 小时前
Kotlin 泛型进阶:in、out 与 reified 实战
android·开发语言·kotlin
奋斗的小方7 小时前
01 一文读懂UML类图:核心概念与关系详解
java·uml
枫叶丹47 小时前
【Qt开发】Qt系统(十一)-> Qt 音频
c语言·开发语言·c++·qt·音视频
长安城没有风7 小时前
Java 高并发核心编程 ----- 线程池原理与实践(上)
java·juc
Remember_9937 小时前
Spring 核心原理深度解析:Bean 作用域、生命周期与 Spring Boot 自动配置
java·前端·spring boot·后端·spring·面试
tlwlmy7 小时前
python excel图片批量导出
开发语言·python·excel