user

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CollectionSpecs = map[string]struct {
	Path string
	Key  string
}{
	"actors":    {"/api/v1/users/collected_actors", "actors"},
	"series":    {"/api/v1/users/collected_series", "series"},
	"codes":     {"/api/v1/users/collected_codes", "codes"},
	"makers":    {"/api/v1/users/collected_makers", "makers"},
	"directors": {"/api/v1/users/collected_directors", "directors"},
}

CollectionSpecs maps collection kind → (path, response list key). collected_lists is intentionally omitted (server 500).

Functions

func AllPages

func AllPages(fetch func(page int) ([]map[string]any, error), maxPages int) ([]map[string]any, error)

AllPages aggregates pages until empty, de-duplicating by id.

Types

type UserEndpoint

type UserEndpoint struct {
	// contains filtered or unexported fields
}

UserEndpoint 提供用户 review、标记与收藏 capability。

func NewUser

func NewUser(c *client.Client, movie *movie.MovieEndpoint) *UserEndpoint

NewUser 用共享 transport 与 movie capability 构造 user capability。

func (*UserEndpoint) Collected

func (e *UserEndpoint) Collected(kind string) ([]map[string]any, error)

Collected aggregates all pages of a collection kind.

func (*UserEndpoint) CollectedPage

func (e *UserEndpoint) CollectedPage(kind string, page int) ([]map[string]any, error)

CollectedPage is one page of a user collection kind.

func (*UserEndpoint) Mark

func (e *UserEndpoint) Mark(movieID, status string, score int, content string) (map[string]any, error)

Mark posts POST /api/v1/movies/{id}/reviews. status ∈ watched|want_watch.

func (*UserEndpoint) RecentViewed

func (e *UserEndpoint) RecentViewed() ([]map[string]any, error)

RecentViewed returns GET /api/v1/users/recent_viewed movies (unpaged).

func (*UserEndpoint) ReviewMoviesPage

func (e *UserEndpoint) ReviewMoviesPage(status string, page int) ([]map[string]any, error)

ReviewMoviesPage is one page of GET /api/v2/users/review_movies.

func (*UserEndpoint) Unmark

func (e *UserEndpoint) Unmark(movieID string) (bool, error)

Unmark deletes the user's review for a movie. Returns false if none.

func (*UserEndpoint) WantMovies

func (e *UserEndpoint) WantMovies() ([]map[string]any, error)

WantMovies returns all want_watch (想看) movies.

func (*UserEndpoint) WatchedMovies

func (e *UserEndpoint) WatchedMovies() ([]map[string]any, error)

WatchedMovies returns all watched (看過) movies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL