A:增加HTTP基础功能的访问和HTTP模板
This commit is contained in:
1 parent
e4de5917cd
commit
f67e27320f
11 files changed
+620
-6
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"rear/internal/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
// HealthCheck 健康检查
|
||||
func HealthCheck(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, model.Response{
|
||||
Code: http.StatusOK,
|
||||
Message: "OK",
|
||||
Data: map[string]interface{}{
|
||||
"timestamp": time.Now().Unix(),
|
||||
"version": "1.0.0",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// BasicResponse 健康检查
|
||||
func BasicResponse(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, model.Response{
|
||||
Code: http.StatusOK,
|
||||
Message: "OK",
|
||||
Data: map[string]interface{}{
|
||||
"timestamp": time.Now().Unix(),
|
||||
"version": "1.0.0",
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user