Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1692a0

Browse files
committed
updated golang mongodb setup
1 parentf235935 commitc1692a0

File tree

13 files changed

+0
-546
lines changed

13 files changed

+0
-546
lines changed

‎controllers/auth.controller.go

Lines changed: 0 additions & 126 deletions
This file was deleted.

‎controllers/user.controller.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎main.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import (
99
"github.com/gin-gonic/gin"
1010
"github.com/go-redis/redis/v8"
1111
"github.com/wpcodevo/golang-mongodb/config"
12-
"github.com/wpcodevo/golang-mongodb/controllers"
13-
"github.com/wpcodevo/golang-mongodb/routes"
14-
"github.com/wpcodevo/golang-mongodb/services"
1512
"go.mongodb.org/mongo-driver/mongo"
1613
"go.mongodb.org/mongo-driver/mongo/options"
1714
"go.mongodb.org/mongo-driver/mongo/readpref"
@@ -22,15 +19,6 @@ var (
2219
ctx context.Context
2320
mongoclient*mongo.Client
2421
redisclient*redis.Client
25-
26-
userService services.UserService
27-
UserController controllers.UserController
28-
UserRouteController routes.UserRouteController
29-
30-
authCollection*mongo.Collection
31-
authService services.AuthService
32-
AuthController controllers.AuthController
33-
AuthRouteController routes.AuthRouteController
3422
)
3523

3624
funcinit() {
@@ -71,16 +59,6 @@ func init() {
7159

7260
fmt.Println("Redis client connected successfully...")
7361

74-
// Collections
75-
authCollection=mongoclient.Database("golang_mongodb").Collection("users")
76-
userService=services.NewUserServiceImpl(authCollection,ctx)
77-
authService=services.NewAuthService(authCollection,ctx)
78-
AuthController=controllers.NewAuthController(authService,userService)
79-
AuthRouteController=routes.NewAuthRouteController(AuthController)
80-
81-
UserController=controllers.NewUserController(userService)
82-
UserRouteController=routes.NewRouteUserController(UserController)
83-
8462
server=gin.Default()
8563
}
8664

@@ -106,7 +84,5 @@ func main() {
10684
ctx.JSON(http.StatusOK, gin.H{"status":"success","message":value})
10785
})
10886

109-
AuthRouteController.AuthRoute(router)
110-
UserRouteController.UserRoute(router,userService)
11187
log.Fatal(server.Run(":"+config.Port))
11288
}

‎middleware/deserialize-user.go

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎models/user.model.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

‎routes/auth.routes.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎routes/user.routes.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎services/auth.service.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp