package thyyxxk.webserver.controller.settings;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.settings.notification.SendMessageParam;
import thyyxxk.webserver.service.PublicServer;

@Slf4j
@RestController
@RequestMapping("/notification")
public class Notification {
    private final PublicServer publicServer;

    @Autowired
    public Notification(PublicServer publicServer) {
        this.publicServer = publicServer;
    }


    @PostMapping("/sendMessageToAll")
    public ResultVo<String> sendMessage(@RequestBody @Validated SendMessageParam param) {
        return publicServer.sendMessage(param);
    }

}
