package me.koba1.led.controller;

import me.koba1.led.Main;
import me.koba1.led.model.Settings;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/api/settings")
public class SettingsController {

    @GetMapping
    public Settings get() {
        return Main.getInstance().getSettingsManager().getSettings();
    }

    @PostMapping("/update")
    public Settings update(@RequestBody Settings settings) throws IOException {
        return Main.getInstance().getSettingsManager().update(settings);
    }
}
