func Data(ctx ol.Context, v interface{}) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		jsonHandler(ctx, FilterData(ctx, w, r, v)).ServeHTTP(w, r)
	})
}
http normal response.
@remark user can use nil v to response success, which data is null.
@remark user can use WriteData() for simple api.
package http
import (
	"encoding/json"
	"fmt"
	ol "github.com/ossrs/go-oryx-lib/logger"
	"net/http"
	"os"
	"strconv"
	"strings"
)
const (
	HttpJson       = "application/json"
	HttpJavaScript = "application/javascript"
)
var Server = "Oryx"
type SystemError int
func (v SystemError) Error() string {
	return fmt.Sprintf("System error=%d", int(v))
}
type SystemComplexError struct {
	Code SystemError `json:"code"`
	Message string `json:"data"`
}
func (v SystemComplexError) Error() string {
	return fmt.Sprintf("%v, %v", v.Code.Error(), v.Message)
}
type AppError interface {
	Code() int
	error
}
type HTTPStatus interface {
	Status() int
}
func Error(ctx ol.Context, err error) http.Handler {
	if v, ok := err.(SystemComplexError); ok {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			jsonHandler(ctx, FilterCplxSystemError(ctx, w, r, v)).ServeHTTP(w, r)
		})
	}
	if v, ok := err.(SystemError); ok {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			jsonHandler(ctx, FilterSystemError(ctx, w, r, v)).ServeHTTP(w, r)
		})
	}
	if v, ok := err.(AppError); ok {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			jsonHandler(ctx, FilterAppError(ctx, w, r, v)).ServeHTTP(w, r)
		})
	}
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		SetHeader(w)
		w.Header().Set("Content-Type", HttpJson)
		status := http.StatusInternalServerError
		if v, ok := err.(HTTPStatus); ok {
			status = v.Status()
		}
		http.Error(w, FilterError(ctx, w, r, err), status)
	})
}
func CplxError(ctx ol.Context, code SystemError, message string) http.Handler {
	return Error(ctx, SystemComplexError{code, message})
}