fix: 修复空提交问题
This commit is contained in:
@@ -33,7 +33,7 @@ func init() {
|
|||||||
ctx = gctx.GetInitCtx()
|
ctx = gctx.GetInitCtx()
|
||||||
redisConfig = &gredis.Config{}
|
redisConfig = &gredis.Config{}
|
||||||
)
|
)
|
||||||
Loger.Debug(ctx, "module cool init start ...")
|
Loger.Debug(ctx, "module cool init start ...", gtime.Now())
|
||||||
buildData := gbuild.Data()
|
buildData := gbuild.Data()
|
||||||
if _, ok := buildData["mode"]; ok {
|
if _, ok := buildData["mode"]; ok {
|
||||||
RunMode = buildData["mode"].(string)
|
RunMode = buildData["mode"].(string)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type UserModel interface {
|
|||||||
type Model struct {
|
type Model struct {
|
||||||
ID uint `gorm:"primaryKey" json:"id"`
|
ID uint `gorm:"primaryKey" json:"id"`
|
||||||
CreateTime *gtime.Time ` gorm:"column:createTime;not null;index,priority:1;autoCreateTime:nano;comment:创建时间" json:"createTime"` // 创建时间
|
CreateTime *gtime.Time ` gorm:"column:createTime;not null;index,priority:1;autoCreateTime:nano;comment:创建时间" json:"createTime"` // 创建时间
|
||||||
UpdateTime *gtime.Time ` gorm:"column:updateTime;not null;index,priority:1;autoUpdateTime:nano;comment:更新时间" json:"updateTime"` // 更新时间
|
UpdateTime *gtime.Time ` orm:"autoUpdateTime=true" gorm:"column:updateTime;not null;index,priority:1;autoUpdateTime:nano;comment:更新时间" json:"updateTime"` // 更新时间
|
||||||
DeletedAt *gtime.Time `gorm:"index" json:"deletedAt"`
|
DeletedAt *gtime.Time `gorm:"index" json:"deletedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||||
|
|
||||||
_ "blazing/contrib/files/local"
|
_ "blazing/contrib/files/local"
|
||||||
|
"blazing/login/internal/cmd"
|
||||||
|
|
||||||
// Minio,按需启用
|
// Minio,按需启用
|
||||||
// _ "blazing/contrib/files/minio"
|
// _ "blazing/contrib/files/minio"
|
||||||
@@ -17,14 +18,20 @@ import (
|
|||||||
|
|
||||||
_ "blazing/modules"
|
_ "blazing/modules"
|
||||||
|
|
||||||
"blazing/login/internal/cmd"
|
|
||||||
|
|
||||||
"github.com/gogf/gf/v2/os/gctx"
|
"github.com/gogf/gf/v2/os/gctx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// element.TestAllScenarios()
|
// element.TestAllScenarios()
|
||||||
//service.TestSendVerificationCode()
|
//service.TestSendVerificationCode()
|
||||||
|
|
||||||
|
// t := model.GenPetInfo(1, 31, 1, 1, 1, 1)
|
||||||
|
// service.NewUserService(10001).Pet.PetAdd(*t)
|
||||||
|
// service.NewUserService(10001).Pet.PetInfo_One_exec(t.CatchTime, func(pe *model.PetEX) {
|
||||||
|
// fmt.Println(pe.CreateTime)
|
||||||
|
|
||||||
|
// pe.Data.ID = 100
|
||||||
|
// })
|
||||||
cmd.Main.Run(gctx.New())
|
cmd.Main.Run(gctx.New())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ database:
|
|||||||
timezone: "Asia/Shanghai"
|
timezone: "Asia/Shanghai"
|
||||||
createdAt: "createTime"
|
createdAt: "createTime"
|
||||||
updatedAt: "updateTime"
|
updatedAt: "updateTime"
|
||||||
|
timeMaintainDisabled: false # (可选)是否完全关闭时间更新特性,为true时CreatedAt/UpdatedAt/DeletedAt都将失效
|
||||||
# deletedAt: "deleteTime"
|
# deletedAt: "deleteTime"
|
||||||
# default:
|
# default:
|
||||||
# type: "mysql"
|
# type: "mysql"
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ func (s *PetService) PetInfo_One_exec(cachetime uint32, t func(*model.PetEX)) {
|
|||||||
}
|
}
|
||||||
tt.Data.CatchTime = tt.CatchTime
|
tt.Data.CatchTime = tt.CatchTime
|
||||||
t(&tt)
|
t(&tt)
|
||||||
m.Save(tt)
|
_,err := m.OnConflict("catch_time").Update(tt)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
func (s *PetService) PetInfo_One(cachetime uint32) model.PetEX {
|
func (s *PetService) PetInfo_One(cachetime uint32) model.PetEX {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user