From d4f78124d8dde1ad67601129b0e5f93048aaac5c Mon Sep 17 00:00:00 2001 From: black1552 Date: Thu, 26 Feb 2026 09:08:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(response):=20=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=93=8D=E5=BA=94=E6=94=AF=E6=8C=81=E5=B9=B6=E9=87=8D?= =?UTF-8?q?=E6=9E=84API=E5=93=8D=E5=BA=94=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加ApiFile结构体用于处理文件响应 - 实现SuccessFile函数创建文件响应对象 - 添加SetContentType、SetPng、SetJpeg、SetGif、SetPdf、SetXls等文件类型设置方法 - 实现SetData和End方法用于设置和发送文件数据 - 重命名api结构体为Api以符合命名规范 - 为response结构体添加字段注释 - 更新.idea缓存配置以反映新的结构体定义 - 修改End方法使用正确的Gin上下文方法发送响应 --- .idea/GOHCache.xml | 40 +++++++++-- response/code.go | 174 +++++++++++++++++++++++++++++++++------------ 2 files changed, 163 insertions(+), 51 deletions(-) diff --git a/.idea/GOHCache.xml b/.idea/GOHCache.xml index facb2de..2bdc17b 100644 --- a/.idea/GOHCache.xml +++ b/.idea/GOHCache.xml @@ -3,6 +3,20 @@