basedto

package
v0.0.0-...-639ca19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: MulanPSL-2.0 Imports: 18 Imported by: 282

Documentation

Index

Constants

View Source
const CODE_FAIL = CODE_SERVER_ERR
View Source
const CODE_NOFOUND_RECORD = 501
View Source
const CODE_REQUEST_BAD = 400
View Source
const CODE_SERVER_ERR = 500
View Source
const CODE_SUCCESS = 200

Variables

This section is empty.

Functions

func LoadBaseEntity

func LoadBaseEntity() baseiface.ISingleton

func LoadBeanProxy

func LoadBeanProxy[T baseiface.IbaseProxy]() T

Types

type BaseEntity

type BaseEntity struct {
	Proxy    func() *BaseProxy             `json:"-"`
	Bindings map[string]baseiface.LoadBean `json:"-"`
	RootDir  string                        `json:"-"`
}

func FindBeanBaseEntity

func FindBeanBaseEntity() *BaseEntity

func NewBaseEntity

func NewBaseEntity() *BaseEntity

func (*BaseEntity) AutoInject

func (self *BaseEntity) AutoInject() bool

func (*BaseEntity) Autoload

func (self *BaseEntity) Autoload() bool

func (*BaseEntity) Autowire

func (self *BaseEntity) Autowire()

func (*BaseEntity) Bind

func (self *BaseEntity) Bind()

func (*BaseEntity) BindUp

func (self *BaseEntity) BindUp(key string, load baseiface.LoadBean)

func (*BaseEntity) Clone

func (self *BaseEntity) Clone() interface{}

func (*BaseEntity) ContainsStru

func (self *BaseEntity) ContainsStru(v any) bool

func (*BaseEntity) ContainsType

func (self *BaseEntity) ContainsType(name string) bool

func (*BaseEntity) CopyWithOption

func (self *BaseEntity) CopyWithOption(from any)

func (*BaseEntity) FindBinding

func (self *BaseEntity) FindBinding(key string) baseiface.LoadBean

func (*BaseEntity) FromJsonAny

func (self *BaseEntity) FromJsonAny(body []byte) interface{}

func (*BaseEntity) Id2Str

func (self *BaseEntity) Id2Str(id int64) string

func (*BaseEntity) IfAutowire

func (self *BaseEntity) IfAutowire() bool

func (*BaseEntity) Init

func (self *BaseEntity) Init()

func (*BaseEntity) InitProxy

func (self *BaseEntity) InitProxy(some any)

func (*BaseEntity) Log

func (self *BaseEntity) Log()

func (*BaseEntity) Parse2Map

func (self *BaseEntity) Parse2Map() (map[string]any, error)

func (*BaseEntity) Shutdown

func (self *BaseEntity) Shutdown()

func (*BaseEntity) Single

func (self *BaseEntity) Single() bool

func (*BaseEntity) Str2Int

func (self *BaseEntity) Str2Int(from string) int

func (*BaseEntity) String

func (self *BaseEntity) String() string

func (*BaseEntity) ToJson

func (self *BaseEntity) ToJson() string

func (*BaseEntity) ToJsonBytes

func (self *BaseEntity) ToJsonBytes() []byte

func (*BaseEntity) ToPrettyString

func (self *BaseEntity) ToPrettyString() string

func (*BaseEntity) ToString

func (self *BaseEntity) ToString() string

func (*BaseEntity) ValueFrom

func (self *BaseEntity) ValueFrom(from any)

func (*BaseEntity) ValueOf

func (self *BaseEntity) ValueOf(that any)

type BaseEntityIndex

type BaseEntityIndex struct {
	BaseEntity
}

func (BaseEntityIndex) GetMapping

func (b BaseEntityIndex) GetMapping() string

func (BaseEntityIndex) IndexAlaisName

func (b BaseEntityIndex) IndexAlaisName() string

func (BaseEntityIndex) IndexName

func (b BaseEntityIndex) IndexName() string

func (BaseEntityIndex) Mapping

func (b BaseEntityIndex) Mapping() string

func (BaseEntityIndex) PkeyName

func (b BaseEntityIndex) PkeyName() string

func (BaseEntityIndex) PkeyValue

func (b BaseEntityIndex) PkeyValue() any

func (BaseEntityIndex) TableName

func (b BaseEntityIndex) TableName() string

type BaseEntitySingle

type BaseEntitySingle struct {
	BaseEntity
}

func (*BaseEntitySingle) InitProxy

func (this *BaseEntitySingle) InitProxy(some any)

func (*BaseEntitySingle) Single

func (this *BaseEntitySingle) Single() bool

type BaseProxy

type BaseProxy struct {
	// contains filtered or unexported fields
}

