Files
schisandra-album-cloud-micr…/app/auth/api/internal/handler/file/upload_file_handler.go

22 lines
584 B
Go

package file
import (
"net/http"
"schisandra-album-cloud-microservices/app/auth/api/internal/logic/storage"
"schisandra-album-cloud-microservices/common/xhttp"
"schisandra-album-cloud-microservices/app/auth/api/internal/svc"
)
func UploadFileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := storage.NewUploadFileLogic(r.Context(), svcCtx)
resp, err := l.UploadFile(r)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}