2026-08-09 10:43:45 +08:00
|
|
|
package impl
|
|
|
|
|
|
|
|
|
|
import (
|
2026-08-09 15:10:19 +08:00
|
|
|
"fmt"
|
2026-08-09 10:43:45 +08:00
|
|
|
|
2026-08-09 15:10:19 +08:00
|
|
|
"bsm/full/module/ec/delivery/internal/config"
|
2026-08-09 10:43:45 +08:00
|
|
|
)
|
|
|
|
|
|
2026-08-09 15:10:19 +08:00
|
|
|
var Configure config.Config
|
|
|
|
|
|
|
|
|
|
func NewService(serviceKey string) error {
|
|
|
|
|
cfg, err := config.Load(serviceKey)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
Configure = cfg
|
|
|
|
|
if err := withModel(); err != nil {
|
|
|
|
|
return fmt.Errorf("initialize model: %w", err)
|
|
|
|
|
}
|
|
|
|
|
return nil
|
2026-08-09 10:43:45 +08:00
|
|
|
}
|