func NewBaseProxy

func NewBaseProxy(some any) *BaseProxy

func (*BaseProxy) AutoInject

func (this *BaseProxy) AutoInject() bool

func (*BaseProxy) Autoload

func (this *BaseProxy) Autoload() bool

func (*BaseProxy) Autowire

func (self *BaseProxy) Autowire()

func (*BaseProxy) Check

func (this *BaseProxy) Check() error

func (*BaseProxy) Clone

func (this *BaseProxy) Clone() any

func (*BaseProxy) ContainsStru

func (self *BaseProxy) ContainsStru(chiildStru any) bool

func (*BaseProxy) ContainsType

func (this *BaseProxy) ContainsType(name string) bool

func (*BaseProxy) CopyWithOption

func (this *BaseProxy) CopyWithOption(from any)

func (*BaseProxy) FromJson

func (this *BaseProxy) FromJson(body []byte) interface{}

func (*BaseProxy) IfAutowire

func (self *BaseProxy) IfAutowire() bool

func (*BaseProxy) IfBaseEntity

func (this *BaseProxy) IfBaseEntity() bool

func (*BaseProxy) Init

func (this *BaseProxy) Init()

func (*BaseProxy) Log

func (this *BaseProxy) Log()

func (*BaseProxy) Parse2Map

func (self *BaseProxy) Parse2Map() (map[string]any, error)

func (*BaseProxy) SetSome

func (this *BaseProxy) SetSome(some any)

func (*BaseProxy) Shutdown

func (this *BaseProxy) Shutdown()

func (*BaseProxy) Single

func (this *BaseProxy) Single() bool

func (*BaseProxy) Some

func (this *BaseProxy) Some() any

func (*BaseProxy) String

func (this *BaseProxy) String() string

func (*BaseProxy) ToJson

func (this *BaseProxy) ToJson() string

func (*BaseProxy) ToJsonBytes

func (this *BaseProxy) ToJsonBytes() []byte

func (*BaseProxy) ToPrettyString

func (this *BaseProxy) ToPrettyString() string

func (*BaseProxy) ToString

func (this *BaseProxy) ToString() string

func (*BaseProxy) ValueFrom

func (this *BaseProxy) ValueFrom(from any)

func (*BaseProxy) ValueOf

func (this *BaseProxy) ValueOf(another interface{})

type IchubError

type IchubError struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func NewIchubError

func NewIchubError(code int, msg string) *IchubError

func NewIchubErrorServer

func NewIchubErrorServer() *IchubError

func (*IchubError) Error

func (this *IchubError) Error() string

type IchubResult

type IchubResult struct {
	BaseEntity

	//返回码
	Code int `json:"code,omitempty"`
	//信息
	Msg string `json:"msg,omitempty"`
	//数据
	Data any `json:"data,omitempty"`
}

func FailResult

func FailResult(msg string) *IchubResult

func NewIchubResult

func NewIchubResult() *IchubResult

func ParseIchubResult

func ParseIchubResult(body []byte) *IchubResult

func ResultCodeMsg

func ResultCodeMsg(code int, msg string) *IchubResult

func ResultError

func ResultError(err error) *IchubResult

func ResultFailMsg

func ResultFailMsg(msg string) *IchubResult

func ResultSuccessData

func ResultSuccessData(data interface{}) *IchubResult

func (*IchubResult) Check

func (self *IchubResult) Check(suite suite.Suite, keyVal string)

func (*IchubResult) CheckCode

func (self *IchubResult) CheckCode(suite suite.Suite, code int)

func (*IchubResult) CheckValueByKey

func (self *IchubResult) CheckValueByKey(key string, expect any) bool

func (*IchubResult) Checks

func (self *IchubResult) Checks(suite suite.Suite, keyVals string)

keyVal : "Pay=12|l=2"

func (*IchubResult) CodeMsg

func (self *IchubResult) CodeMsg(code int, msg string) *IchubResult

func (*IchubResult) DataIfMap

func (self *IchubResult) DataIfMap() map[string]interface{}

func (*IchubResult) DataIfResultParams

func (self *IchubResult) DataIfResultParams() *IchubResultParams

func (*IchubResult) Fail

func (self *IchubResult) Fail() *IchubResult

func (*IchubResult) FailMessage

func (self *IchubResult) FailMessage(msg string) *IchubResult

func (*IchubResult) FailMsg

func (self *IchubResult) FailMsg(msg string) *IchubResult

func (*IchubResult) FromJson

func (self *IchubResult) FromJson(body []byte) (*IchubResult, error)

func DataOfIndex(1)

func (*IchubResult) GetData

func (self *IchubResult) GetData() any

func (*IchubResult) GetDbResult

