common

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

README

common

常用组件集合

Jtime

jtime.Init

models:

type Int struct {
    CreatedAt jtime.Int `gorm:"comment:'创建时间';type:bigint not null;" json:"created_at"`
    Id        int       `json:"id"`
}

data:

[{1603765784 1} {1603765900 4} {1603765907 5} {1603765933 6} {1603767542 7}]

show:

[{"created_at":"2020-10-27 10:29:44","id":1},{"created_at":"2020-10-27 10:31:40","id":4},{"created_at":"2020-10-27 10:31:47","id":5},{"created_at":"2020-10-27 10:32:13","id":6},{"created_at":"2020-10-27 10:59:02","id":7}]
jtime.Time

models:

type Time struct {
    CreatedAt jtime.Time `gorm:"comment:'创建时间';type:timestamp not null;default:current_timestamp" json:"created_at"`
    Id        int        `json:"id"`
}

data:

[{{0 63739362983 <nil>} 1} {{0 63739363002 <nil>} 2} {{0 63739363026 <nil>} 3} {{0 63739363146 <nil>} 4} {{0 63739363383 <nil>} 5} {{0 63739364434 <nil>} 6} {{0 63739364464 <nil>} 7}]

show:

[{"created_at":"2020-10-27 02:36:23","id":1},{"created_at":"2020-10-27 02:36:42","id":2},{"created_at":"2020-10-27 02:37:06","id":3},{"created_at":"2020-10-27 02:39:06","id":4},{"created_at":"2020-10-27 02:43:03","id":5},{"created_at":"2020-10-27 03:00:34","id":6},{"created_at":"2020-10-27 03:01:04","id":7}]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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