func (c *ContextImpl) httpResponseCreated(res interface{}, err error) {
	c.HTTPStatus(http.StatusCreated)
	c.HTTPResponse(res, err)
}
httpResponseCreated handle http http.StatusCreated 201 response
package application
import (
	"fmt"
	"net/http"
	"runtime/debug"
	"github.com/PolarPanda611/trinitygo/httputil"
	"github.com/PolarPanda611/trinitygo/sd"
	"github.com/PolarPanda611/trinitygo/util"
	"github.com/gin-gonic/gin"
	"github.com/jinzhu/gorm"
)
var _ Context = new(ContextImpl)
type Context interface {
	NewHTTPServiceRequest(serviceName string, method httputil.RequestMethod, path string, body []byte) (int, interface{}, error)
	Application() Application
	setRuntime(map[string]string)
	Runtime() map[string]string
	DB() *gorm.DB
	DBTx() *gorm.DB
	AutoFreeOn()
	AutoFreeOff()
	SafeCommit()
	SafeRollback()
	DBTxIsOpen() bool
	setGinCTX(c *gin.Context)
	GinCtx() *gin.Context
	SetDB(*gorm.DB)
	cleanRuntime()
	GetCurrentUser() (interface{}, error)
	HTTPStatus(code int)
	httpResponseUnauthorizedErr(error)
	HTTPResponseInternalErr(error)
	httpResponseErr(error)
	HTTPResponseOk(interface{}, error)
	httpResponseCreated(interface{}, error)
	httpResponseDeleted(interface{}, error)
	HTTPResponse(interface{}, error)
	SetIsConfigured()
	IsConfigured() bool
	AutoFree() bool
}
type ContextImpl struct {
	app      Application
	runtime  map[string]string
	db       *gorm.DB
	dbTxOpen bool
	c               *gin.Context
	funcToGetWhoAmI func(app Application, c *gin.Context, db *gorm.DB) (interface{}, error)
	status          int
	autoFree     bool
	isConfigured bool
}
func (c *ContextImpl) SetIsConfigured() {
	c.isConfigured = true
}
func (c *ContextImpl) IsConfigured() bool {
	return c.isConfigured
}
func (c *ContextImpl) Application() Application {
	return c.app
}
func (c *ContextImpl) AutoFree() bool {
	return c.autoFree
}
func (c *ContextImpl) AutoFreeOn() {
	c.autoFree = true
}
func (c *ContextImpl) AutoFreeOff() {
	c.autoFree = false
}
func (c *ContextImpl) Runtime() map[string]string {
	newRuntime := make(map[string]string, len(c.runtime))
	for k, v := range c.runtime {
		newRuntime[k] = v
	}
	return newRuntime
}
func (c *ContextImpl) setRuntime(runtime map[string]string) {
	c.runtime = runtime
}
func (c *ContextImpl) setGinCTX(ginCtx *gin.Context) {
	c.c = ginCtx
}
func (c *ContextImpl) GinCtx() *gin.Context {
	return c.c
}
func (c *ContextImpl) DB() *gorm.DB {
	return c.db
}
func (c *ContextImpl) DBTx() *gorm.DB {
	if c.dbTxOpen {
		return c.db
	}
	c.db = c.db.Begin()
	c.dbTxOpen = true
	return c.db
}
func (c *ContextImpl) SafeCommit() {
	if c.dbTxOpen {
		c.db.Commit()
		c.dbTxOpen = false
	}
}
func (c *ContextImpl) SafeRollback() {
	if c.dbTxOpen {
		c.db.Rollback()
		c.dbTxOpen = false
	}
}
func (c *ContextImpl) DBTxIsOpen() bool {
	return c.dbTxOpen
}
func (c *ContextImpl) SetDB(db *gorm.DB) {
	c.db = db
}
func (c *ContextImpl) cleanRuntime() {
	c.c = nil
	c.runtime = nil
	c.db = nil
	c.status = 0
	c.dbTxOpen = false
	c.autoFree = true
	c.isConfigured = false
}
func (c *ContextImpl) HTTPStatus(code int) {
	c.status = code
}
func (c *ContextImpl) httpResponseUnauthorizedErr(err error) {
	c.HTTPStatus(http.StatusUnauthorized)
	c.httpResponseErr(err)
}
func (c *ContextImpl) HTTPResponseInternalErr(err error) {
	c.HTTPStatus(http.StatusBadRequest)
	c.httpResponseErr(err)
}
func (c *ContextImpl) httpResponseErr(err error) {
	if c.c == nil {
		panic("gin context not set , please if the func is used in http request handle")
	}
	if c.status == 0 {
		c.status = 400
	}
	err = util.HTTPErrEncoder(err)
	if err != nil {
		if c.app.Conf().GetAtomicRequest() {
			c.SafeRollback()
		}
		_, resErr := util.HTTPErrDecoder(err)
		c.c.Error(fmt.Errorf("%v", err))
		c.c.Error(fmt.Errorf("%v", string(debug.Stack())))
		if c.app.ResponseFactory() != nil {
			c.c.JSON(c.status, c.app.ResponseFactory()(c.status, resErr, c.runtime))
		} else {
			if resErr != nil {
				c.c.AbortWithStatusJSON(c.status, resErr)
			} else {
				c.c.AbortWithStatus(c.status)
			}
		}
		return
	}
}
func (c *ContextImpl) HTTPResponseOk(res interface{}, err error) {
	c.HTTPStatus(http.StatusOK)
	c.HTTPResponse(res, err)
}