basedto

package
v1.4.120 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MulanPSL-2.0 Imports: 20 Imported by: 195

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
View Source
const CURRENT = 0
View Source
const PAGE_SIZE = 20

Variables

This section is empty.

Functions

func LoadBaseEntity added in v1.0.70

func LoadBaseEntity() baseiface.ISingleton

Types

type BaseEntity

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

func FindBeanBaseEntity added in v1.0.70

func FindBeanBaseEntity() *BaseEntity

func NewBaseEntity

func NewBaseEntity() *BaseEntity

func (*BaseEntity) AutoInject added in v1.0.53

func (this *BaseEntity) AutoInject() bool

func (*BaseEntity) Autoload added in v1.0.53

func (this *BaseEntity) Autoload() bool

func (*BaseEntity) Bind added in v1.0.80

func (this *BaseEntity) Bind()

func (*BaseEntity) BindUp added in v1.0.81

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

func (*BaseEntity) Clone

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

func (*BaseEntity) ContainsType added in v1.3.5

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

func (*BaseEntity) CopyWithOption

func (this *BaseEntity) CopyWithOption(from any)

func (*BaseEntity) FindBinding added in v1.0.82

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

func (*BaseEntity) FromJsonAny added in v1.0.53

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

func (*BaseEntity) Id2Str

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

func (*BaseEntity) InitProxy

func (this *BaseEntity) InitProxy(some any)

func (*BaseEntity) Log

func (this *BaseEntity) Log()

func (*BaseEntity) Single added in v1.0.53

func (this *BaseEntity) Single() bool

func (*BaseEntity) Str2Int

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

func (*BaseEntity) String

func (this *BaseEntity) String() string

func (*BaseEntity) ToJson

func (this *BaseEntity) ToJson() string

func (*BaseEntity) ToJsonBytes added in v1.0.51

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

func (*BaseEntity) ToPrettyString

func (this *BaseEntity) ToPrettyString() string

func (*BaseEntity) ToString

func (this *BaseEntity) ToString() string

func (*BaseEntity) ValueFrom

func (this *BaseEntity) ValueFrom(from any)

func (*BaseEntity) ValueOf

func (this *BaseEntity) ValueOf(that any)

type BaseEntitySingle added in v1.0.60

type BaseEntitySingle struct {
	BaseEntity
}

func (*BaseEntitySingle) InitProxy added in v1.2.4

func (this *BaseEntitySingle) InitProxy(some any)

func (*BaseEntitySingle) Single added in v1.0.60

func (this *BaseEntitySingle) Single() bool

type BaseProxy

type BaseProxy struct {
	Some any
}

func NewBaseProxy

func NewBaseProxy(some any) *BaseProxy

func (*BaseProxy) AutoInject added in v1.0.53

func (this *BaseProxy) AutoInject() bool

func (*BaseProxy) Autoload added in v1.0.53

func (this *BaseProxy) Autoload() bool

func (*BaseProxy) Check added in v1.2.3

func (this *BaseProxy) Check() error

func (*BaseProxy) Clone

func (this *BaseProxy) Clone() any

func (*BaseProxy) ContainsType added in v1.3.5

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) IfBaseEntity added in v1.3.7

func (this *BaseProxy) IfBaseEntity() bool

func (*BaseProxy) Log

func (this *BaseProxy) Log()

func (*BaseProxy) Single added in v1.0.53

func (this *BaseProxy) Single() bool

func (*BaseProxy) String

func (this *BaseProxy) String() string

func (*BaseProxy) ToJson

func (this *BaseProxy) ToJson() string

func (*BaseProxy) ToJsonBytes added in v1.0.51

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 added in v1.0.102

func ResultCodeMsg(code int, msg string) *IchubResult

func ResultFailMsg added in v1.0.102

func ResultFailMsg(msg string) *IchubResult

func ResultSuccessData added in v1.0.102

func ResultSuccessData(data interface{}) *IchubResult

func ValueOf

func ValueOf(resp *resty.Response) *IchubResult

func (*IchubResult) Check

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

func (*IchubResult) CheckCode

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

