This commit is contained in:
2025-10-24 21:44:15 +08:00
parent 2f56813874
commit 289812aac3
18 changed files with 576 additions and 100 deletions

View File

@@ -0,0 +1,29 @@
package handler
import (
"net/http"
"git.cialloo.com/CiallooWeb/Blog/app/internal/logic"
"git.cialloo.com/CiallooWeb/Blog/app/internal/svc"
"git.cialloo.com/CiallooWeb/Blog/app/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
// Get presigned URL for file download
func DownloadPresignedURLHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.DownloadPresignedURLReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewDownloadPresignedURLLogic(r.Context(), svcCtx)
resp, err := l.DownloadPresignedURL(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}