feat: 文件工具添加文本输出函数,调整逐行

This commit is contained in:
TsMask
2025-05-20 11:44:09 +08:00
parent f011fb5153
commit 72c688e178
7 changed files with 48 additions and 22 deletions

View File

@@ -525,7 +525,7 @@ func (s *UDMSubController) Export(c *gin.Context) {
data = append(data, []string{v.IMSI, v.MSISDN, v.UeAmbrTpl, v.NssaiTpl, v.AreaForbiddenTpl, v.ServiceAreaRestrictionTpl, v.RatRestrictions, v.CnTypeRestrictions, v.SmfSel, v.SmData, epsDat})
}
// 输出到文件
if err := file.WriterFileTXT(data, ",", filePath); err != nil {
if err := file.WriterFileTXTLine(data, ",", filePath); err != nil {
c.JSON(200, resp.ErrMsg(err.Error()))
return
}
@@ -619,7 +619,7 @@ func (s *UDMSubController) Import(c *gin.Context) {
go s.udmSubService.InsertData(neInfo.NeId, "csv", data)
}
if strings.HasSuffix(body.UploadPath, ".txt") {
data := file.ReadFileTXT(",", localFilePath)
data := file.ReadFileTXTLine(",", localFilePath)
go s.udmSubService.InsertData(neInfo.NeId, "txt", data)
}
}