package controllers
|
|
import (
|
"basic.com/dbapi.git"
|
"webserver/extend/code"
|
"webserver/extend/util"
|
|
"github.com/gin-gonic/gin"
|
)
|
|
// @Summary 标签列表
|
// @Description 返回底库标签
|
// @Accept json
|
// @Produce json
|
// @Tags es
|
// @Success 200 {string} json "{"code":200, msg:"", success:true}"
|
// @Failure 500 {string} json "{"code":500, msg:"", success:false}"
|
// @Router /data/api-v/es/taskList [POST]
|
func (sc *EsSearchController) PostEsTagList(c *gin.Context) {
|
|
var dtApi dbapi.DbTableApi
|
var dbpApi dbapi.DbPersonApi
|
dts, err := dtApi.FindAllDbTablesByCurServer()
|
if err == nil {
|
if dts !=nil {
|
sources := make([]map[string]interface{}, 0)
|
for _, dt := range dts {
|
tokenRes := make(map[string]interface{})
|
tokenRes["key"] = dt.Id
|
tokenRes["title"] = dt.TableName
|
tokenRes["value"] = dt.Id
|
tokenRes["status"] = dt.IsDelete
|
if dt.IsDelete == 1 {
|
personTotal,_ := dbpApi.GetPersonTotal(dt.Id)
|
if personTotal == 0 {
|
continue
|
}
|
}
|
sources = append(sources, tokenRes)
|
}
|
util.ResponseFormat(c, code.Success, sources)
|
return
|
}
|
}
|
util.ResponseFormat(c,code.ComError,"查询底库标签失败")
|
}
|