2023-01-06 00:39:21 +01:00
|
|
|
package primary
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func bool2DB(b bool) int {
|
|
|
|
if b {
|
|
|
|
return 1
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func time2DB(t time.Time) int64 {
|
|
|
|
return t.UnixMilli()
|
|
|
|
}
|
|
|
|
|
|
|
|
func time2DBOpt(t *time.Time) *int64 {
|
|
|
|
if t == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return langext.Ptr(t.UnixMilli())
|
|
|
|
}
|
2024-09-20 15:36:16 +02:00
|
|
|
|
|
|
|
type CountResponse struct {
|
|
|
|
Count int64 `db:"count"`
|
|
|
|
}
|