use aliases for ID types
This commit is contained in:
parent
f697e9268f
commit
819221d01d
4
api.go
4
api.go
@ -181,8 +181,8 @@ func (api *Api) getChapterEntriesByPageIndex(ctx context.Context, novelID NovelI
|
|||||||
entryElems.Each(func(i int, s *goquery.Selection) {
|
entryElems.Each(func(i int, s *goquery.Selection) {
|
||||||
td3 := s.Find("td:nth-child(3) a.chp-release")
|
td3 := s.Find("td:nth-child(3) a.chp-release")
|
||||||
|
|
||||||
chapterID := ChapterID(td3.Text())
|
chapterID := td3.Text()
|
||||||
groupID := GroupID(path.Base(s.Find("td:nth-child(2) a").AttrOr("href", "")))
|
groupID := path.Base(s.Find("td:nth-child(2) a").AttrOr("href", ""))
|
||||||
link := "https:" + td3.AttrOr("href", "")
|
link := "https:" + td3.AttrOr("href", "")
|
||||||
|
|
||||||
date, err := time.Parse("01/02/06", strings.TrimSpace(s.Find("td:first-child").Text()))
|
date, err := time.Parse("01/02/06", strings.TrimSpace(s.Find("td:first-child").Text()))
|
||||||
|
8
types.go
8
types.go
@ -5,10 +5,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NovelID string
|
type NovelID = string
|
||||||
type ChapterID string
|
type ChapterID = string
|
||||||
type ReadingListID string
|
type ReadingListID = string
|
||||||
type GroupID string
|
type GroupID = string
|
||||||
|
|
||||||
type ReadingList struct {
|
type ReadingList struct {
|
||||||
ID ReadingListID `json:"id"`
|
ID ReadingListID `json:"id"`
|
||||||
|
Loading…
Reference in New Issue
Block a user