From 70637f42fce7369167ee7c037c4ca3d5e0513628 Mon Sep 17 00:00:00 2001 From: donald1218 Date: Thu, 24 Oct 2024 06:24:07 +0000 Subject: [PATCH] fix: missing nf res in registernf and type assertion in smf and amfue comment remove --- internal/context/amf_ue.go | 6 +++--- internal/sbi/consumer/nrf_service.go | 1 + internal/sbi/consumer/smf_service.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/context/amf_ue.go b/internal/context/amf_ue.go index bd86dcd..6d584e1 100644 --- a/internal/context/amf_ue.go +++ b/internal/context/amf_ue.go @@ -683,9 +683,9 @@ func (ue *AmfUe) CopyDataFromUeContextModel(ueContext *models.UeContext) { if ue.AccessAndMobilitySubscriptionData == nil { ue.AccessAndMobilitySubscriptionData = new(models.AccessAndMobilitySubscriptionData) } - // if ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr == nil { - // ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr = new(models.AmbrRm) - // } + if ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr == nil { + ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr = new(models.AmbrRm) + } subAmbr := ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr subAmbr.Uplink = ueContext.SubUeAmbr.Uplink diff --git a/internal/sbi/consumer/nrf_service.go b/internal/sbi/consumer/nrf_service.go index cc5130e..bcd35cf 100644 --- a/internal/sbi/consumer/nrf_service.go +++ b/internal/sbi/consumer/nrf_service.go @@ -276,6 +276,7 @@ func (s *nnrfService) SendRegisterNFInstance(ctx context.Context, nrfUri, nfInst } else { // NFRegister resourceUri := res.Location + nf = res.NrfNfManagementNfProfile index := strings.Index(resourceUri, "/nnrf-nfm/") if index >= 0 { resouceNrfUri = resourceUri[:index] diff --git a/internal/sbi/consumer/smf_service.go b/internal/sbi/consumer/smf_service.go index 0763f7c..c020767 100644 --- a/internal/sbi/consumer/smf_service.go +++ b/internal/sbi/consumer/smf_service.go @@ -178,7 +178,7 @@ func (s *nsmfService) SendCreateSmContextRequest(ue *amf_context.AmfUe, smContex err1 = localErr if apiErr, ok := localErr.(openapi.GenericOpenAPIError); ok { // API error - posterr := apiErr.Model().(*Nsmf_PDUSession.PostSmContextsError) + posterr := apiErr.Model().(Nsmf_PDUSession.PostSmContextsError) problemDetail = &posterr.ProblemDetails errorResponse = &posterr.PostSmContextsError }