Skip to content

Commit 56c2269

Browse files
author
QM303176530
committed
取消 OkWithXlsx方法 后期会新增示例接口 此处不通用
1 parent c6d6180 commit 56c2269

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

server/global/response/response.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ func OkDetailed(data interface{}, message string, c *gin.Context) {
4343
Result(SUCCESS, data, message, c)
4444
}
4545

46-
func OkWithXlsx(list []interface{}, title []string, fileName string, c *gin.Context) {
47-
file := excelize.NewFile()
48-
file.SetSheetRow("Sheet1", "A1", &title)
49-
for i, v := range list {
50-
// 第一行被title占用
51-
lint := strconv.Itoa(i + 2)
52-
file.SetSheetRow("Sheet1", "A"+lint, v)
53-
}
54-
c.Header("Content-Type", "application/octet-stream")
55-
c.Header("Content-Disposition", "attachment; filename="+fileName)
56-
c.Header("Content-Transfer-Encoding", "binary")
57-
_ = file.Write(c.Writer)
58-
}
59-
6046
func Fail(c *gin.Context) {
6147
Result(ERROR, map[string]interface{}{}, "操作失败", c)
6248
}

0 commit comments

Comments
 (0)