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

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

No files matched your search

@@ -525,7 +525,7 @@ func (s *UDMAuthController) Export(c *gin.Context) {
data = append(data, []string{v.IMSI, v.Ki, v.AlgoIndex, v.Amf, opc})
}
// 输出到文件
if err := file.WriterFileTXT(data, ",", filePath); err != nil {
if err := file.WriterFileTXTLine(data, ",", filePath); err != nil {
c.JSON(200, resp.ErrMsg(err.Error()))
return
}
@@ -635,7 +635,7 @@ func (s *UDMAuthController) Import(c *gin.Context) {
go s.udmAuthService.InsertData(neInfo.NeId, "csv", data)
}
if strings.HasSuffix(body.UploadPath, ".txt") {
data := file.ReadFileTXT(",", localFilePath)
data := file.ReadFileTXTLine(",", localFilePath)
go s.udmAuthService.InsertData(neInfo.NeId, "txt", data)
}
}