refactor: adjust project structure

This commit is contained in:
2024-11-14 01:15:55 +08:00
parent c219d81b89
commit 70d7229dd8
20 changed files with 320 additions and 132 deletions

View File

@ -1,7 +1,7 @@
package services
package service
import (
"health-go/routers"
"health-go/router"
"net/http"
"net/http/httptest"
"testing"
@ -10,11 +10,11 @@ import (
)
func TestPingRoute(t *testing.T) {
router := routers.SetupRouter()
r := router.SetupRouter()
w := httptest.NewRecorder()
req, _ := http.NewRequest("GET", "/fetchHosList", nil)
router.ServeHTTP(w, req)
r.ServeHTTP(w, req)
assert.JSONEq(t, `{"code: 20"}`, w.Body.String())
}