package com.tuoheng.system.controller;

import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.common.BaseController;
import com.tuoheng.system.service.IConfigWebService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/configweb")
public class ConfigWebController extends BaseController {

    @Autowired
    private IConfigWebService configWebService;

    /**
     * 获取配置列表
     *
     * @return
     */
//    @RequiresPermissions("sys:configweb:index")
    @GetMapping("/index")
    public JsonResult index() {
        return configWebService.getList();
    }

    /**
     * 保存配置信息
     *
     * @param info 表单信息
     * @return
     */
//    @RequiresPermissions("sys:configweb:edit")
    @PutMapping("/edit")
    public JsonResult edit(@RequestBody Map<String, Object> info) {
        return configWebService.edit(info);
    }

}
