package controllers

import (
	"sparrow/services/knowoapi/model"

	"github.com/kataras/iris"
)

// parseBody 转化请求body
func parseBody(ctx iris.Context, body model.BodyTemplate) error {
	err := ctx.ReadJSON(body)
	if err != nil {
		return err
	}
	return body.Validate()
}
