服务发现基础逻辑

This commit is contained in:
2024-10-12 00:38:18 +08:00
parent d1d7f56ce4
commit e6f5aaa02f
10 changed files with 216 additions and 31 deletions
+3 -2
View File
@@ -53,8 +53,9 @@ func (s *serverService) StatusOffline() error {
func (s *serverService) StartListenServer() error {
router := gin.New()
router.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{"message": "hello"})
router.GET("/user", func(c *gin.Context) {
user := repo.User.GetUserInfo(global.DB)
c.JSON(200, user)
})
srv := &http.Server{