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

客户催单

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);
    }
相关推荐
黄贵根2 小时前
JavaScript实现教培行业意向登记系统
开发语言·javascript·ecmascript
zzzll11114 小时前
Claude Code离线安装方案揭秘
开发语言·php
mifengxing5 小时前
LeetCode 41.缺失的第一个正数|Hard题O(n)+O(1)最优解法深度解析
java·算法·leetcode·排序算法
wling03015 小时前
vasp虚频计算-python脚本
开发语言·windows·python·vasp计算
一米阳光86615 小时前
软考(中级)软件设计师核心笔记(6)系统开发基础——需求分析、系统设计
笔记·职场发展·需求分析·软考·软件设计师·中级职称
郝学胜-神的一滴5 小时前
Qt 高级编程 040:按钮悬浮弹出滑块弹窗的完整攻略
开发语言·c++·qt·软件工程·用户界面
xrandzj6 小时前
Python面向对象编程入门:类、实例、初始化与封装实践
开发语言·python
DLYSB_7 小时前
API 网关流量洪峰与突发 CC 攻击:我用 Go 写了个“现场物理防御哨兵”,把故障响应压缩到秒级
开发语言·后端·golang·报警灯
markinmarkin7 小时前
Spring 中Bean 的作用域有哪些?
java·后端·spring
山荷枝8 小时前
Java学习第十天
java·学习