mmodel

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SToString = func(data any) string {
	return fmt.Sprintf("%v", data)
}

Functions

This section is empty.

Types

type CmdCode added in v0.0.8

type CmdCode struct {
	Code string `json:"code"  form:"code" uri:"code" binding:"required"`
}

type CmdID added in v0.2.9

type CmdID struct {
	ID int64 `json:"id" form:"id" uri:"id"  binding:"required"`
}

type CmdIDStr added in v0.2.9

type CmdIDStr struct {
	ID string `json:"id"  form:"id" uri:"id"  binding:"required"`
}

type CmdPage

type CmdPage struct {
	Page   String   `json:"page" form:"page" uri:"page" binding:"required"`
	Size   String   `json:"size" form:"size" uri:"size" binding:"required"`
	Sorter []string `json:"sorter" form:"sorter" uri:"sorter"`
}

func (CmdPage) GetPage added in v0.3.2

func (ew CmdPage) GetPage() int64

func (CmdPage) GetSize added in v0.3.2

func (ew CmdPage) GetSize() int64

type CmdStat added in v0.0.8

type CmdStat struct {
	ID      string `json:"id"  binding:"required"`
	NewStat bool   `json:"newStat" `
	OldStat bool   `json:"oldStat" `
}

type CodeName added in v0.2.9

type CodeName interface {
	CName() string
	CCode() string
}

type Comparator

type Comparator interface {
	Equal(data *any) bool
}

type Err added in v0.3.1

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

type Ext added in v0.2.9

type Ext struct {
	CreateTime     *LocalDatetime `xorm:"datetime comment('创建时间')" json:"createTime"`
	CreateUserCode string         `xorm:"varchar(60) comment('创建人') " json:"createUserCode"`
	CreateUserName string         `xorm:"varchar(100) comment('创建人名称') " json:"createUserName"`
	UpdateTime     *LocalDatetime `xorm:"datetime comment('修改时间') " json:"updateTime"`
	UpdateUserCode string         `xorm:"varchar(60) comment('修改人') " json:"updateUserCode"`
	UpdateUserName string         `xorm:"varchar(100) comment('修改人名称') " json:"updateUserName"`
	Version        int64          `xorm:"version bigint(200) comment('版本号') " json:"version"`
	Deleted        *LocalDatetime `xorm:"deleted datetime comment('删除时间') " json:"deleted"`
}

func (*Ext) C added in v0.2.9

func (ew *Ext) C(user CodeName) Ext

func (*Ext) M added in v0.2.9

func (ew *Ext) M(user CodeName) Ext

type ListMap added in v0.3.1

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

func NewListMap

func NewListMap(cap int) *ListMap

func (*ListMap) Get added in v0.3.1

func (domain *ListMap) Get(index int) any

func (*ListMap) GetV added in v0.3.1

func (domain *ListMap) GetV(key any) any

func (*ListMap) HasNext added in v0.3.1

func (domain *ListMap) HasNext() bool

func (*ListMap) Index added in v0.3.1

func (domain *ListMap) Index() int

func (*ListMap) JsonMap added in v0.3.1

func (domain *ListMap) JsonMap(toString func(object any) string) (data map[string]any)

func (*ListMap) Length added in v0.3.1

func (domain *ListMap) Length() int

func (*ListMap) Map added in v0.3.1

func (domain *ListMap) Map() (data map[any]any)

func (*ListMap) Next added in v0.3.1

func (domain *ListMap) Next() any

func (*ListMap) Put added in v0.3.1

func (domain *ListMap) Put(key any, val any)

func (*ListMap) PutExists added in v0.3.1

func (domain *ListMap) PutExists(key any, val any) bool

func (*ListMap) PutNotFound added in v0.3.1

func (domain *ListMap) PutNotFound(key any, val any) bool

func (*ListMap) RestIndex added in v0.3.1

func (domain *ListMap) RestIndex()

func (*ListMap) Set added in v0.3.1

func (domain *ListMap) Set(index int, val any)

type LocalDatetime

