添加日志输出

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/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" {

View File

@ -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
}