diff --git a/features/udm_user/api_udm_user.go b/features/udm_user/api_udm_user.go index 6de4f76f..77f0dc19 100644 --- a/features/udm_user/api_udm_user.go +++ b/features/udm_user/api_udm_user.go @@ -874,7 +874,33 @@ func (s *UdmUserApi) UdmSubUserEdit(w http.ResponseWriter, r *http.Request) { if body.SmData != "" { msg += fmt.Sprintf(",sm_data=%s", body.SmData) } - msg += fmt.Sprintf(",static_ip=%s", body.StaticIp) + if body.EpsDat != "" { + msg += fmt.Sprintf(",eps_dat=%s", body.EpsDat) + } + if body.EpsFlag != "" { + msg += fmt.Sprintf(",eps_flag=%s", body.EpsFlag) + } + if body.EpsOdb != "" { + msg += fmt.Sprintf(",eps_odb=%s", body.EpsOdb) + } + if body.HplmnOdb != "" { + msg += fmt.Sprintf(",hplmn_odb=%s", body.HplmnOdb) + } + if body.Epstpl != "" { + msg += fmt.Sprintf(",epstpl=%s", body.Epstpl) + } + if body.Ard != "" { + msg += fmt.Sprintf(",ard=%s", body.Ard) + } + if body.ContextId != "" { + msg += fmt.Sprintf(",context_id=%s", body.ContextId) + } + if body.ApnContext != "" { + msg += fmt.Sprintf(",apn_context=%s", body.ApnContext) + } + if body.StaticIp != "" { + msg += fmt.Sprintf(",static_ip=%s", body.StaticIp) + } // 发送MML data, err := mmlclient.MMLSendMsgToString(neInfo.Ip, msg) diff --git a/features/udm_user/repo/repo_udm_sub_user.go b/features/udm_user/repo/repo_udm_sub_user.go index 1af3902d..2aac933d 100644 --- a/features/udm_user/repo/repo_udm_sub_user.go +++ b/features/udm_user/repo/repo_udm_sub_user.go @@ -322,7 +322,30 @@ func (r *RepoUdmSubUser) Update(neID string, authUser model.UdmSubUser) int64 { if authUser.EpsDat != "" && authUser.EpsDat != user.EpsDat { user.EpsDat = authUser.EpsDat } - user.StaticIp = authUser.StaticIp + if authUser.EpsFlag != "" && authUser.EpsFlag != user.EpsFlag { + user.EpsFlag = authUser.EpsFlag + } + if authUser.EpsOdb != "" && authUser.EpsDat != user.EpsDat { + user.EpsOdb = authUser.EpsOdb + } + if authUser.HplmnOdb != "" && authUser.HplmnOdb != user.HplmnOdb { + user.HplmnOdb = authUser.HplmnOdb + } + if authUser.Epstpl != "" && authUser.Epstpl != user.Epstpl { + user.Epstpl = authUser.Epstpl + } + if authUser.Ard != "" && authUser.Ard != user.Ard { + user.Ard = authUser.Ard + } + if authUser.ContextId != "" && authUser.ContextId != user.ContextId { + user.ContextId = authUser.ContextId + } + if authUser.ApnContext != "" && authUser.ApnContext != user.ApnContext { + user.ApnContext = authUser.ApnContext + } + if authUser.StaticIp != "" && authUser.StaticIp != user.StaticIp { + user.StaticIp = authUser.StaticIp + } results, err := datasource.DefaultDB().Table("u_sub_user").Where("imsi = ? and ne_id = ?", user.Imsi, user.NeID).Update(user) if err != nil {