package com.zg.project.websocket;


import com.zg.framework.websocket.config.WebSocketServer;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class WebSocketSendController {

    @GetMapping("/send/{deviceId}")
    public String sendToDevice(@PathVariable String deviceId, @RequestParam String message) {
        WebSocketServer.sendMessageToDevice(deviceId, message);
        return "消息已发送给 deviceId: " + deviceId;
    }
}
