Skip to content

Commit

Permalink
fix timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushikeshnimkar committed Jun 11, 2024
1 parent 99f4a4f commit d37af2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions api/v1/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
19 changes: 11 additions & 8 deletions models/erebrus.go
Original file line number Diff line number Diff line change
@@ -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"`
}

0 comments on commit d37af2a

Please sign in to comment.