You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
924 B
44 lines
924 B
package DatastatisticOpenAPI
|
|
|
|
import (
|
|
"dsDataex/MyModel/DataStatistic/DatastatisticService"
|
|
"dsDataex/MyModel/MySwagger"
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
)
|
|
|
|
// 获取数据源列表 godoc
|
|
// @Summary 获取数据源列表
|
|
// @Description 获取数据源列表
|
|
// @Tags datasource
|
|
// @ID readDatasource
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param input body MySwagger.DatasourceSwag true "数据源"
|
|
// @Success 200 {object} MySwagger.Result
|
|
// @Failure 400 {object} MySwagger.Result
|
|
// @Router /v1/openapi/datastatistic/ReadESDocAmount [post]
|
|
func ReadESDocAmount(c *gin.Context) {
|
|
success, data := DatastatisticService.GetESDocCount()
|
|
if success {
|
|
c.JSON(http.StatusOK, MySwagger.Result{
|
|
Success: true,
|
|
Fail: false,
|
|
Message: "",
|
|
Data: data,
|
|
})
|
|
|
|
return
|
|
} else {
|
|
c.JSON(http.StatusOK, MySwagger.Result{
|
|
Success: false,
|
|
Fail: true,
|
|
Message: "",
|
|
})
|
|
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|