diff --git a/api/v1/client/client.go b/api/v1/client/client.go index 1c56bbd..05b8c47 100644 --- a/api/v1/client/client.go +++ b/api/v1/client/client.go @@ -5,6 +5,7 @@ import ( "encoding/json" "io" "net/http" + "time" "github.com/NetSepio/erebrus-gateway/api/middleware/auth/paseto" "github.com/NetSepio/erebrus-gateway/config/dbconfig" @@ -108,6 +109,7 @@ func RegisterClient(c *gin.Context) { Region: node.Region, Domain: node.Domain, UserId: userId, + CreatedAt: time.Now(), // CollectionId: req.CollectionId, } if err := db.Create(&dbEntry).Error; err != nil { diff --git a/api/v1/client/types.go b/api/v1/client/types.go index 2d172db..6114981 100644 --- a/api/v1/client/types.go +++ b/api/v1/client/types.go @@ -13,7 +13,7 @@ type Client struct { Address []string `json:"Address,omitempty"` CreatedBy string `json:"CreatedBy,omitempty"` UpdatedBy string `json:"UpdatedBy,omitempty"` - CreatedAt int64 `json:"CreatedAt"` + CreatedAt int64 `json:"CreatedAt,omitempty"` UpdatedAt int64 `json:"UpdatedAt,omitempty"` CollectionId string `json:"CollectionId",omitempty"` } diff --git a/models/erebrus.go b/models/erebrus.go index 74427a2..a846a13 100644 --- a/models/erebrus.go +++ b/models/erebrus.go @@ -1,12 +1,15 @@ package models +import "time" + type Erebrus struct { - UUID string `gorm:"primary_key" json:"UUID"` - Name string `json:"name"` - WalletAddress string `json:"walletAddress"` - UserId string `json:"userId,omitempty"` - Region string `json:"region"` - NodeId string `json:"nodeId"` - Domain string `json:"domain"` - CollectionId string `json:"collectionId"` + UUID string `gorm:"primary_key" json:"UUID"` + Name string `json:"name"` + WalletAddress string `json:"walletAddress"` + UserId string `json:"userId,omitempty"` + Region string `json:"region"` + NodeId string `json:"nodeId"` + Domain string `json:"domain"` + CollectionId string `json:"collectionId"` + CreatedAt time.Time `json:"created_at"` }