Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: healthz && swagger update #15

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -46,6 +45,19 @@ const docTemplate = `{
}
}
},
"/api/healthz": {
"get": {
"description": "Get Healthz",
"tags": [
"Healthz"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/get-support-entrypoint": {
"get": {
"security": [
Expand Down Expand Up @@ -143,6 +155,8 @@ var SwaggerInfo = &swag.Spec{
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
13 changes: 13 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@
}
}
},
"/api/healthz": {
"get": {
"description": "Get Healthz",
"tags": [
"Healthz"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/get-support-entrypoint": {
"get": {
"security": [
Expand Down
8 changes: 8 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ paths:
description: OK
tags:
- Auth
/api/healthz:
get:
description: Get Healthz
responses:
"200":
description: OK
tags:
- Healthz
/api/v1/get-support-entrypoint:
get:
consumes:
Expand Down
6 changes: 1 addition & 5 deletions rpc_server/api/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import (
// Healthz
// @Tags Healthz
// @Description Get Healthz
// @Accept json
// @Product json
// @Param
// @Router /api/health [post,get,put,delete]
// @Router /api/healthz [get]
// @Success 200
func Healthz(c *gin.Context) {
response := models.GetResponse()
Expand All @@ -23,5 +20,4 @@ func Healthz(c *gin.Context) {
"time": time.Now(),
"version": "v1.0.0",
})
response.Success(c)
}
7 changes: 6 additions & 1 deletion rpc_server/routers/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ func buildRouters(router *gin.Engine, routerMaps []RouterMap) {
router.POST(routerMap.Url, routerMap.Func)
} else if method == DELETE {
router.DELETE(routerMap.Url, routerMap.Func)
} // ignore rest methods
} else if method == OPTIONS {
router.OPTIONS(routerMap.Url, routerMap.Func)
} else if method == HEAD {
router.HEAD(routerMap.Url, routerMap.Func)
}
// ignore rest methods
}

}
Expand Down
Loading