Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributedId ¶
type DistributedId int64
func (DistributedId) MarshalJSON ¶
func (t DistributedId) MarshalJSON() ([]byte, error)
MarshalJSON *
- @Description: 重写MarshalJSON方法
- @receiver t
- @return []byte
- @return error
func (*DistributedId) Scan ¶
func (t *DistributedId) Scan(v interface{}) error
Scan 将数据库中取出的数据,赋值给目标类型
func (*DistributedId) UnmarshalJSON ¶
func (t *DistributedId) UnmarshalJSON(b []byte) error
UnmarshalJSON *
- @Description: 重写UnmarshalJSON方法
- @receiver t
- @param b
- @return error
type DistributedIdGenerator ¶
func InitDistributedIdGenerator ¶
func InitDistributedIdGenerator(tenantId string, node int64) (generator *DistributedIdGenerator, err error)
InitDistributedIdGenerator *
- @Description: 初始化分布式ID生成器
- @param tenantId
- @param node
- @return generator
- @return err
func (*DistributedIdGenerator) CreateId ¶
func (generator *DistributedIdGenerator) CreateId() DistributedId
CreateId *
- @Description: 创建一个分布式ID(雪花ID)
- @return DistributedId
type Model ¶
type Model struct { ID DistributedId `json:"id" form:"id" gorm:"column:id;primary_key;type:bigint"` CreateTime string `json:"createTime" form:"-" gorm:"column:create_time;index;type:varchar(20)"` UpdateTime string `json:"updateTime,omitempty" form:"-" gorm:"column:update_time;type:varchar(20)"` }
Click to show internal directories.
Click to hide internal directories.