type LocalDatetime time.Time

func NowLocalDateTime

func NowLocalDateTime() *LocalDatetime

func ToLocalDateTime

func ToLocalDateTime(str string) LocalDatetime

func (LocalDatetime) IsNull

func (ce LocalDatetime) IsNull() bool

func (*LocalDatetime) MarshalJSON

func (ce *LocalDatetime) MarshalJSON() ([]byte, error)

func (*LocalDatetime) Scan

func (ce *LocalDatetime) Scan(src any) error

func (LocalDatetime) String

func (ce LocalDatetime) String() string

func (LocalDatetime) Time

func (ce LocalDatetime) Time() time.Time

func (*LocalDatetime) UnmarshalJSON

func (ce *LocalDatetime) UnmarshalJSON(data []byte) (err error)

func (LocalDatetime) Value

func (ce LocalDatetime) Value() (driver.Value, error)

type Pageable

type Pageable struct {
	Content        any   `json:"content"`
	Page           int64 `json:"page"`
	Size           int64 `json:"size"`
	First          bool  `json:"first"`
	Last           bool  `json:"last"`
	MaxPage        int64 `json:"lastPage"`
	TotalElements  int64 `json:"totalElements"`
	CurrentElement int64 `json:"currentElement"`
}

func (*Pageable) IsEmpty

func (domain *Pageable) IsEmpty() bool

func (*Pageable) NotEmpty

func (domain *Pageable) NotEmpty() bool

type Pair

type Pair struct {
	Key any `json:"key"`
	Val any `json:"val"`
}

func (*Pair) Equal

func (domain *Pair) Equal(data *any) bool

type Resp

type Resp struct {
	Code int `json:"code"`
	Data any `json:"data"`
	Err  Err `json:"err"`
}

func Fail

func Fail(message string) *Resp

func Failure

func Failure(code int, errCode string, message string) *Resp

func Ok

func Ok() *Resp

func OkD

func OkD(data any) *Resp

func (*Resp) Ok

func (domain *Resp) Ok() *Resp

type SPUser added in v0.2.9

type SPUser struct {
	UserCode string `json:"userCode"`
	UserName string `json:"userName"`
}

func (SPUser) CCode added in v0.2.9

func (ew SPUser) CCode() string

func (SPUser) CName added in v0.2.9

func (ew SPUser) CName() string

type String

type String string

func NowLocalDateTimeStr

func NowLocalDateTimeStr() String

func ReadString

func ReadString(data []byte) String

func (*String) Bool

func (domain *String) Bool() bool

func (*String) EqualFold

func (domain *String) EqualFold(val string) bool

func (*String) Float32

func (domain *String) Float32() float32

func (*String) Float64

func (domain *String) Float64() float64

func (*String) HasPrefix

func (domain *String) HasPrefix(prefix string) bool

func (*String) HasSuffix

func (domain *String) HasSuffix(suffix string) bool

func (*String) Index

func (domain *String) Index(substr string) int

func (*String) IndexAny

func (domain *String) IndexAny(chars string) int

func (*String) Int

func (domain *String) Int() int

func (*String) Int16

func (domain *String) Int16() int16

func (*String) Int32

func (domain *String) Int32() int32

func (*String) Int64

func (domain *String) Int64() int64

func (*String) Int8

func (domain *String) Int8() int8

func (*String) IsEmpty

func (domain *String) IsEmpty() bool

func (*String) LastIndex

func (domain *String) LastIndex(substr string) int

func (*String) LastIndexAny

func (domain *String) LastIndexAny(chars string) int

func (*String) Length

func (domain *String) Length() int

func (*String) LocalDateTime

func (domain *String) LocalDateTime() LocalDatetime

func (*String) Scan

func (domain *String) Scan(src any) error

func (*String) String

func (domain *String) String() string

func (*String) Time

func (domain *String) Time() time.Time

func (*String) UnmarshalJSON

func (domain *String) UnmarshalJSON(data []byte) (err error)

func (*String) Value

func (domain *String) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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