新增自定义数据库映射类型 LocalDateTime,完善套餐查询接口

This commit is contained in:
2025-04-10 17:49:11 +08:00
parent 02897db890
commit c1b4f8d605
52 changed files with 532 additions and 447 deletions

View File

@@ -27,7 +27,11 @@ func main() {
})
g.UseDB(db)
models := g.GenerateAllTable()
models := g.GenerateAllTable(
gen.FieldType("created_at", "common.LocalDateTime"),
gen.FieldType("updated_at", "common.LocalDateTime"),
gen.FieldType("deleted_at", "common.LocalDateTime"),
)
g.ApplyBasic(models...)
modelChannel := g.GenerateModel("channel",

View File

@@ -1,7 +1,14 @@
package main
import (
"fmt"
"time"
)
func main() {
for i := range 3 {
println(i)
parse, err := time.Parse(time.RFC3339, "2025-04-16T16:00:00.000Z")
if err != nil {
return
}
fmt.Printf("%x\n", parse)
}