Skip to content

Commit c2eb94a

Browse files
authored
Fix gorse go client (#804)
1 parent 09ad3aa commit c2eb94a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

client/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ func (c *GorseClient) ListFeedbacks(ctx context.Context, feedbackType, userId st
5050
func (c *GorseClient) GetRecommend(ctx context.Context, userId string, category string, n int) ([]string, error) {
5151
return request[[]string, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/recommend/%s/%s?n=%d", userId, category, n), nil)
5252
}
53-
53+
func (c *GorseClient) GetRecommendOffSet(ctx context.Context, userId string, category string, n, offset int) ([]string, error) {
54+
return request[[]string, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/recommend/%s/%s?n=%d&offset=%v", userId, category, n, offset), nil)
55+
}
5456
func (c *GorseClient) SessionRecommend(ctx context.Context, feedbacks []Feedback, n int) ([]Score, error) {
5557
return request[[]Score](ctx, c, "POST", c.entryPoint+fmt.Sprintf("/api/session/recommend?n=%d", n), feedbacks)
5658
}

client/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type RowAffected struct {
3434
}
3535

3636
type Score struct {
37-
Id string `json:"Id"`
38-
Score int `json:"Score"`
37+
Id string `json:"Id"`
38+
Score float64 `json:"Score"`
3939
}
4040

4141
type User struct {

0 commit comments

Comments
 (0)