From f39ae5d88e36558bf2b1b4edc2932cb2a95c226b Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Sat, 19 Sep 2020 23:23:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=20OkWithXlsx=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E5=90=8E=E6=9C=9F=E4=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E6=8E=A5=E5=8F=A3=20=E6=AD=A4=E5=A4=84?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/global/response/response.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/server/global/response/response.go b/server/global/response/response.go index e3eef036..0ac1c93e 100644 --- a/server/global/response/response.go +++ b/server/global/response/response.go @@ -43,20 +43,6 @@ func OkDetailed(data interface{}, message string, c *gin.Context) { Result(SUCCESS, data, message, c) } -func OkWithXlsx(list []interface{}, title []string, fileName string, c *gin.Context) { - file := excelize.NewFile() - file.SetSheetRow("Sheet1", "A1", &title) - for i, v := range list { - // 第一行被title占用 - lint := strconv.Itoa(i + 2) - file.SetSheetRow("Sheet1", "A"+lint, v) - } - c.Header("Content-Type", "application/octet-stream") - c.Header("Content-Disposition", "attachment; filename="+fileName) - c.Header("Content-Transfer-Encoding", "binary") - _ = file.Write(c.Writer) -} - func Fail(c *gin.Context) { Result(ERROR, map[string]interface{}{}, "操作失败", c) }