From e69f764b379e6bea2af06d7699bc4e701431efa1 Mon Sep 17 00:00:00 2001 From: yedongfu Date: Sun, 23 May 2021 10:47:36 +0800 Subject: [PATCH] go test --- docker-compose.yml | 1 + dtmsvr/types.go | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 53f1c3b..9eee211 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: - '80:4005' volumes: - .:/app/dtm + command: ['sh', '-c', 'go build app/main.go && go test ./dtmsvr'] mysql: image: 'daocloud.io/mysql:5.7' environment: diff --git a/dtmsvr/types.go b/dtmsvr/types.go index 735203e..2a13f28 100644 --- a/dtmsvr/types.go +++ b/dtmsvr/types.go @@ -8,8 +8,8 @@ type M = map[string]interface{} type ModelBase struct { ID uint - CreateTime time.Time `gorm:"autoCreateTime"` - UpdateTime time.Time `gorm:"autoUpdateTime"` + CreateTime *time.Time `gorm:"autoCreateTime"` + UpdateTime *time.Time `gorm:"autoUpdateTime"` } type SagaModel struct { ModelBase @@ -17,8 +17,8 @@ type SagaModel struct { Steps string `json:"steps"` TransQuery string `json:"trans_query"` Status string `json:"status"` - FinishTime time.Time - RollbackTime time.Time + FinishTime *time.Time + RollbackTime *time.Time } func (*SagaModel) TableName() string { @@ -33,8 +33,8 @@ type SagaStepModel struct { Url string Type string Status string - FinishTime string - RollbackTime string + FinishTime *time.Time + RollbackTime *time.Time } func (*SagaStepModel) TableName() string {