1 Star 1 Fork 0

kade/library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gin.go 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
kade 提交于 2024-06-20 11:13 . v2.0.0 ioc 整体优化
package gin
import (
"gitee.com/go-kade/library/ioc/config/gogin"
"gitee.com/go-kade/library/ioc/config/http"
h_response "gitee.com/go-kade/library/http/response"
ioc_health "gitee.com/go-kade/library/ioc/apps/health"
"github.com/gin-gonic/gin"
)
func (h *HealthChecker) Registry() {
r := gogin.InitRouter(h)
r.GET("/", h.HealthHandleFunc)
h.log.Info().Msgf("Get the Health using http://%s%s", http.Get().Addr(), h.Path)
}
// @Summary 健康检查
// @Description 修改文章标签
// @Tags 文章管理
// @Produce json
// @Param id path int true "ID"
// @Param name query string true "ID"
// @Param state query int false "State"
// @Param modified_by query string true "ModifiedBy"
// @Success 200 {string} json "{"code":200,"data":{},"msg":"ok"}"
// @Router /heathcheck [put]
func (h *HealthChecker) HealthHandleFunc(c *gin.Context) {
req := ioc_health.NewHealthCheckRequest()
resp, err := h.Service.Check(
c.Request.Context(),
req,
)
if err != nil {
h_response.Failed(c.Writer, err)
return
}
h_response.Success(c.Writer, ioc_health.NewHealth(resp))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/go-kade/library.git
git@gitee.com:go-kade/library.git
go-kade
library
library
v1.3.8

搜索帮助