diff --git a/adaptor/PCM-CORE/api/internal/handler/image/checkhandler.go b/adaptor/PCM-CORE/api/internal/handler/image/checkhandler.go new file mode 100644 index 00000000..663475f2 --- /dev/null +++ b/adaptor/PCM-CORE/api/internal/handler/image/checkhandler.go @@ -0,0 +1,28 @@ +package image + +import ( + "net/http" + + "PCM/adaptor/PCM-CORE/api/internal/logic/image" + "PCM/adaptor/PCM-CORE/api/internal/svc" + "PCM/adaptor/PCM-CORE/api/internal/types" + "github.com/zeromicro/go-zero/rest/httpx" +) + +func CheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CheckReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := image.NewCheckLogic(r.Context(), svcCtx) + resp, err := l.Check(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +}