Skip to content

Commit

Permalink
Merge pull request #15 from AAStarCommunity/chao/chore/swag-update
Browse files Browse the repository at this point in the history
bugfix: healthz && swagger update
  • Loading branch information
fanhousanbu committed Mar 4, 2024
2 parents ebabc9f + 322adbf commit 7fad9f9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
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

0 comments on commit 7fad9f9

Please sign in to comment.