From f759046b15661fed130d0a93cb85bf679aec919c Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 29 Mar 2025 13:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/file.go | 2 ++ service/fileService.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/handler/file.go b/handler/file.go index 7fd663e..7cdba2e 100644 --- a/handler/file.go +++ b/handler/file.go @@ -5,6 +5,7 @@ import ( "StuAcaWorksAI/proto" "StuAcaWorksAI/service" "github.com/gin-gonic/gin" + "log" "net/http" ) @@ -34,6 +35,7 @@ func GetUserFileList(c *gin.Context) { var req GetUserFileListReq if err := c.ShouldBind(&req); err == nil { if req.Type == "all" { + log.Println("get user file list by all") userFiles := service.FindUserFileList(userId, proto.UserFileTypeFile) c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "msg": "success", "data": userFiles}) } else if req.Type == "search" { diff --git a/service/fileService.go b/service/fileService.go index dd27c29..3711079 100644 --- a/service/fileService.go +++ b/service/fileService.go @@ -10,6 +10,7 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" "io" + "log" "mime/multipart" "os" "path" @@ -260,5 +261,6 @@ func FindUserFileList(userID int, uploadType string) []proto.UserFileListResp { r := proto.UserFileListResp{FileAuth: file, FileStoreName: fileStoreName} res = append(res, r) } + log.Println("FindUserFileList res:", len(res)) return res }