func (self *IchubResult) GetDbResult() map[string]any

func (*IchubResult) GetEsResult

func (self *IchubResult) GetEsResult() map[string]any

func (*IchubResult) Init

func (self *IchubResult) Init()

func (*IchubResult) IsFailed

func (self *IchubResult) IsFailed() bool

func (*IchubResult) IsSuccess

func (self *IchubResult) IsSuccess() bool

func (*IchubResult) ParseData

func (self *IchubResult) ParseData(model interface{}) *IchubResult

func (*IchubResult) ParseRemote

func (self *IchubResult) ParseRemote(model interface{}) *IchubResult

func (*IchubResult) ParseResult

func (self *IchubResult) ParseResult() *IchubResult

func (*IchubResult) SetData

func (self *IchubResult) SetData(s any)

func (*IchubResult) Shutdown

func (self *IchubResult) Shutdown()

func (*IchubResult) String

func (self *IchubResult) String() string

func (*IchubResult) Success

func (self *IchubResult) Success() *IchubResult

func (*IchubResult) SuccessData

func (self *IchubResult) SuccessData(data any) *IchubResult

func (*IchubResult) SuccessMessage

func (self *IchubResult) SuccessMessage(msg string, data any) *IchubResult

func (*IchubResult) To

func (self *IchubResult) To(out interface{})

func (*IchubResult) ToBytes

func (self *IchubResult) ToBytes() []byte

func (*IchubResult) ToString

func (self *IchubResult) ToString() string

func (*IchubResult) ValueByKey

func (self *IchubResult) ValueByKey(key string) any

func (*IchubResult) ValueOfKey

func (self *IchubResult) ValueOfKey(key string) *gvar.Var

type IchubResultParam

type IchubResultParam struct {
	BaseEntity
	// contains filtered or unexported fields
}

@Title 文件名称: ichub_param.go @Description 描述: 有芯规则引擎执行的参数值对象

应该进行值类型转换,转成string,再转成各类型

@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)

规则体支持的基础数据类型 string bool int, int8, int16, int32, int64 uint uint8, uint16,uint32, uint64 float32 float64

func NewIchubResultParam

func NewIchubResultParam(value any) *IchubResultParam

func (*IchubResultParam) CheckType

func (p *IchubResultParam) CheckType(i interface{}) string

func (*IchubResultParam) CheckTypeParam

func (p *IchubResultParam) CheckTypeParam() string

func (*IchubResultParam) From

func (p *IchubResultParam) From(value any) *IchubResultParam

func (*IchubResultParam) IfBool

func (p *IchubResultParam) IfBool() bool

func (*IchubResultParam) IfByte

func (p *IchubResultParam) IfByte() bool

func (*IchubResultParam) IfFloat32

func (p *IchubResultParam) IfFloat32() bool

func (*IchubResultParam) IfFloat64

func (p *IchubResultParam) IfFloat64() bool

func (*IchubResultParam) IfInt

func (p *IchubResultParam) IfInt() bool

func (*IchubResultParam) IfInt16

func (p *IchubResultParam) IfInt16() bool

func (*IchubResultParam) IfInt32

func (p *IchubResultParam) IfInt32() bool

func (*IchubResultParam) IfInt64

func (p *IchubResultParam) IfInt64() bool

func (*IchubResultParam) IfInt8

func (p *IchubResultParam) IfInt8() bool

func (*IchubResultParam) IfStr

func (p *IchubResultParam) IfStr() bool

func (*IchubResultParam) IfString

func (p *IchubResultParam) IfString() bool

func (*IchubResultParam) IfUInt16

func (p *IchubResultParam) IfUInt16() bool

func (*IchubResultParam) IfUInt32

func (p *IchubResultParam) IfUInt32() bool

func (*IchubResultParam) IfUInt64

func (p *IchubResultParam) IfUInt64() bool

func (*IchubResultParam) IfUInt8

func (p *IchubResultParam) IfUInt8() bool

func (*IchubResultParam) SetValue

func (p *IchubResultParam) SetValue(value any)

func (*IchubResultParam) String

func (p *IchubResultParam) String() string

func (*IchubResultParam) ToBool

func (p *IchubResultParam) ToBool() (ivalue bool)

func (*IchubResultParam) ToByte

func (p *IchubResultParam) ToByte() byte

func (*IchubResultParam) ToBytes

func (p *IchubResultParam) ToBytes() []byte

func (*IchubResultParam) ToFloat32

func (p *IchubResultParam) ToFloat32() (ivalue float32)

func (*IchubResultParam) ToFloat64

func (p *IchubResultParam) ToFloat64() (ivalue float64)

func (*IchubResultParam) ToInt

func (p *IchubResultParam) ToInt() int

