-
Vikram Ingawale authored
Get local service data function added
857aa529
servicebuildermdl.go 19.40 KiB
//@author Ajit Jagtap
//@version Mon Jul 09 2018 14:00:05 GMT+0530 (IST)
// Package servicebuildermdl will help you run BL and fetch data.
package servicebuildermdl
import (
"database/sql"
"strings"
"sync"
"time"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/corepkgv2/utiliymdl/guidmdl"
"github.com/tidwall/sjson"
linq "gopkg.in/ahmetb/go-linq.v3"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/corepkgv2/constantmdl"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/corepkgv2/validationmdl"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/corepkgv2/errormdl"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/corepkgv2/loggermdl"
"github.com/zhouzhuojie/conditions"
"github.com/tidwall/gjson"
)
// GlobalConfigModel - GlobalConfigModel
type GlobalConfigModel struct {
Key string `json:"key"`
Value string `json:"value"`
Restrictions []string `json:"restrictions"`
}
var globalConfig map[string]GlobalConfigModel
var globalConfigMutex sync.Mutex
var once sync.Once
var ruleCache map[string]conditions.Expr
var mutex = &sync.Mutex{}
func init() {
ruleCache = make(map[string]conditions.Expr)
globalConfig = make(map[string]GlobalConfigModel)
globalConfigMutex = sync.Mutex{}
}
// DebugInfo - DebugInfo
type DebugInfo struct {
StackTrace strings.Builder `json:"stackTrace"`
PerformanceInfo strings.Builder `json:"performanceInfo"`
}
// LoadData is a method sign for loader methods
type LoadData = func(ab *AbstractBusinessLogicHolder) error
// FinalStepProcessOutput is a method sign for loader methods
type FinalStepProcessOutput = func(ab *AbstractBusinessLogicHolder) (*interface{}, error)
// AbstractBusinessLogicHolder use this type to inheritance
type AbstractBusinessLogicHolder struct {
localServiceData map[string]interface{}
pricipalObject Principal
globalConfigData map[string]GlobalConfigModel
GlobalErrorCode int
dynamicFormEvalData map[string]interface{}
ServiceError interface{}
TransactionEnable bool