Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

AuthService stub

天舟09b675b10ca1
diff --git a/backend/api/auth.go b/backend/api/auth.go
new file mode 100644
index 0000000000..748bb4ac60
--- /dev/null
+++ b/backend/api/auth.go
@@ -0,0 +1,25 @@
+package api
+
+import (
+ "net/http"
+
+ "github.com/labstack/echo/v4"
+)
+
+var (
+ _ Service = (*AuthService)(nil)
+)
+
+type Login struct {
+ Email string `json:"email"`
+ Password string `json:"password"`
+}
+
+type AuthService struct {
+}
+
+func (s *AuthService) RegisterRoutes(g *echo.Group) {
+ g.POST("/auth/login", func(c echo.Context) error {
+ return c.String(http.StatusOK, "")
+ })
+}
diff --git a/backend/cmd/server/bytebase.go b/backend/cmd/server/bytebase.go
index 1e82fd5635..a79d47eebf 100644
--- a/backend/cmd/server/bytebase.go
+++ b/backend/cmd/server/bytebase.go
@@ -54,6 +54,7 @@ func main() {
type Server struct {
DebugService api.DebugService
+ AuthService api.AuthService
EnvironmentService api.EnvironmentService
e *echo.Echo
@@ -126,7 +127,7 @@ func NewServer() *Server {
},
Format: `{"time":"${time_rfc3339}",` +
`"method":"${method}","uri":"${uri}",` +
- `"status":${status},"error":"${error}"` + "\n",
+ `"status":${status},"error":"${error}"}` + "\n",
}))
e.Use(middleware.Recover())
@@ -147,6 +148,8 @@ func NewServer() *Server {
s.DebugService.RegisterRoutes(g)
+ s.AuthService.RegisterRoutes(g)
+
s.EnvironmentService.RegisterRoutes(g)
return s