|
|
|
@ -2,17 +2,29 @@ package com.ruoyi.basic.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
|
|
|
|
import com.baomidou.dynamic.datasource.creator.DataSourceCreator;
|
|
|
|
|
import com.baomidou.dynamic.datasource.creator.DruidDataSourceCreator;
|
|
|
|
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
|
|
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.ruoyi.basic.domain.HwTemplate;
|
|
|
|
|
import com.ruoyi.basic.domain.LayoutConfig;
|
|
|
|
|
import com.ruoyi.basic.domain.LayoutDesc;
|
|
|
|
|
import com.ruoyi.basic.service.HwTemplateService;
|
|
|
|
|
import com.ruoyi.basic.service.LayoutConfigService;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.basic.service.LayoutDescService;
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
@ -30,6 +42,10 @@ public class LayoutConfigController {
|
|
|
|
|
*/
|
|
|
|
|
@Resource
|
|
|
|
|
private LayoutConfigService layoutConfigService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private LayoutDescService layoutDescService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private HwTemplateService hwTemplateService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询
|
|
|
|
@ -89,10 +105,10 @@ public class LayoutConfigController {
|
|
|
|
|
// 添加组件新配置
|
|
|
|
|
@PostMapping("/insertLayoutConfig")
|
|
|
|
|
public AjaxResult insertLayoutConfig(@RequestBody Map<String,Object> config) throws JsonProcessingException {
|
|
|
|
|
System.out.println(config.get("items"));
|
|
|
|
|
List<Object> items = (List<Object>)config.get("items");
|
|
|
|
|
String option = config.get("option").toString();
|
|
|
|
|
return layoutConfigService.insertSceneConfig(items,option);
|
|
|
|
|
String layoutName = config.get("layoutDesc").toString();
|
|
|
|
|
return layoutConfigService.insertSceneConfig(items,option,layoutName);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 查询所有场景
|
|
|
|
@ -106,5 +122,4 @@ public class LayoutConfigController {
|
|
|
|
|
public AjaxResult selectConfigById(String sceneId){
|
|
|
|
|
return layoutConfigService.selectConfigById(sceneId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|