refactor: restructure internal/ into adapters/, infra/, and app layers
- internal/gemini/ → internal/adapters/openai/ (renamed package to openai) - internal/pexels/ → internal/adapters/pexels/ - internal/config/ → internal/infra/config/ - internal/database/ → internal/infra/database/ - internal/locale/ → internal/infra/locale/ - internal/middleware/ → internal/infra/middleware/ - internal/server/ → internal/infra/server/ All import paths and call sites updated accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,22 +5,22 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/food-ai/backend/internal/auth"
|
||||
"github.com/food-ai/backend/internal/config"
|
||||
"github.com/food-ai/backend/internal/infra/config"
|
||||
"github.com/food-ai/backend/internal/diary"
|
||||
"github.com/food-ai/backend/internal/dish"
|
||||
"github.com/food-ai/backend/internal/gemini"
|
||||
"github.com/food-ai/backend/internal/adapters/openai"
|
||||
"github.com/food-ai/backend/internal/home"
|
||||
"github.com/food-ai/backend/internal/ingredient"
|
||||
"github.com/food-ai/backend/internal/menu"
|
||||
"github.com/food-ai/backend/internal/middleware"
|
||||
"github.com/food-ai/backend/internal/pexels"
|
||||
"github.com/food-ai/backend/internal/infra/middleware"
|
||||
"github.com/food-ai/backend/internal/adapters/pexels"
|
||||
"github.com/food-ai/backend/internal/product"
|
||||
"github.com/food-ai/backend/internal/recipe"
|
||||
"github.com/food-ai/backend/internal/recognition"
|
||||
"github.com/food-ai/backend/internal/recommendation"
|
||||
"github.com/food-ai/backend/internal/savedrecipe"
|
||||
"github.com/food-ai/backend/internal/cuisine"
|
||||
"github.com/food-ai/backend/internal/server"
|
||||
"github.com/food-ai/backend/internal/infra/server"
|
||||
"github.com/food-ai/backend/internal/tag"
|
||||
"github.com/food-ai/backend/internal/units"
|
||||
"github.com/food-ai/backend/internal/user"
|
||||
@@ -38,7 +38,7 @@ type tagListHandler http.HandlerFunc
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
type geminiAPIKey string
|
||||
type openaiAPIKey string
|
||||
type pexelsAPIKey string
|
||||
type jwtSecret string
|
||||
type jwtAccessDuration time.Duration
|
||||
@@ -49,8 +49,8 @@ type allowedOrigins []string
|
||||
// Config extractors
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
func newGeminiAPIKey(appConfig *config.Config) geminiAPIKey {
|
||||
return geminiAPIKey(appConfig.OpenAIAPIKey)
|
||||
func newOpenAIAPIKey(appConfig *config.Config) openaiAPIKey {
|
||||
return openaiAPIKey(appConfig.OpenAIAPIKey)
|
||||
}
|
||||
|
||||
func newPexelsAPIKey(appConfig *config.Config) pexelsAPIKey {
|
||||
@@ -83,8 +83,8 @@ func newFirebaseCredentialsFile(appConfig *config.Config) string {
|
||||
// Constructor wrappers for functions that accept primitive newtypes
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
func newGeminiClient(key geminiAPIKey) *gemini.Client {
|
||||
return gemini.NewClient(string(key))
|
||||
func newOpenAIClient(key openaiAPIKey) *openai.Client {
|
||||
return openai.NewClient(string(key))
|
||||
}
|
||||
|
||||
func newPexelsClient(key pexelsAPIKey) *pexels.Client {
|
||||
|
||||
Reference in New Issue
Block a user