fix
liuxiaolong
2019-11-13 025dad96eaf17f367745cb1d1b876a7a82b89c44
fix
2个文件已修改
25 ■■■■■ 已修改文件
controllers/dbtablesCon.go 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/syssetcont.go 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dbtablesCon.go
@@ -6,7 +6,9 @@
    "fmt"
    "github.com/gin-gonic/gin"
    "github.com/satori/go.uuid"
    "strconv"
    "time"
    "webserver/cache"
    "webserver/extend/code"
    "webserver/extend/config"
    "webserver/extend/esutil"
@@ -65,7 +67,12 @@
// 依据底库id  查询数据
func QueryDbTableInfo(tableId string) map[string]interface{} {
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
    localConf, err2 := cache.GetServerInfo()
    if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
        logger.Debug("localConfig is wrong!!!")
        return nil
    }
    url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
        "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + tableId
    logger.Debug("请求url:%s;", url)
    data := esutil.GetEsDataInfo(url, true)
@@ -178,7 +185,12 @@
func UpdateEndTime(id string) (flag bool) {
    flag = false
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
    localConf, err2 := cache.GetServerInfo()
    if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
        logger.Debug("localConfig is wrong!!!")
        return false
    }
    url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
        "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + id + "/_update?refresh=wait_for"
    prama := "{\"script\":\"ctx._source.remove(\\\"endTime\\\")\"}"
    buf, err := esutil.EsReq("POST", url, []byte(prama))
controllers/syssetcont.go
@@ -6,6 +6,7 @@
    "regexp"
    "webserver/extend/code"
    "webserver/extend/config"
    "webserver/extend/sys"
    "webserver/extend/util"
)
@@ -43,6 +44,14 @@
    UpdateTime string `json:"UpdateTime"`
}
type SysClockConfigVo struct {
    TimeZone  string `json:"timeZone" example:"时区"`
    NTP       bool   `json:"ntp" example:"NTP校时"`
    NTPServer string `json:"ntpServer" example:"NTP服务器地址"`
    Interval  int    `json:"interval" example:"自动校时间隔"`
    NewTime   string `json:"newTime" example:"手动指定时间"`
}
// @Security ApiKeyAuth
// @Summary 基础设置查询
// @Description 基础设置查询