package com.sysu.admin.api.cfg;

import com.alibaba.fastjson.JSON;
import com.sysu.admin.support.system.config.SConfigService;
import com.xiesx.fastboot.base.result.BaseResult;
import com.xiesx.fastboot.base.result.R;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/api/cfg")
@RestController
public class CfgController {

    @Autowired
    SConfigService mSConfigService;

    @RequestMapping(value = "/get")
    @ResponseBody
    public BaseResult get(@RequestBody String data){
        String key = JSON.parseObject(data).get("key").toString();
        String sldXmlJson = mSConfigService.getV(key);
        return R.succ("success",sldXmlJson);
    }

}
