This commit is contained in:
toom1996
2026-09-02 21:51:35 +08:00
parent 2562fc4aaa
commit 1fd9c48f58
22 changed files with 908 additions and 30 deletions

View File

@ -75,6 +75,8 @@ func main() {
userRepo = repository.NewUserRepository(db)
snapRepo = repository.NewStreetSnapRepository(db)
refreshRepo = repository.NewRefreshTokenRepository(db)
favRepo = repository.NewFavoriteRepository(db)
histRepo = repository.NewHistoryRepository(db)
jwtManager = jwt.NewManager(cfg.JWT.Secret, cfg.JWT.ExpireHours)
@ -83,6 +85,8 @@ func main() {
indexSvc = service.NewIndexService(brandRepo)
snapSvc = service.NewStreetSnapService(snapRepo)
authSvc = service.NewAuthService(userRepo, refreshRepo, jwtManager, cfg.JWT.ExpireHours, cfg.JWT.RefreshExpireHours)
favSvc = service.NewFavoriteService(favRepo)
histSvc = service.NewHistoryService(histRepo)
)
engine := router.New(router.Options{
@ -92,6 +96,8 @@ func main() {
Brand: handler.NewBrandHandler(brandSvc),
StreetSnap: handler.NewStreetSnapHandler(snapSvc),
Auth: handler.NewAuthHandler(authSvc),
Favorite: handler.NewFavoriteHandler(favSvc),
History: handler.NewHistoryHandler(histSvc),
Health: handler.NewHealthHandler(),
})