package handler import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "app.yhyue.com/moapp/jyInfo/api/internal/logic" "app.yhyue.com/moapp/jyInfo/api/internal/svc" "app.yhyue.com/moapp/jyInfo/api/internal/types" ) func uploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.UploadReq if err := httpx.Parse(r, &req); err != nil { httpx.Error(w, err) return } l := logic.NewUploadLogic(r.Context(), svcCtx, r) resp, err := l.Upload(&req) if err != nil { httpx.Error(w, err) } else { httpx.OkJson(w, resp) } } }