2026-01-13 00:08:49 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2026-01-13 23:15:16 +08:00
|
|
|
"fmt"
|
2026-01-13 00:08:49 +08:00
|
|
|
"net/http"
|
|
|
|
|
|
2026-01-13 23:15:16 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
2026-01-13 00:08:49 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2026-01-13 23:15:16 +08:00
|
|
|
//client, close := common.GetDataBaseClient()
|
|
|
|
|
//defer close()
|
|
|
|
|
app := gin.Default()
|
|
|
|
|
app.GET("/test", func(ctx *gin.Context) {
|
|
|
|
|
fmt.Println(ctx.Request.URL.Path)
|
|
|
|
|
ctx.JSON(http.StatusOK, gin.H{
|
|
|
|
|
"message": "success",
|
|
|
|
|
})
|
2026-01-13 00:08:49 +08:00
|
|
|
})
|
2026-01-13 23:15:16 +08:00
|
|
|
err := app.Run(":8443")
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("应用启动失败")
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
2026-01-13 00:08:49 +08:00
|
|
|
}
|