perf: 更新UDM签约数据表,同步数据支持MICO和RAT操作修改
This commit is contained in:
@@ -142,7 +142,8 @@ func (s *UDMAuthController) Add(c *gin.Context) {
|
||||
defer telnetClient.Close()
|
||||
|
||||
// 发送MML
|
||||
cmd := fmt.Sprintf("add authdat:imsi=%s,ki=%s,amf=%s,algo=%s,opc=%s", body.IMSI, body.Ki, body.Amf, body.AlgoIndex, body.Opc)
|
||||
cmd := fmt.Sprintf("add authdat:imsi=%s,", body.IMSI)
|
||||
cmd += s.udmAuthService.ParseCommandParams(body)
|
||||
data, err := telnet.ConvertToStr(telnetClient, cmd)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
@@ -191,7 +192,8 @@ func (s *UDMAuthController) Adds(c *gin.Context) {
|
||||
defer telnetClient.Close()
|
||||
|
||||
// 发送MML
|
||||
cmd := fmt.Sprintf("baa authdat:start_imsi=%s,sub_num=%s,ki=%s,amf=%s,algo=%s,opc=%s", body.IMSI, num, body.Ki, body.Amf, body.AlgoIndex, body.Opc)
|
||||
cmd := fmt.Sprintf("baa authdat:start_imsi=%s,sub_num=%s,", body.IMSI, num)
|
||||
cmd += s.udmAuthService.ParseCommandParams(body)
|
||||
data, err := telnet.ConvertToStr(telnetClient, cmd)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
@@ -239,20 +241,8 @@ func (s *UDMAuthController) Edit(c *gin.Context) {
|
||||
defer telnetClient.Close()
|
||||
|
||||
// 发送MML
|
||||
cmd := fmt.Sprintf("mod authdata:imsi=%s", body.IMSI)
|
||||
// 修改的参数名称
|
||||
if body.Ki != "" {
|
||||
cmd += fmt.Sprintf(",ki=%s", body.Ki)
|
||||
}
|
||||
if body.Amf != "" {
|
||||
cmd += fmt.Sprintf(",amf=%s", body.Amf)
|
||||
}
|
||||
if body.AlgoIndex != "" {
|
||||
cmd += fmt.Sprintf(",algo=%s", body.AlgoIndex)
|
||||
}
|
||||
if body.Opc != "" {
|
||||
cmd += fmt.Sprintf(",opc=%s", body.Opc)
|
||||
}
|
||||
cmd := fmt.Sprintf("mod authdata:imsi=%s,", body.IMSI)
|
||||
cmd += s.udmAuthService.ParseCommandParams(body)
|
||||
data, err := telnet.ConvertToStr(telnetClient, cmd)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
|
||||
Reference in New Issue
Block a user