common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	Id         int64        `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
	UserId     int64        `gorm:"column:user_id;type:bigint(20);<-:create" json:"userId"` //主账号uid
	IsDeleted  bool         `gorm:"column:is_deleted;type:tinyint(1)" json:"isDeleted"`
	DateAdd    JsonTime     `gorm:"column:date_add;type:datetime(3);default:null;<-:create" json:"dateAdd"`
	DateUpdate JsonTime     `gorm:"column:date_update;type:datetime(3);default:null" json:"dateUpdate"`
	DateDelete sql.NullTime `gorm:"column:date_delete;type:datetime(3)" json:"dateDelete"`
}

type JsonTime

type JsonTime time.Time

定义个类型别名

func (*JsonTime) MarshalJSON

func (m *JsonTime) MarshalJSON() ([]byte, error)

实现它的json序列化方法

func (*JsonTime) Scan

func (m *JsonTime) Scan(value interface{}) error

func (*JsonTime) ToString

func (m *JsonTime) ToString() string

func (*JsonTime) UnmarshalJSON

func (m *JsonTime) UnmarshalJSON(data []byte) error

实现json.Unmarshaler接口

func (JsonTime) Value

func (m JsonTime) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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