feat: 文件工具添加文本输出函数,调整逐行
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user