26 lines
752 B
Go
26 lines
752 B
Go
package phone
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"schisandra-album-cloud-microservices/app/auth/api/internal/logic/phone"
|
|
"schisandra-album-cloud-microservices/app/auth/api/internal/svc"
|
|
"schisandra-album-cloud-microservices/app/auth/api/internal/types"
|
|
"schisandra-album-cloud-microservices/common/xhttp"
|
|
)
|
|
|
|
func UploadImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
var req types.UploadRequest
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
|
return
|
|
}
|
|
|
|
l := phone.NewUploadImageLogic(r.Context(), svcCtx)
|
|
err := l.UploadImage(r, &req)
|
|
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
|
}
|
|
}
|