feat(expiry): 完成 #20 模块目录与健康路由
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package expiry
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// Handler 负责 HTTP 层处理。
|
||||
type Handler struct {
|
||||
service *Service
|
||||
}
|
||||
|
||||
func NewHandler(service *Service) *Handler {
|
||||
return &Handler{service: service}
|
||||
}
|
||||
|
||||
// Healthz 用于 expiry 模块健康检查。
|
||||
func (h *Handler) Healthz(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"message": "success",
|
||||
"data": gin.H{
|
||||
"module": "expiry",
|
||||
"status": "ok",
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user