admin
2021-03-13 7becc97c5bfdd827b9a999c26746bb8e8bc3e25c
src/main/java/com/yeshi/buwan/controller/admin/api/ConfigController.java
@@ -15,14 +15,14 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.yeshi.buwan.domain.Config;
import com.yeshi.buwan.service.imp.ConfigService;
import com.yeshi.buwan.domain.system.DetailSystemConfig;
import com.yeshi.buwan.service.imp.DetailSystemConfigService;
@Controller
@RequestMapping("admin/new/api/config")
public class ConfigController {
    @Resource
    private ConfigService configService;
    private DetailSystemConfigService configService;
    @Resource
    private EHCacheManager ehCacheManager;
@@ -30,7 +30,7 @@
    @RequestMapping("configList")
    public void configList(PrintWriter out) {
        List<Config> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion());
        List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion());
        JSONObject json = new JSONObject();
        json.put("code", "0");
        JSONArray listJson = new JSONArray(list);
@@ -46,11 +46,11 @@
    @RequestMapping(value = "updateConfig", method = RequestMethod.POST)
    public void updateConfig(String vals, PrintWriter out) {
        List<Config> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion());
        List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion());
        System.out.println("vals----" + vals);
        JSONObject json = new JSONObject(vals);
        for (Config cf : list) {
        for (DetailSystemConfig cf : list) {
            String key = cf.getKey();
            cf.setValue(json.getString(key));
//         configService.updateConfig(cf);