WebsiteController.java 1.19 KB
package com.uccc.admin.controller;

import com.uccc.admin.domain.WebsiteConfig;
import com.uccc.admin.service.WebsiteService;
import com.uccc.pretty.common.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by bert on 2021-10-07 00:44
 */
@RestController
@RequestMapping("/website/")
public class WebsiteController {
    private Logger logger = LoggerFactory.getLogger(WebsiteController.class);
    @Autowired
    private WebsiteService websiteService;

    @RequestMapping(value = "configs",method = RequestMethod.GET)
    public Result configList() throws NullPointerException{
        return websiteService.getConfigList();
    }

    @RequestMapping(value = "config",method = RequestMethod.PUT)
    public Result updateConfigById(@RequestBody WebsiteConfig websiteConfig) throws NullPointerException{
        return websiteService.updateConfig(websiteConfig);
    }

}