Skip to content

Commit

Permalink
fix healty
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed Mar 4, 2024
1 parent e2e69f3 commit 5e8450a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion rpc_server/api/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import (
"time"
)

func Health(c *gin.Context) {
// Healthz
// @Tags Healthz
// @Description Get Healthz
// @Accept json
// @Product json
// @Param
// @Router /api/health [post,get,put,delete]
// @Success 200
func Healthz(c *gin.Context) {
response := models.GetResponse()
response.WithDataSuccess(c, gin.H{
"hello": "Eth Paymaster",
Expand Down
4 changes: 2 additions & 2 deletions rpc_server/routers/routers_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func init() {
PrivateRouterMaps = append(PrivateRouterMaps, RouterMap{string(GetSupportStrategy), []RestfulMethod{GET}, v1.GetSupportStrategy})
PrivateRouterMaps = append(PrivateRouterMaps, RouterMap{string(GetSupportEntrypoint), []RestfulMethod{GET}, v1.GetSupportEntrypoint})
PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Auth), []RestfulMethod{POST}, api.Auth})
PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Health), []RestfulMethod{GET}, api.Health})
PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Healthz), []RestfulMethod{GET, POST, PUT, DELETE}, api.Healthz})
}

type Path string
Expand All @@ -25,5 +25,5 @@ const (
GetSupportStrategy Path = "api/v1/get-support-strategy"
GetSupportEntrypoint Path = "api/v1/get-support-entrypoint"
Auth Path = "api/auth"
Health Path = "api/health"
Healthz Path = "api/healthz"
)

0 comments on commit 5e8450a

Please sign in to comment.