|
@@ -1,7 +1,6 @@
|
|
|
package syncer
|
|
|
|
|
|
import (
|
|
|
- "encoding/json"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -49,23 +48,3 @@ type ClientPriceUpdate struct {
|
|
|
RecCreatedAt string `json:"rec_create_at"`
|
|
|
RecUpdatedAt string `json:"rec_update_at"`
|
|
|
}
|
|
|
-
|
|
|
-// Custom unmarshal for date time of the record
|
|
|
-func (s *ClientPriceUpdate) UnmarshalJSON(data []byte) error {
|
|
|
- var aux ClientPriceUpdate
|
|
|
- if err := json.Unmarshal(data, &aux); err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- createdAt, e := time.Parse("2006-01-02 15:04:05.999999999-07:00", aux.RecCreatedAt)
|
|
|
- if e != nil {
|
|
|
- return e
|
|
|
- }
|
|
|
- updatedAt, e := time.Parse("2006-01-02 15:04:05.999999999-07:00", aux.RecUpdatedAt)
|
|
|
- if e != nil {
|
|
|
- return e
|
|
|
- }
|
|
|
-
|
|
|
- s.CreatedAt = createdAt
|
|
|
- s.UpdatedAt = updatedAt
|
|
|
- return nil
|
|
|
-}
|