添加日志输出

This commit is contained in:
junleea 2025-03-29 13:58:40 +08:00
parent a4df39afd5
commit f759046b15
2 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"StuAcaWorksAI/proto" "StuAcaWorksAI/proto"
"StuAcaWorksAI/service" "StuAcaWorksAI/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"log"
"net/http" "net/http"
) )
@ -34,6 +35,7 @@ func GetUserFileList(c *gin.Context) {
var req GetUserFileListReq var req GetUserFileListReq
if err := c.ShouldBind(&req); err == nil { if err := c.ShouldBind(&req); err == nil {
if req.Type == "all" { if req.Type == "all" {
log.Println("get user file list by all")
userFiles := service.FindUserFileList(userId, proto.UserFileTypeFile) userFiles := service.FindUserFileList(userId, proto.UserFileTypeFile)
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "msg": "success", "data": userFiles}) c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "msg": "success", "data": userFiles})
} else if req.Type == "search" { } else if req.Type == "search" {

View File

@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid" "github.com/google/uuid"
"io" "io"
"log"
"mime/multipart" "mime/multipart"
"os" "os"
"path" "path"
@ -260,5 +261,6 @@ func FindUserFileList(userID int, uploadType string) []proto.UserFileListResp {
r := proto.UserFileListResp{FileAuth: file, FileStoreName: fileStoreName} r := proto.UserFileListResp{FileAuth: file, FileStoreName: fileStoreName}
res = append(res, r) res = append(res, r)
} }
log.Println("FindUserFileList res:", len(res))
return res return res
} }