first commit

This commit is contained in:
2023-09-30 21:47:59 +08:00
commit d642ed1a9c
62 changed files with 8635 additions and 0 deletions

13
common/random.go Normal file
View File

@@ -0,0 +1,13 @@
package common
import (
"github.com/sqids/sqids-go"
)
func UniqID(unix int64) string {
s, _ := sqids.New(sqids.Options{
MinLength: 8,
})
id, _ := s.Encode([]uint64{uint64(unix)})
return id
}

7
common/time.go Normal file
View File

@@ -0,0 +1,7 @@
package common
import "time"
func Unix2Datetime(t int64) string {
return time.Unix(t, 0).Format(time.DateTime)
}