Skip to content

feat(pixiv): 实现 Pixiv API 客户端及插画获取模型 - #80

Open
xyy0411 wants to merge 6 commits into
FloatTech:mainfrom
xyy0411:pr1-pixiv
Open

xyy0411 wants to merge 6 commits into
FloatTech:mainfrom
xyy0411:pr1-pixiv

Conversation

@xyy0411

@xyy0411 xyy0411 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@xyy0411

xyy0411 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@fumiama 这个workflows是不是有点问题?🤔

@fumiama

fumiama commented Aug 8, 2026

Copy link
Copy Markdown
Member

要升级一下CI用的Go版本。等我闲了搞一下,你也可以自己改改。

Comment thread pixiv/client.go
}

// FetchPixivImage 直接从 Pixiv 下载图片
func (c *Client) FetchPixivImage(illust model.IllustCache, url string) ([]byte, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看笑了,这个illust变量的作用是?

Comment thread pixiv/model/model.go
)

// IllustCache 插画缓存表
type IllustCache struct {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实就是Info,建议改为IllustInfo

Comment thread pixiv/pixiv_api.go
}

// FetchPixivByPID ...
func (p *PixivAPI) FetchPixivByPID(pid int64) (*model.IllustCache, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都是pixiv API了,不必再包含pixiv,其他地方同理。

Comment thread pixiv/pixiv_api.go
}

// GetIllustsByKeyword ...
func (p *PixivAPI) GetIllustsByKeyword(keyword string, limit int, cachedIllust []model.IllustCache, cached []int64) ([]model.IllustCache, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应在此杂糅cached逻辑。可直接传入need几张图片,由调用者判断。

Comment thread pixiv/token.go
)

// TokenStore ...
type TokenStore struct {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议全部通过函数方式获取值,变量全部改为private,这样方便做一些中间处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants