Migrate easysite from api_es to api_yal
- Remove api_es service, Dockerfile, all Go source files - Remove api_es from docker-compose.yml, nginx-ssl.conf, .env, Makefile - Replace nginx /api/ proxy with /api/v1/ → api_yal:8787 - Add amenity/upload domains, AuthResponse, GET /auth/me, GET /objects/my to api_yal - Rewrite easysite frontend: types, composables, and all 5 pages to use api_yal DTOs - Wire nuxt.config public.apiBase, add useObjects CRUD composable - Update docs references from api_es to api_yal
This commit is contained in:
@@ -3,12 +3,14 @@ package router
|
||||
import (
|
||||
"api_yal/internal/config"
|
||||
"api_yal/internal/domain/account"
|
||||
"api_yal/internal/domain/amenity"
|
||||
"api_yal/internal/domain/appeal"
|
||||
"api_yal/internal/domain/auth"
|
||||
"api_yal/internal/domain/comment"
|
||||
"api_yal/internal/domain/feetback"
|
||||
"api_yal/internal/domain/object"
|
||||
"api_yal/internal/domain/rating"
|
||||
"api_yal/internal/domain/upload"
|
||||
"api_yal/internal/logger"
|
||||
"time"
|
||||
|
||||
@@ -74,6 +76,12 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
||||
// Регистрируем маршруты обращений
|
||||
appeal.RegisterRoutes(r, db, config.JWTSecret)
|
||||
|
||||
// Регистрируем маршруты для удобств
|
||||
amenity.RegisterRoutes(r, db, config.JWTSecret)
|
||||
|
||||
// Регистрируем маршруты для загрузки файлов
|
||||
upload.RegisterRoutes(r, db, config.JWTSecret, config.UploadPath)
|
||||
|
||||
})
|
||||
|
||||
zapLogger.Info("Настройка маршрутов завершена")
|
||||
@@ -106,9 +114,6 @@ func addProductionMiddleware(r *chi.Mux, config *config.Config) {
|
||||
MaxAge: 300,
|
||||
}))
|
||||
|
||||
// Content-Type проверка
|
||||
r.Use(ChiMiddleware.AllowContentType("application/json", "application/xml"))
|
||||
|
||||
// Rate limiting
|
||||
if config.RateLimit.Enabled {
|
||||
r.Use(ChiMiddleware.Throttle(config.RateLimit.RequestsPerSecond))
|
||||
|
||||
Reference in New Issue
Block a user