common

package
v0.0.0-...-e432ecc Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date time.Time

func (*Date) GobDecode

func (date *Date) GobDecode(b []byte) error

func (Date) GobEncode

func (date Date) GobEncode() ([]byte, error)

func (Date) GormDataType

func (date Date) GormDataType() string

GormDataType gorm common data type

func (Date) MarshalJSON

func (date Date) MarshalJSON() ([]byte, error)

func (*Date) Scan

func (date *Date) Scan(value interface{}) (err error)

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(data []byte) error

func (Date) Value

func (date Date) Value() (driver.Value, error)

type LocalTime

type LocalTime time.Time

func (LocalTime) MarshalJSON

func (t LocalTime) MarshalJSON() ([]byte, error)

MarshalJSON implements json marshal interface.

func (*LocalTime) Scan

func (t *LocalTime) Scan(v interface{}) error

Scan valueof time.Time 注意是指针类型 method

func (LocalTime) String

func (t LocalTime) String() string

func (*LocalTime) UnmarshalJSON

func (t *LocalTime) UnmarshalJSON(data []byte) (err error)

func (LocalTime) Value

func (t LocalTime) Value() (driver.Value, error)

Value ...

type Model

type Model struct {
	ID         uint64     `gorm:"primary_key" json:"id"`
	CreateTime *LocalTime `gorm:"autoCreateTime,<-:create" json:"create_time"`
	UpdateTime *LocalTime `gorm:"autoUpdateTime" json:"update_time"`
}

Jump to

Keyboard shortcuts

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