feat: UDM用户数据添加创建时间字段

This commit is contained in:
TsMask
2025-09-25 15:37:13 +08:00
parent cb7e7f574b
commit 17048e7248
24 changed files with 261 additions and 46 deletions

View File

@@ -4,8 +4,10 @@ import (
"fmt"
"strconv"
"strings"
"time"
"be.ems/src/framework/database/redis"
"be.ems/src/framework/utils/date"
"be.ems/src/modules/network_data/model"
"be.ems/src/modules/network_data/repository"
neService "be.ems/src/modules/network_element/service"
@@ -63,13 +65,21 @@ func (r *UDMAuthUser) dataByRedis(imsi, neId string) []model.UDMAuthUser {
if v, ok := m["amf"]; ok {
amf = strings.Replace(v, "\r\n", "", 1)
}
var createTime int64 = 0
if v, ok := m["create_time"]; ok {
t := date.ParseStrToDate(v, date.YYYY_MM_DDTHH_MM_SSZ)
createTime = t.UnixMilli()
} else {
createTime = time.Now().UnixMilli()
}
a := model.UDMAuthUser{
IMSI: imsi,
Amf: amf,
Ki: m["ki"],
AlgoIndex: m["algo"],
Opc: m["opc"],
NeId: neId,
CreateTime: createTime,
NeId: neId,
IMSI: imsi,
Amf: amf,
Ki: m["ki"],
AlgoIndex: m["algo"],
Opc: m["opc"],
}
arr = append(arr, a)
}