| 318 | } |
| 319 | |
| 320 | func (i *imlImportConfigController) importUpstreams(ctx context.Context) error { |
| 321 | data, err := unmarshal[upstream_dto.ExportUpstream]("upstream") |
| 322 | if err != nil { |
| 323 | return err |
| 324 | } |
| 325 | for _, d := range data { |
| 326 | _, err = i.upstreamModule.Save(ctx, d.Service, d.Upstream) |
| 327 | if err != nil { |
| 328 | return fmt.Errorf("update upstream(%s) error: %v", d.Service, err) |
| 329 | } |
| 330 | } |
| 331 | return nil |
| 332 | } |
| 333 | |
| 334 | func (i *imlImportConfigController) importApplicationAuth(ctx context.Context) error { |
| 335 | data, err := unmarshal[application_authorization_dto.ExportAuthorization]("authorization") |