29 lines
462 B
Go
29 lines
462 B
Go
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",
|
|
},
|
|
})
|
|
}
|