package com.purui.prims.common.rest;

import com.purui.prims.common.config.SystemConfig;
import com.purui.prims.common.service.SystemConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/api/semantic/config"})
public class SystemConfigController {

    @Autowired
    private SystemConfigService sysConfigService;

    @PostMapping
    public Boolean save(@RequestBody SystemConfig systemConfig) {
        sysConfigService.save(systemConfig);
        return true;
    }

    @GetMapping
    public SystemConfig get() {
        return sysConfigService.getSystemConfig();
    }

}
