From 7776d8e5bef2d88ccd42c6e40a61419f04200ed6 Mon Sep 17 00:00:00 2001 From: Ferris Chi Date: Sun, 4 Aug 2024 20:35:07 -0400 Subject: [PATCH] add delete apis --- client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client.go b/client.go index 5ceeab6..5315757 100644 --- a/client.go +++ b/client.go @@ -48,6 +48,14 @@ func (c *GorseClient) ListFeedbacks(ctx context.Context, feedbackType, userId st return request[[]Feedback, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/user/"+userId+"/feedback/"+feedbackType), nil) } +func (c *GorseClient) DeleteFeedback(ctx context.Context, feedbackType, userId, itemId string) (Feedback, error) { + return request[Feedback, any](ctx, c, "DELETE", c.entryPoint+fmt.Sprintf("/api/feedback/%s/%s/%s", feedbackType, userId, itemId), nil) +} + +func (c *GorseClient) DeleteFeedbacks(ctx context.Context, userId, itemId string) ([]Feedback, error) { + return request[[]Feedback, any](ctx, c, "DELETE", c.entryPoint+fmt.Sprintf("/api/feedback/%s/%s", userId, itemId), nil) +} + func (c *GorseClient) GetRecommend(ctx context.Context, userId string, category string, n, offset int) ([]string, error) { return request[[]string, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/recommend/%s/%s?n=%d&offset=%v", userId, category, n, offset), nil) }