diff --git a/echo-mysql/main.go b/echo-mysql/main.go index 7c970ce7..e7c7770c 100644 --- a/echo-mysql/main.go +++ b/echo-mysql/main.go @@ -68,6 +68,7 @@ func StartHTTPServer() { if err != nil { return c.String(http.StatusInternalServerError, fmt.Sprintf("Failed Persisiting Entity with Error %s", err.Error())) } else { + req.UpdatedAt = req.UpdatedAt.Truncate(time.Second) return c.JSON(http.StatusOK, req) } }) diff --git a/echo-mysql/uss/store.go b/echo-mysql/uss/store.go index 016e284c..c54df75a 100644 --- a/echo-mysql/uss/store.go +++ b/echo-mysql/uss/store.go @@ -13,7 +13,7 @@ type ShortCodeInfo struct { UID uint64 `json:"id" sql:"AUTO_INCREMENT" gorm:"primary_key"` ShortCode string `json:"shortcode" gorm:"uniqueIndex"` URL string `json:"url"` - UpdatedAt time.Time `json:"updated_at"` + UpdatedAt time.Time `json:"updated_at" gorm:"datetime(0);autoUpdateTime"` } type USSStore struct {