func (c *ContextImpl) DB() *gorm.DB {
	return c.db
}
DB get db instance
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
}