muyu-apiserver/gateway/internal/handler/production/share/getsharelinkplanviewhandler.go

25 lines
664 B
Go
Raw Permalink Normal View History

package share
import (
"context"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"github.com/zeromicro/go-zero/rest/pathvar"
"muyu-apiserver/gateway/internal/logic/production/share"
"muyu-apiserver/gateway/internal/svc"
)
func GetShareLinkPlanViewHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["shortCode"])
l := share.NewGetShareLinkPlanViewLogic(ctx, svcCtx)
resp, err := l.GetShareLinkPlanView()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}