浏览代码

支持同时使用数据库SQL配置和文件SQL配置,并确保sql_mgmt_mybatis.xml文件不存在时逻辑正常。

huangbo 6 年之前
父节点
当前提交
ee76b7a7fd

+ 2 - 0
ipu-rest-demo/readme.md

@ -28,3 +28,5 @@ service+dao后续可以移植到dubbo服务中。
28 28
6.1 异常:request part 'file' is not present
29 29
原因:指定了上传文件的处理器CommonsMultipartResolver。
30 30
解决方法:注释掉,不指定文件处理器即可。
31
6.2 请求模拟器报错:[服务请求错误],有数据返回,但格式不正常。
32
解决方法:Controller方法中@ResponseBody

+ 11 - 0
ipu-rest-demo/src/main/java/com/ai/ipu/server/demo/control/db/DbSqlMgmtController.java

@ -12,6 +12,7 @@ import com.ai.ipu.data.impl.JsonMap;
12 12
import com.ai.ipu.database.dao.IpuDaoManager;
13 13
import com.ai.ipu.sql.mgmt.DbSqlMgmtDao;
14 14
import com.ai.ipu.sql.mgmt.FileSqlMgmtDao;
15
import com.ai.ipu.sql.mgmt.SqlManager;
15 16

16 17
@Controller
17 18
@RequestMapping("/db/mgmt")
@ -43,4 +44,14 @@ public class DbSqlMgmtController {
43 44
        result.put("result", dataResult);
44 45
        return result;
45 46
    }
47
    
48
    @ResponseBody
49
    @RequestMapping("/refresh")
50
    public JMap refreshSqlRepository(JMap param) throws Exception {
51
        // TODO Auto-generated method stub
52
        JMap result = new JsonMap();
53
        SqlManager.refreshSqlCache();
54
        result.put("msg", "刷新成功");
55
        return result;
56
    }
46 57
}