package controllers

import (
	"github.com/kataras/iris/v12"
	"sparrow/services/knowoapi/model"
)

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