func (*IchubResultParam) ToInt16

func (p *IchubResultParam) ToInt16() (ivalue int16)

func (*IchubResultParam) ToInt32

func (p *IchubResultParam) ToInt32() (ivalue int32)

func (*IchubResultParam) ToInt64

func (p *IchubResultParam) ToInt64() (ivalue int64)

func (*IchubResultParam) ToInt8

func (p *IchubResultParam) ToInt8() (ivalue int8)

func (*IchubResultParam) ToString

func (p *IchubResultParam) ToString() string

func (*IchubResultParam) ToUIn8

func (p *IchubResultParam) ToUIn8() uint8

func (*IchubResultParam) ToUInt

func (p *IchubResultParam) ToUInt() uint

func (*IchubResultParam) ToUInt16

func (p *IchubResultParam) ToUInt16() (ivalue uint16)

func (*IchubResultParam) ToUInt32

func (p *IchubResultParam) ToUInt32() (ivalue uint32)

func (*IchubResultParam) ToUInt64

func (p *IchubResultParam) ToUInt64() (ivalue uint64)

非int64也支持强制转换

func (*IchubResultParam) Value

func (p *IchubResultParam) Value() any

type IchubResultParams

type IchubResultParams struct {
	Params map[string]any `json:"params"`
	BaseEntity
}

func NewIchubResultParams

func NewIchubResultParams() *IchubResultParams

func (*IchubResultParams) GetMap

func (p *IchubResultParams) GetMap(key string) map[string]any

func (*IchubResultParams) GetParam

func (p *IchubResultParams) GetParam(key string) *IchubResultParam

func (*IchubResultParams) GetParams

func (p *IchubResultParams) GetParams(key string) *IchubResultParams

func (*IchubResultParams) SetParam

func (p *IchubResultParams) SetParam(key string, value any)

func (*IchubResultParams) ValueOf

func (this *IchubResultParams) ValueOf(m map[string]any) *IchubResultParams

type IchubResults

type IchubResults struct {
	BaseEntity
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data []*IchubResult `json:"data,omitempty"`
}

func NewIchubResults

func NewIchubResults() *IchubResults

func ParseIchubResults

func ParseIchubResults(body []byte) *IchubResults

func SuccessIchubResults

func SuccessIchubResults() *IchubResults

func SuccessIchubResultsData

func SuccessIchubResultsData(data []*IchubResult) *IchubResults

@Title 文件名称: ichubresults.go @Description 描述: 批量统一返回结构

@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)

func (*IchubResults) CheckCode

func (results *IchubResults) CheckCode(suite suite.Suite, code int)

func (*IchubResults) Fail

func (results *IchubResults) Fail() *IchubResults

func (*IchubResults) FailMessage

func (results *IchubResults) FailMessage(msg string) *IchubResults

func (*IchubResults) FromJson

func (results *IchubResults) FromJson(body []byte) (*IchubResults, error)

func DataOfIndex(1)

func (*IchubResults) GetData

func (results *IchubResults) GetData() []*IchubResult

func (*IchubResults) IsFailed

func (results *IchubResults) IsFailed() bool

func (*IchubResults) IsFailedAny

func (results *IchubResults) IsFailedAny() bool

func (*IchubResults) IsSuccess

func (results *IchubResults) IsSuccess() bool

func (*IchubResults) Log

func (results *IchubResults) Log()

func (*IchubResults) SetData

func (results *IchubResults) SetData(s []*IchubResult)

func (*IchubResults) String

func (results *IchubResults) String() (s string)

func (*IchubResults) Success

func (results *IchubResults) Success() *IchubResults

func (*IchubResults) SuccessData

func (results *IchubResults) SuccessData(data []*IchubResult) *IchubResults

func (*IchubResults) SuccessMsg

func (results *IchubResults) SuccessMsg(msg string, data ...*IchubResult) *IchubResults

func (*IchubResults) ToString

func (results *IchubResults) ToString() string

func (*IchubResults) ValueOf

func (results *IchubResults) ValueOf(index int) *IchubResult

type IndexObjectAdapter

type IndexObjectAdapter struct {
	baseindex.IndexMapping
}

func DefaultAdapter

func DefaultAdapter(indexObject baseindex.IndexObject) *IndexObjectAdapter

func NewIndexObjectAdapter

func NewIndexObjectAdapter(indexObject baseindex.IndexObject) *IndexObjectAdapter

func (IndexObjectAdapter) IndexAlaisName

func (b IndexObjectAdapter) IndexAlaisName() string

func (IndexObjectAdapter) IndexName

func (b IndexObjectAdapter) IndexName() string

func (IndexObjectAdapter) Mapping

func (b IndexObjectAdapter) Mapping() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL