basedto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MulanPSL-2.0 Imports: 12 Imported by: 0

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

This section is empty.

Types

type BaseEntity

type BaseEntity struct {
	Proxy func() *BaseProxy `json:"-"`
}

func NewBaseEntity

func NewBaseEntity() *BaseEntity

func (*BaseEntity) Clone

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

func (*BaseEntity) FromJson

func (entity *BaseEntity) FromJson(body []byte) interface{}

func (*BaseEntity) Id2Str

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

func (*BaseEntity) InitProxy

func (entity *BaseEntity) InitProxy(some interface{})

func (*BaseEntity) Log

func (entity *BaseEntity) Log()

func (*BaseEntity) String

func (entity *BaseEntity) String() string

func (*BaseEntity) ToJson

func (entity *BaseEntity) ToJson() string

func (*BaseEntity) ToPrettyString

func (entity *BaseEntity) ToPrettyString() string

func (*BaseEntity) ToString

func (entity *BaseEntity) ToString() string

func (*BaseEntity) ValueFrom

func (this *BaseEntity) ValueFrom(from interface{})

type BaseProxy

type BaseProxy struct {
	Some interface{}
}

func NewBaseProxy

func NewBaseProxy(some interface{}) *BaseProxy

func (*BaseProxy) Clone

func (proxy *BaseProxy) Clone() interface{}

func (*BaseProxy) FromJson

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

func (*BaseProxy) Log

func (proxy *BaseProxy) Log()

func (*BaseProxy) String

func (proxy *BaseProxy) String() string

func (*BaseProxy) ToJson

func (proxy *BaseProxy) ToJson() string

func (*BaseProxy) ToPrettyString

func (proxy *BaseProxy) ToPrettyString() string

func (*BaseProxy) ToString

func (proxy *BaseProxy) ToString() string

func (*BaseProxy) ValueFrom

func (Proxy *BaseProxy) ValueFrom(from interface{})

func (*BaseProxy) ValueOf

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

type IchubError

type IchubError struct {
	Code int
	Msg  string
}

func NewIchubError

func NewIchubError(code int, msg string) *IchubError

func NewIchubErrorServer

func NewIchubErrorServer() *IchubError

func (*IchubError) Error

func (ce *IchubError) Error() string

type IchubResult

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

func IchubResultOf

func IchubResultOf(resp *req.Resp) *IchubResult

func NewIchubResult

func NewIchubResult() *IchubResult

func ParseIchubResult

func ParseIchubResult(body string) *IchubResult

func (*IchubResult) Check

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

keyVal : "Pay=12"

func (*IchubResult) CheckCode

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

func (*IchubResult) CheckValueByKey

func (result *IchubResult) CheckValueByKey(key string, expect interface{}) bool

func (*IchubResult) Checks

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

keyVal : "Pay=12|l=2"

func (*IchubResult) CodeMsg

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

func (*IchubResult) DataIfMapParams

func (result *IchubResult) DataIfMapParams() *IchubResultParams

func (*IchubResult) DbResultTo

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

func (*IchubResult) EsResultTo

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

func (*IchubResult) Fail

func (result *IchubResult) Fail() *IchubResult

func (*IchubResult) FailMessage

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

func (*IchubResult) FromJson

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

func (*IchubResult) GetData

func (p *IchubResult) GetData() interface{}

func (*IchubResult) GetDbResult

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

func (*IchubResult) GetEsResult

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

func (*IchubResult) Log

func (result *IchubResult) Log()

func (*IchubResult) SetData

func (p *IchubResult) SetData(s interface{})

func (*IchubResult) Success

func (result *IchubResult) Success() *IchubResult

func (*IchubResult) SuccessData

func (result *IchubResult) SuccessData(data interface{}) *IchubResult

func (*IchubResult) SuccessMessage

func (result *IchubResult) SuccessMessage(msg string, data interface{}) *IchubResult

func (*IchubResult) To

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

func (*IchubResult) ToString

func (result *IchubResult) ToString() string

func (*IchubResult) ValueByKey

func (result *IchubResult) ValueByKey(key string) interface{}

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 interface{}) *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 interface{}) *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 interface{})

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() interface{}

type IchubResultParams

type IchubResultParams struct {
	Params map[string]interface{}
	BaseEntity
}

func NewIchubResultParams

func NewIchubResultParams() *IchubResultParams

func (*IchubResultParams) GetMap

func (p *IchubResultParams) GetMap(key string) map[string]interface{}

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 interface{})

func (*IchubResultParams) ValueOf

func (this *IchubResultParams) ValueOf(m map[string]interface{}) *IchubResultParams

type IchubResults

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

func IchubResultsFromJson

func IchubResultsFromJson(body []byte) (*IchubResults, error)

func IchubResultsOf

func IchubResultsOf(resp *req.Resp) *IchubResults

func NewIchubResults

func NewIchubResults() *IchubResults

func ParseIchubResults

func ParseIchubResults(body string) *IchubResults

func (*IchubResults) Check

func (results *IchubResults) Check(suite suite.Suite, exp, real interface{})

func (*IchubResults) CheckCode

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

func (*IchubResults) Clone

func (results *IchubResults) Clone() *IchubResults

func (*IchubResults) CodeMsg

func (results *IchubResults) CodeMsg(code int, msg string) *IchubResults

func (*IchubResults) Fail

func (results *IchubResults) Fail() *IchubResults

func (*IchubResults) FailCode

func (results *IchubResults) FailCode(code int, msg string) *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(data []IchubResult)

func (*IchubResults) String

func (results *IchubResults) String() 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) ValueOfData

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

type JsonResult

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

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  int32 `json:"current"`
	PageSize int32 `json:"page_size"`
	Total    int32 `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 []interface{} `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