Authored by qinchao

sql通过查询的数据源修改为通过db获取

... ... @@ -376,6 +376,7 @@ public class HttpUriContants {
/**
* sql通用操作,查找
*/
public static final String SQLOPERATE_QUERY_DB_SOURCE_LIST = "/sqlOperate/queryDbSourceList";
public static final String SQLOPERATE_QUERY_DBLIST = "/sqlOperate/queryDbList";
public static final String SQLOPERATE_QUERY = "/sqlOperate/query";
... ...
... ... @@ -11,6 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
... ... @@ -34,7 +35,12 @@ public class SqlOperateCtrl {
跳转到sql通用查询界面
*/
@RequestMapping("/toSqlOperate")
public ModelAndView toSqlOperate(){
public ModelAndView toSqlOperate(Model model){
//查询dbsource
BaseResponse dbSourceResponse=httpClient.defaultGet(HttpUriContants.SQLOPERATE_QUERY_DB_SOURCE_LIST,BaseResponse.class);
if(dbSourceResponse!=null&&dbSourceResponse.getCode()==200){
model.addAttribute("dbSourceList",dbSourceResponse.getData());
}
return new ModelAndView("sqloperate/sqloperate");
}
... ...
... ... @@ -81,7 +81,10 @@
<span class="input-group-addon">当前数据源:</span>
<select id="dataSourceInfo" class="form-control">
<option value="">请选择</option>
<option value="10.66.6.7:3306">cms.yoho-mysql.org</option>
<c:forEach items="${dbSourceList }" var="dbSource">
<option value="${dbSource.id}">${dbSource.text}</option>
</c:forEach>
<%--<option value="10.66.6.7:3306">cms.yoho-mysql.org</option>
<option value="10.66.6.8:3306">passport.yoho-mysql.org</option>
<option value="10.66.6.9:3306">orders.yoho-mysql.org</option>
<option value="10.66.6.10:3306">shops.yoho-mysql.org</option>
... ... @@ -101,7 +104,7 @@
<option value="10.66.1.219:3306">yh_live</option>
<option value="10.67.2.144:3307">seo</option>
<option value="10.67.2.40:3306">MARS</option>
<option value="10.67.2.40:3307">咨询</option>
<option value="10.67.2.40:3307">咨询</option>--%>
<%--<option value="localhost:3306">Test</option>--%>
</select>
</div>
... ...