|
|
@ -24,12 +24,12 @@ func QuerySimpleGP(c *gin.Context) {
|
|
|
|
var input MySwagger.QuerySimpleGP
|
|
|
|
var input MySwagger.QuerySimpleGP
|
|
|
|
|
|
|
|
|
|
|
|
if err := c.ShouldBindJSON(&input); err != nil {
|
|
|
|
if err := c.ShouldBindJSON(&input); err != nil {
|
|
|
|
c.JSON(http.StatusOK, MySwagger.DataResult{Success: false, Message: "简单查询数据JSON格式错误"})
|
|
|
|
c.JSON(http.StatusOK, MySwagger.DataResult{Success: false, Message: "查询数据JSON格式错误"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if input.Query.QueryID == "" {
|
|
|
|
if input.Query.QueryID == "" {
|
|
|
|
c.JSON(http.StatusOK, MySwagger.DataResult{Success: false, Message: "简单查询数据QueryID不能为空"})
|
|
|
|
c.JSON(http.StatusOK, MySwagger.DataResult{Success: false, Message: "查询数据QueryID不能为空"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -51,10 +51,20 @@ func QuerySimpleGP(c *gin.Context) {
|
|
|
|
flag2, _ := DataexService.CheckDatasourceSql(systemID, input.Query.QueryID)
|
|
|
|
flag2, _ := DataexService.CheckDatasourceSql(systemID, input.Query.QueryID)
|
|
|
|
|
|
|
|
|
|
|
|
if flag2 == false {
|
|
|
|
if flag2 == false {
|
|
|
|
//c.JSON(http.StatusOK, MySwagger.DataResult{Success: false,Message: "接入系统ES-SQL查询权限验证失败"})
|
|
|
|
//c.JSON(http.StatusOK, MySwagger.DataResult{Success: false,Message: "接入系统GP-SQL查询权限验证失败"})
|
|
|
|
//return
|
|
|
|
//return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO:输入参数 SQL注入检测
|
|
|
|
|
|
|
|
if len(input.Query.QueryParam) > 0 {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: 缓存数据
|
|
|
|
|
|
|
|
if input.QueryCache == 1 || input.QueryCache == 2 {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
res, msg, data := ESSqlService.QuerySimple(input.Query.QueryID, input.Query.QueryParam, input.QueryGroup, input.QueryCount, input.QueryFormat)
|
|
|
|
res, msg, data := ESSqlService.QuerySimple(input.Query.QueryID, input.Query.QueryParam, input.QueryGroup, input.QueryCount, input.QueryFormat)
|
|
|
|
|
|
|
|
|
|
|
|
if res {
|
|
|
|
if res {
|
|
|
|