Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use time.Time for timestamp #7

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (suite *GorseClientTestSuite) TearDownSuite() {

func (suite *GorseClientTestSuite) TestFeedback() {
ctx := context.TODO()
timestamp := time.Unix(1660459054, 0).UTC().Format(time.RFC3339)
timestamp := time.Unix(1660459054, 0).UTC()
userId := "800"
insertFeedbackResp, err := suite.client.InsertFeedback(ctx, []Feedback{{
FeedbackType: "like",
Expand Down Expand Up @@ -132,7 +132,7 @@ func (suite *GorseClientTestSuite) TestSessionRecommend() {

feedbackType := "like"
userId := "0"
timestamp := time.Unix(1660459054, 0).UTC().Format(time.RFC3339)
timestamp := time.Unix(1660459054, 0).UTC()
resp, err := suite.client.SessionRecommend(ctx, []Feedback{
{
FeedbackType: feedbackType,
Expand Down Expand Up @@ -235,7 +235,7 @@ func (suite *GorseClientTestSuite) TestUsers() {

func (suite *GorseClientTestSuite) TestItems() {
ctx := context.TODO()
timestamp := time.Unix(1660459054, 0).UTC().Format(time.RFC3339)
timestamp := time.Unix(1660459054, 0).UTC()
item := Item{
ItemId: "100",
IsHidden: true,
Expand Down
20 changes: 10 additions & 10 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package client
import "time"

type Feedback struct {
FeedbackType string `json:"FeedbackType"`
UserId string `json:"UserId"`
ItemId string `json:"ItemId"`
Timestamp string `json:"Timestamp"`
FeedbackType string `json:"FeedbackType"`
UserId string `json:"UserId"`
ItemId string `json:"ItemId"`
Timestamp time.Time `json:"Timestamp"`
}

type ErrorMessage string
Expand Down Expand Up @@ -62,12 +62,12 @@ type ItemIterator struct {
}

type Item struct {
ItemId string `json:"ItemId"`
IsHidden bool `json:"IsHidden"`
Labels any `json:"Labels"`
Categories []string `json:"Categories"`
Timestamp string `json:"Timestamp"`
Comment string `json:"Comment"`
ItemId string `json:"ItemId"`
IsHidden bool `json:"IsHidden"`
Labels any `json:"Labels"`
Categories []string `json:"Categories"`
Timestamp time.Time `json:"Timestamp"`
Comment string `json:"Comment"`
}

type ItemPatch struct {
Expand Down