2026-04-03 09:15:35 +00:00
|
|
|
package svc
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"cursor-api-proxy/internal/config"
|
2026-04-03 09:49:11 +00:00
|
|
|
domainrepo "cursor-api-proxy/pkg/domain/repository"
|
|
|
|
|
"cursor-api-proxy/pkg/repository"
|
2026-04-03 09:15:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ServiceContext struct {
|
|
|
|
|
Config config.Config
|
2026-04-03 09:49:11 +00:00
|
|
|
|
|
|
|
|
// Domain services
|
|
|
|
|
AccountPool domainrepo.AccountPool
|
2026-04-03 09:15:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
2026-04-03 09:49:11 +00:00
|
|
|
accountPool := repository.NewAccountPool(c.ConfigDirs)
|
|
|
|
|
|
2026-04-03 09:15:35 +00:00
|
|
|
return &ServiceContext{
|
2026-04-03 09:49:11 +00:00
|
|
|
Config: c,
|
|
|
|
|
AccountPool: accountPool,
|
2026-04-03 09:15:35 +00:00
|
|
|
}
|
|
|
|
|
}
|