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

客户催单

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);
    }
相关推荐
悟能不能悟3 分钟前
java HttpServletRequest 设置header
java·开发语言
云栖梦泽8 分钟前
易语言运维自动化:中小微企业的「数字化运维瑞士军刀」
开发语言
悟空码字10 分钟前
SpringBoot整合FFmpeg,打造你的专属视频处理工厂
java·spring boot·后端
刘975311 分钟前
【第23天】23c#今日小结
开发语言·c#
独自归家的兔12 分钟前
Spring Boot 版本怎么选?2/3/4 深度对比 + 迁移避坑指南(含 Java 8→21 适配要点)
java·spring boot·后端
Hcoco_me15 分钟前
大模型面试题37:Scaling Law完全指南
人工智能·深度学习·学习·自然语言处理·transformer
trayvontang21 分钟前
Spring Gateway核心概念、流程及原理
spring·gateway·spring gateway
郝学胜-神的一滴21 分钟前
线程同步:并行世界的秩序守护者
java·linux·开发语言·c++·程序人生
龘龍龙22 分钟前
Python基础学习(十)
服务器·python·学习
superman超哥22 分钟前
Rust 移动语义(Move Semantics)的工作原理:零成本所有权转移的深度解析
开发语言·后端·rust·工作原理·深度解析·rust移动语义·move semantics