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

客户催单

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);
    }
相关推荐
明洞日记7 小时前
【设计模式手册005】单例模式 - 唯一实例的优雅实现
java·单例模式·设计模式
月夜的风吹雨7 小时前
【C++ STL容器适配器】:解密Stack、Queue与Priority Queue的设计智慧
开发语言·c++·stl·优先级队列··队列·适配器
optimistic_chen7 小时前
【Java EE进阶 --- SpringBoot】AOP原理
spring boot·笔记·后端·java-ee·开源·aop
二川bro7 小时前
第48节:WebAssembly加速与C++物理引擎编译
java·c++·wasm
二川bro7 小时前
第45节:分布式渲染:Web Workers多线程渲染优化
开发语言·javascript·ecmascript
2501_941111937 小时前
基于C++的区块链实现
开发语言·c++·算法
⑩-7 小时前
苍穹外卖Day(8)(9)
java·spring boot·mybatis
czxyvX7 小时前
010-C++之List
开发语言·c++·list
小艳加油7 小时前
生态学研究突破:利用R语言多元算法实现物种气候生态位动态分析与分布预测,涵盖数据清洗、模型评价到论文写作全流程
开发语言·算法·r语言
IUGEI7 小时前
Websocket、HTTP/2、HTTP/3原理解析
java·网络·后端·websocket·网络协议·http·https