90a96b4125
- 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
24 lines
507 B
Go
24 lines
507 B
Go
package upload
|
|
|
|
import (
|
|
"api_yal/internal/logger"
|
|
"api_yal/internal/middleware"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func RegisterRoutes(r chi.Router, db *gorm.DB, jwtSecret string, uploadPath string) {
|
|
l := logger.Get()
|
|
l.Debug("Регистрация маршрутов для upload")
|
|
|
|
handler := NewHandler(db, uploadPath)
|
|
|
|
r.Group(func(r chi.Router) {
|
|
r.Use(middleware.AuthMiddleware(jwtSecret))
|
|
|
|
r.Post("/upload", handler.Upload)
|
|
r.Delete("/upload", handler.DeleteImage)
|
|
})
|
|
}
|