func (*IchubResult) CheckValueByKey

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

func (*IchubResult) Checks

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

keyVal : "Pay=12|l=2"

func (*IchubResult) CodeMsg

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

func (*IchubResult) DataIfMap

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

func (*IchubResult) DataIfResultParams

func (this *IchubResult) DataIfResultParams() *IchubResultParams

func (*IchubResult) Fail

func (this *IchubResult) Fail() *IchubResult

func (*IchubResult) FailMessage

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

func (*IchubResult) FailMsg added in v1.0.52

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

func (*IchubResult) FromJson

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

func DataOfIndex(1)

func (*IchubResult) GetData

func (this *IchubResult) GetData() any

func (*IchubResult) GetDbResult

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

func (*IchubResult) GetEsResult

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

func (*IchubResult) IsSuccess added in v1.0.44

func (this *IchubResult) IsSuccess() bool

func (*IchubResult) ParseData added in v1.0.53

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

func (*IchubResult) ParseRemote added in v1.0.55

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

func (*IchubResult) ParseResult added in v1.0.53

func (result *IchubResult) ParseResult() *IchubResult

func (*IchubResult) SetData

func (this *IchubResult) SetData(s any)

func (*IchubResult) String

func (this *IchubResult) String() string

func (*IchubResult) Success

func (this *IchubResult) Success() *IchubResult

func (*IchubResult) SuccessData

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

func (*IchubResult) SuccessMessage

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

func (*IchubResult) To

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

func (*IchubResult) ToBytes added in v1.0.42

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

func (*IchubResult) ToString

func (this *IchubResult) ToString() string

func (*IchubResult) ValueByKey

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

func (*IchubResult) ValueOfKey added in v1.3.8

func (this *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 ParseIchubResults

func ParseIchubResults(body []byte) *IchubResults

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) 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) SuccessMessage

func (results *IchubResults) SuccessMessage(msg string, data []IchubResult) *IchubResults

func (*IchubResults) ToString

func (results *IchubResults) ToString() string

func (*IchubResults) ValueOf

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

type JsonResult

type JsonResult struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data string `json:"data"`
	BaseEntity
}

func NewJsonResult

func NewJsonResult() *JsonResult

func (*JsonResult) Fail

func (result *JsonResult) Fail() *JsonResult

func (*JsonResult) FailMessage

func (result *JsonResult) FailMessage(msg string) *JsonResult

func (*JsonResult) GetData

func (p *JsonResult) GetData() string

func (*JsonResult) SetData

func (p *JsonResult) SetData(s string)

func (*JsonResult) String

func (result *JsonResult) String() string

func (*JsonResult) Success

func (result *JsonResult) Success() *JsonResult

func (*JsonResult) SuccessData

func (result *JsonResult) SuccessData(data string) *JsonResult

func (*JsonResult) SuccessMessage

func (result *JsonResult) SuccessMessage(msg string, data string) *JsonResult

func (*JsonResult) ToString

func (result *JsonResult) ToString() string

type PageParam

type PageParam struct {
	Current  int `json:"current"`
	PageSize int `json:"page_size"`
	Total    int `json:"total"`
	Count    int `json:"count"`
}

func (*PageParam) String

func (pageParam *PageParam) String() string

func (*PageParam) ToString

func (pageParam *PageParam) ToString() string

type PageResult

type PageResult struct {
	JsonResult
	Page PageParam `json:"data"`
	Data []any     `json:"data"`
}

func (*PageResult) String

func (pageResult *PageResult) String() string

func (*PageResult) ToString

func (pageResult *PageResult) ToString() string

type QueryParam

type QueryParam struct {
	Current    int    `json:"current"`
	PageSize   int    `json:"page_size"`
	OrderBys   string `json:"order_bys"`
	FuzzyQuery bool   `json:"fuzzy_query"`
	EsQuery    bool   `json:"es_query"`

	Param *basemodel.ParamBase `json:"param"`
}

func (*QueryParam) String

func (param *QueryParam) String() string

func (*QueryParam) ToString

func (param *QueryParam) ToString() string

Jump to

Keyboard shortcuts

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