feat: 更新多个模块以支持新的数据结构和日志格式

This commit is contained in:
TsMask
2025-02-20 10:08:27 +08:00
parent 045a2b6b01
commit f3c33b31ac
272 changed files with 13246 additions and 15885 deletions

View File

@@ -25,21 +25,21 @@ type UEEventMME struct {
ueEventRepository *repository.UEEventMME // UE会话事件数据信息
}
// SelectPage 根据条件分页查询
func (r *UEEventMME) SelectPage(querys model.UEEventMMEQuery) ([]model.UEEventMME, int64) {
// FindByPage 根据条件分页查询
func (r *UEEventMME) FindByPage(querys model.UEEventMMEQuery) ([]model.UEEventMME, int64) {
return r.ueEventRepository.SelectByPage(querys)
}
// DeleteByIds 批量删除信息
func (r *UEEventMME) DeleteByIds(ueIds []string) (int64, error) {
func (r *UEEventMME) DeleteByIds(ids []int64) (int64, error) {
// 检查是否存在
ids := r.ueEventRepository.SelectByIds(ueIds)
if len(ids) <= 0 {
rows := r.ueEventRepository.SelectByIds(ids)
if len(rows) <= 0 {
return 0, fmt.Errorf("no data")
}
if len(ids) == len(ueIds) {
rows := r.ueEventRepository.DeleteByIds(ueIds)
if len(rows) == len(ids) {
rows := r.ueEventRepository.DeleteByIds(ids)
return rows, nil
}
// 删除信息失败!
@@ -57,11 +57,11 @@ func (r UEEventMME) ExportXlsx(rows []model.UEEventMME, fileName, language strin
"E1": "Time",
}
// 读取字典数据 UE 事件类型
dictUEEventType := sysService.NewSysDictData.SelectDictDataByType("ue_event_type")
dictUEEventType := sysService.NewSysDictData.FindByType("ue_event_type")
// 读取字典数据 UE 事件认证代码类型
dictUEAauthCode := sysService.NewSysDictData.SelectDictDataByType("ue_auth_code")
dictUEAauthCode := sysService.NewSysDictData.FindByType("ue_auth_code")
// 读取字典数据 UE 事件CM状态
dictUEEventCmState := sysService.NewSysDictData.SelectDictDataByType("ue_event_cm_state")
dictUEEventCmState := sysService.NewSysDictData.FindByType("ue_event_cm_state")
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
for i, row := range rows {
@@ -82,8 +82,8 @@ func (r UEEventMME) ExportXlsx(rows []model.UEEventMME, fileName, language strin
// 取类型
eventType := row.EventType
for _, v := range dictUEEventType {
if row.EventType == v.DictValue {
eventType = i18n.TKey(language, v.DictLabel)
if row.EventType == v.DataValue {
eventType = i18n.TKey(language, v.DataLabel)
break
}
}
@@ -93,16 +93,16 @@ func (r UEEventMME) ExportXlsx(rows []model.UEEventMME, fileName, language strin
eventResult = v.(string)
if row.EventType == "auth-result" {
for _, v := range dictUEAauthCode {
if eventResult == v.DictValue {
eventResult = i18n.TKey(language, v.DictLabel)
if eventResult == v.DataValue {
eventResult = i18n.TKey(language, v.DataLabel)
break
}
}
}
if row.EventType == "cm-state" {
for _, v := range dictUEEventCmState {
if eventResult == v.DictValue {
eventResult = i18n.TKey(language, v.DictLabel)
if eventResult == v.DataValue {
eventResult = i18n.TKey(language, v.DataLabel)
break
}
}