Documentation ¶
Index ¶
- Constants
- Variables
- func ParseCookies(cookie string, v interface{}) (err error)
- type Article
- type ArticleBase
- type ArticleComment
- type ArticleCommentList
- type ArticleDetail
- type ArticleInfo
- type ArticleIntro
- type ArticleList
- type ArticlePoint
- type Audio
- type AudioDetail
- type AudioList
- type Catelog
- type Chapter
- type CheckLoginResp
- type ClassInfo
- type Content
- type Contents
- type CookieOptions
- type Course
- type CourseCategory
- type CourseCategoryList
- type CourseInfo
- type CourseIntro
- type CourseList
- type EbookBlock
- type EbookDetail
- type EbookInfo
- type EbookInfoPage
- type EbookOrders
- type EbookPage
- type EbookToc
- type EbookVIPInfo
- type FlatArticleList
- type MediaBaseInfo
- type NoteBaseSource
- type NoteCount
- type NoteDetail
- type NoteFPart
- type NotesList
- type OdobVipUser
- type Press
- type QrCodeResp
- type ReplierInfo
- type Response
- type Service
- func (s *Service) ArticleCommentList(id, sort string, page, limit int) (list *ArticleCommentList, err error)
- func (s *Service) ArticleDetail(token, id, appID string) (detail *ArticleDetail, err error)
- func (s *Service) ArticleInfo(enid string, aType int) (info *ArticleInfo, err error)
- func (s *Service) ArticleList(id, chapterID string, maxID int) (list *ArticleList, err error)
- func (s *Service) ArticlePoint(id, pType string) (detail *ArticleDetail, err error)
- func (s *Service) AudioByAlias(ID string) (list *AudioList, err error)
- func (s *Service) AudioDetailAlias(ID string) (detail *Audio, err error)
- func (s *Service) CheckLogin(token, qrcode string) (check *CheckLoginResp, cookie string, err error)
- func (s *Service) CourseCount(category string) (count int, err error)
- func (s *Service) CourseDetail(category string, id int) (detail *Course, err error)
- func (s *Service) CourseInfo(enid string) (info *CourseInfo, err error)
- func (s *Service) CourseList(category, order string, page, limit int) (list *CourseList, err error)
- func (s *Service) CourseListAll(category, order string) (list *CourseList, err error)
- func (s *Service) CourseType() (list *CourseCategoryList, err error)
- func (s *Service) EbookDetail(enid string) (detail *EbookDetail, err error)
- func (s *Service) EbookInfo(token string) (info *EbookInfo, err error)
- func (s *Service) EbookPages(chapterID, token string, index, count, offset int) (pages *EbookPage, err error)
- func (s *Service) EbookReadToken(enid string) (t *Token, err error)
- func (s *Service) EbookVIPInfo() (info *EbookVIPInfo, err error)
- func (s *Service) GetQrcode(token string) (resp *QrCodeResp, err error)
- func (s *Service) LoginAccessToken() (token string, err error)
- func (s *Service) Token() (t *Token, err error)
- func (s *Service) TopicAll(page, limit int, all bool) (list *TopicAll, err error)
- func (s *Service) TopicDetail(id string) (detail *TopicDetail, err error)
- func (s *Service) TopicNotesList(id string) (list *NotesList, err error)
- func (s *Service) User() (user *User, err error)
- type Token
- type TopicAll
- type TopicDetail
- type TopicIntro
- type TopicPresenter
- type TopicTopArea
- type User
- type VIPUser
- type Video
Constants ¶
const ( // CateCourse 课程 CateCourse = "bauhinia" // CateAudioBook 听书 CateAudioBook = "odob" // CateEbook 电子书 CateEbook = "ebook" // CateAce 锦囊 CateAce = "compass" // CatAll 全部 CatAll = "all" )
Variables ¶
var (
UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
)
Functions ¶
func ParseCookies ¶
ParseCookies parse cookie string to cookie options
Types ¶
type Article ¶
type Article struct { ID int64 `json:"Id"` AppID int `json:"AppId"` Version int `json:"Version"` CreateTime int `json:"CreateTime"` UpdateTime int `json:"UpdateTime"` PublishTime int `json:"PublishTime"` Status int `json:"Status"` IDStr string `json:"IdStr"` AppIDStr string `json:"AppIdStr"` }
Article metadata
type ArticleBase ¶
type ArticleBase struct { ID int `json:"id"` IDStr string `json:"id_str"` Enid string `json:"enid"` ClassEnid string `json:"class_enid"` OriginID int `json:"origin_id"` OriginIDStr string `json:"origin_id_str"` ProductType int `json:"product_type"` ProductID int `json:"product_id"` ProductIDStr string `json:"product_id_str"` ClassID int `json:"class_id"` ClassIDStr string `json:"class_id_str"` ChapterID int `json:"chapter_id"` ChapterIDStr string `json:"chapter_id_str"` Title string `json:"title"` Logo string `json:"logo"` URL string `json:"url"` Summary string `json:"summary"` Mold int `json:"mold"` PushContent string `json:"push_content"` PublishTime int `json:"publish_time"` PushTime int `json:"push_time"` PushStatus int `json:"push_status"` DdArticleID int64 `json:"dd_article_id"` DdArticleIDStr string `json:"dd_article_id_str"` DdArticleToken string `json:"dd_article_token"` Status int `json:"status"` CreateTime int `json:"create_time"` UpdateTime int `json:"update_time"` CurLearnCount int `json:"cur_learn_count"` IsFreeTry bool `json:"is_free_try"` IsUserFreeTry bool `json:"is_user_free_try"` OrderNum int `json:"order_num"` IsLike bool `json:"is_like"` IsRead bool `json:"is_read"` LogID string `json:"log_id"` LogType string `json:"log_type"` RecommendTitle string `json:"recommend_title"` AudioAliasIds []string `json:"audio_alias_ids"` IsBuy bool `json:"is_buy"` DdMediaID int `json:"dd_media_id"` DdMediaIDStr string `json:"dd_media_id_str"` VideoStatus int `json:"video_status"` // 1-video DdLiveID int `json:"dd_live_id"` NotJoinPlan int `json:"not_join_plan"` }
ArticleBase article base info
type ArticleComment ¶ added in v1.0.9
type ArticleComment struct { NoteId int `json:"note_id"` NoteIdStr string `json:"note_id_str"` NoteIdHazy string `json:"note_id_hazy"` OriginContentType int `json:"origin_content_type"` OriginNoteIdStr string `json:"origin_note_id_str"` OriginNoteIdHazy string `json:"origin_note_id_hazy"` RootContentType int `json:"root_content_type"` RootNoteId int `json:"root_note_id"` RootNoteIdStr string `json:"root_note_id_str"` RootNoteIdHazy string `json:"root_note_id_hazy"` Uid int `json:"uid"` UidHazy string `json:"uid_hazy"` IsFromMe int `json:"is_from_me"` NotesOwner struct { Id string `json:"id"` Uid int `json:"uid"` Name string `json:"name"` Avatar string `json:"avatar"` Follow int `json:"follow"` IsV int `json:"isV"` Slogan string `json:"slogan"` Vinfo string `json:"Vinfo"` StudentId int `json:"student_id"` IsPoster bool `json:"is_poster"` Qrcode string `json:"qrcode"` LogType string `json:"log_type"` UidHazy string `json:"uid_hazy"` NoteIdHazy string `json:"note_id_hazy"` } `json:"notes_owner"` OriginNotesOwner struct { Id string `json:"id"` Uid int `json:"uid"` Name string `json:"name"` Avatar string `json:"avatar"` Follow int `json:"follow"` IsV int `json:"isV"` Slogan string `json:"slogan"` Vinfo string `json:"Vinfo"` StudentId int `json:"student_id"` IsPoster bool `json:"is_poster"` Qrcode string `json:"qrcode"` UidHazy string `json:"uid_hazy"` NoteIdHazy string `json:"note_id_hazy"` } `json:"origin_notes_owner"` RootNotesOwner struct { Id string `json:"id"` Uid int `json:"uid"` Name string `json:"name"` Avatar string `json:"avatar"` Follow int `json:"follow"` IsV int `json:"isV"` Slogan string `json:"slogan"` Vinfo string `json:"Vinfo"` StudentId int `json:"student_id"` IsPoster bool `json:"is_poster"` Qrcode string `json:"qrcode"` UidHazy string `json:"uid_hazy"` NoteIdHazy string `json:"note_id_hazy"` } `json:"root_notes_owner"` NoteType int `json:"note_type"` SourceType int `json:"source_type"` DetailId int `json:"detail_id"` Class int `json:"class"` ContentType int `json:"content_type"` State int `json:"state"` CurrentState int `json:"current_state"` AuditState int `json:"audit_state"` OriginState int `json:"origin_state"` OriginAuditState int `json:"origin_audit_state"` RootState int `json:"root_state"` RootAuditState int `json:"root_audit_state"` Note string `json:"note"` Content string `json:"content"` NoteTitle string `json:"note_title"` NoteLine string `json:"note_line"` NoteLineStyle string `json:"note_line_style"` CommentReplyTime int `json:"comment_reply_time"` CommentReply string `json:"comment_reply"` CommentIdStr string `json:"comment_id_str"` CommentReplyUser struct { Id string `json:"id"` Uid int `json:"uid"` Name string `json:"name"` Avatar string `json:"avatar"` Follow int `json:"follow"` IsV int `json:"isV"` Slogan string `json:"slogan"` Vinfo string `json:"Vinfo"` StudentId int `json:"student_id"` IsPoster bool `json:"is_poster"` Qrcode string `json:"qrcode"` LogId string `json:"log_id"` LogType string `json:"log_type"` UidHazy string `json:"uid_hazy"` NoteIdHazy string `json:"note_id_hazy"` Role string `json:"role"` } `json:"comment_reply_user"` RepostCommentNoteIdStr string `json:"repost_comment_note_id_str"` RepostCommentNoteIdHazy string `json:"repost_comment_note_id_hazy"` RefId int `json:"ref_id"` CreateTime int `json:"create_time"` UpdateTime int `json:"update_time"` Ptype int `json:"ptype"` PidHazy string `json:"pid_hazy"` Lesson struct { Ptype int `json:"ptype"` PidHazy string `json:"pid_hazy"` } `json:"lesson"` Extra struct { Title string `json:"title"` SubTitle string `json:"sub_title"` SourceType int `json:"source_type"` SourceTitle string `json:"source_title"` Img string `json:"img"` SourceSubTitle string `json:"source_sub_title"` AuthorName string `json:"author_name"` ShareUrl string `json:"share_url"` ColumnTitle string `json:"column_title"` ColumnIntro string `json:"column_intro"` ArticleTitle string `json:"article_title"` ViewType int `json:"view_type"` AudioIdAlias string `json:"audio_id_alias"` BookIsOldVersion int `json:"book_is_old_version"` Images []interface{} `json:"images"` ImagesSuffix []interface{} `json:"images_suffix"` ResourceIcon string `json:"resource_icon"` LogId string `json:"log_id"` LogType string `json:"log_type"` OldClassType int `json:"OldClassType"` OldClassID int `json:"OldClassID"` BookShelfStatus int `json:"book_shelf_status"` } `json:"extra"` Ddurl struct { NeedVisitorPopLoginView bool `json:"needVisitorPopLoginView"` NeedCheckBuy bool `json:"needCheckBuy"` Url1 string `json:"url1"` Url2 string `json:"url2"` } `json:"ddurl"` NotesCount struct { RepostCount int `json:"repost_count"` CommentCount int `json:"comment_count"` LikeCount int `json:"like_count"` } `json:"notes_count"` IsReposted bool `json:"is_reposted"` IsLike bool `json:"is_like"` IsUpmost bool `json:"is_upmost"` Tags []interface{} `json:"tags"` UserExpectStatus int `json:"user_expect_status"` Switch struct { ImgOrigin bool `json:"img_origin"` } `json:"switch"` CanEdit bool `json:"can_edit"` IsPermission bool `json:"is_permission"` IsOpenLedgers bool `json:"is_open_ledgers"` AttachmentType int `json:"attachment_type"` Video struct { VideoId int `json:"video_id"` VideoRst string `json:"video_rst"` VideoCover string `json:"video_cover"` VideoDuration int `json:"video_duration"` VideoDurationLabel string `json:"video_duration_label"` VideoWidth int `json:"video_width"` VideoHeight int `json:"video_height"` VideoState int `json:"video_state"` ViewCount int `json:"view_count"` } `json:"video"` LogId string `json:"log_id"` LogType string `json:"log_type"` LevelType int `json:"level_type"` Level int `json:"level"` LevelPermission bool `json:"level_permission"` Highlights []interface{} `json:"highlights"` RootHighlights []interface{} `json:"root_highlights"` }
ArticleComment 文章留言
type ArticleCommentList ¶ added in v1.0.9
type ArticleCommentList struct { List []ArticleComment `json:"list"` Total int `json:"total"` IsMore int `json:"is_more"` }
type ArticleDetail ¶
ArticleDetail article content GET query params token,sign,appid
type ArticleInfo ¶
type ArticleInfo struct { ClassID int `json:"class_id"` ClassEnid string `json:"class_enid"` Ptype int `json:"ptype"` Pid int `json:"pid"` ArticleID int `json:"article_id"` OriginArticleID int `json:"origin_article_id"` DdArticleID int64 `json:"dd_article_id"` DdArticleToken string `json:"dd_article_token"` LikeNum int `json:"like_num"` IsLike bool `json:"is_like"` IsBuy int `json:"is_buy"` IsFreeTry bool `json:"is_free_try"` IsUserFreeTry bool `json:"is_user_free_try"` PrevArticleID int `json:"prev_article_id"` PrevArticleEnid string `json:"prev_article_enid"` NextArticleID int `json:"next_article_id"` NextArticleEnid string `json:"next_article_enid"` ArticleInfo ArticleIntro `json:"article_info"` ClassInfo ClassInfo `json:"class_info"` Extra string `json:"extra"` TrialReadCount int `json:"trial_read_count"` TrialMaxReadCount int `json:"trial_max_read_count"` ArticleTitle string `json:"article_title"` ClassTitle string `json:"class_title"` PaymentAudioID int `json:"payment_audio_id"` ResourceID int `json:"resource_id"` ResourceType int `json:"resource_type"` Audio Audio `json:"audio"` }
ArticleInfo article info
type ArticleIntro ¶
type ArticleIntro struct { ArticleBase MediaBaseInfo []MediaBaseInfo `json:"media_base_info"` Audio *Audio `json:"audio,omitempty"` Video *[]Video `json:"video,omitempty"` }
ArticleIntro article introduce
type ArticleList ¶
type ArticleList struct { List []ArticleIntro `json:"article_list"` ClassID int `json:"class_id"` Ptype int `json:"ptype"` PID int `json:"pid"` Reverse bool `json:"reverse"` ChapterIDStr string `json:"chapter_id"` MaxID int `json:"max_id"` }
ArticleList class article list
type ArticlePoint ¶
type ArticlePoint struct { HasArticlePoint int `json:"has_article_point"` Content string `json:"content"` }
ArticlePoint article point note
type Audio ¶
type Audio struct { AliasID string `json:"alias_id"` Extrainfo string `json:"extrainfo"` ClassID int `json:"class_id"` Title string `json:"title"` Mp3PlayURL string `json:"mp3_play_url"` Duration int `json:"duration"` Schedule int `json:"schedule"` TopicID int `json:"topic_id"` Summary string `json:"summary"` Price int `json:"price"` Icon string `json:"icon"` Size int `json:"size"` Etag string `json:"etag"` Token string `json:"token"` Collection int `json:"collection"` Count int `json:"count"` BoredCount int `json:"bored_count"` AudioType int `json:"audio_type"` DrmVersion int `json:"drm_version"` SourceID int `json:"source_id"` SourceType int `json:"source_type"` SourceIcon string `json:"source_icon"` SourceName string `json:"source_name"` ListenProgress float64 `json:"listen_progress"` ListenFinished bool `json:"listen_finished"` DdArticleID string `json:"dd_article_id"` AudioListIcon string `json:"audio_list_icon"` ClassCourseID string `json:"class_course_id"` ClassArticleID string `json:"class_article_id"` LogID string `json:"log_id"` LogType string `json:"log_type"` LogInterface string `json:"log_interface"` Trackinfo string `json:"trackinfo"` UsedDrm int `json:"used_drm"` IndexImg string `json:"index_img"` Reader string `json:"reader"` ReaderName string `json:"reader_name"` OdobGroupEnid string `json:"odob_group_enid"` }
Audio audio
type AudioDetail ¶ added in v1.2.4
type AudioDetail struct {
Detail Audio `json:"audio_detail"`
}
type AudioList ¶
type AudioList struct {
List []Audio `json:"list"`
}
AudioList audio basic info list
type Catelog ¶
type Catelog struct { Level int `json:"level"` Text string `json:"text"` Href string `json:"href"` PlayOrder int `json:"playOrder"` }
Catelog ebook catalog
type Chapter ¶
type Chapter struct { ID int `json:"id"` IDStr string `json:"id_str"` ClassID int `json:"class_id"` ClassIDStr string `json:"class_id_str"` OrderName string `json:"order_name"` Name string `json:"name"` Intro string `json:"intro"` PhaseNum int `json:"phase_num"` Status int `json:"status"` OrderNum int `json:"order_num"` IsFinished int `json:"is_finished"` UpdateTime int `json:"update_time"` LogID string `json:"log_id"` LogType string `json:"log_type"` ArticleList []ArticleBase `json:"article_list"` }
Chapter metadata
type CheckLoginResp ¶ added in v1.0.11
type ClassInfo ¶
type ClassInfo struct { LogID string `json:"log_id"` LogType string `json:"log_type"` ID int `json:"id"` IDStr string `json:"id_str"` Enid string `json:"enid"` ProductID int `json:"product_id"` ProductType int `json:"product_type"` HasChapter int `json:"has_chapter"` Name string `json:"name"` Intro string `json:"intro"` PhaseNum int `json:"phase_num"` LearnUserCount int `json:"learn_user_count"` CurrentArticleCount int `json:"current_article_count"` Highlight string `json:"highlight"` Price int `json:"price"` IndexImg string `json:"index_img"` IndexImgApplet string `json:"index_img_applet"` Logo string `json:"logo"` LogoIphonex string `json:"logo_iphonex"` SquareImg string `json:"square_img"` OutlineImg string `json:"outline_img"` PlayerImg string `json:"player_img"` Status int `json:"status"` OrderNum int `json:"order_num"` ShzfURL string `json:"shzf_url"` ShzfURLQr string `json:"shzf_url_qr"` PriceDesc string `json:"price_desc"` ArticleTime int `json:"article_time"` ArticleTitle string `json:"article_title"` IsSubscribe int `json:"is_subscribe"` LecturerUID int `json:"lecturer_uid"` LecturerName string `json:"lecturer_name"` LecturerTitle string `json:"lecturer_title"` LecturerIntro string `json:"lecturer_intro"` LecturerNameAndTitle string `json:"lecturer_name_and_title"` LecturerAvatar string `json:"lecturer_avatar"` IsFinished int `json:"is_finished"` UpdateTime int `json:"update_time"` DefaultSortReverse bool `json:"default_sort_reverse"` PresaleURL string `json:"presale_url"` WithoutAudio bool `json:"without_audio"` ViewType int `json:"view_type"` H5URLName string `json:"h5_url_name"` PackageManagerSwitch bool `json:"package_manager_switch"` LectureAvatorSpecial string `json:"lecture_avator_special"` EstimatedShelfTime int `json:"estimated_shelf_time"` EstimatedDownTime int `json:"estimated_down_time"` CornerImg string `json:"corner_img"` CornerImgVertical string `json:"corner_img_vertical"` WithoutGiving bool `json:"without_giving"` DdURL string `json:"dd_url"` PublishTime int `json:"publish_time"` DdMediaID string `json:"dd_media_id"` VideoCover string `json:"video_cover"` IsInVip bool `json:"is_in_vip"` IsVip bool `json:"is_vip"` Collection struct { IsCollected bool `json:"is_collected"` CollectionCount int `json:"collection_count"` } `json:"collection"` FormalArticleCount int `json:"formal_article_count"` VideoClass int `json:"video_class"` VideoClassIntro string `json:"video_class_intro"` ActivityIcon string `json:"activity_icon"` ActivityTitle string `json:"activity_title"` ActivityURL string `json:"activity_url"` RealityExtraCount int `json:"reality_extra_count"` RealityFormalCount int `json:"reality_formal_count"` IntroArticleIds []int `json:"intro_article_ids"` IsPreferential int `json:"is_preferential"` IsCountDown int `json:"is_count_down"` PreferentialStartTime int `json:"preferential_start_time"` PreferentialEndTime int `json:"preferential_end_time"` EarlyBirdPrice int `json:"early_bird_price"` TrialCount int `json:"trial_count"` }
ClassInfo class info
type Content ¶
type Content struct { Aid string `json:"aid"` AliasID string `json:"aliasId"` Contents interface{} `json:"contents"` Desc string `json:"desc"` Duration interface{} `json:"duration"` // string or int64 Height int64 `json:"height"` Jump string `json:"jump"` Justify string `json:"justify"` Legend string `json:"legend"` Level int `json:"level"` Size int64 `json:"size"` Text string `json:"text"` Title string `json:"title"` Type string `json:"type"` Ordered bool `json:"ordered"` URL string `json:"url"` Width int64 `json:"width"` Labels []string `json:"labels"` }
Content article Content
type CookieOptions ¶
type CookieOptions struct { GAT string `json:"gat"` ISID string `json:"isid"` Iget string `json:"iget"` Token string `json:"token"` GuardDeviceID string `json:"_guard_device_id" mapstructure:"_guard_device_id"` SID string `json:"_sid" mapstructure:"_sid"` AcwTc string `json:"acw_tc" mapstructure:"acw_tc"` AliyungfTc string `json:"aliyungf_tc"` CookieStr string `json:"cookieStr"` }
CookieOptions dedao cookie options
type Course ¶
type Course struct { Enid string `json:"enid"` ID int `json:"id"` Type int `json:"type"` ClassType int `json:"class_type"` ClassID int `json:"class_id"` HasExtra bool `json:"has_extra"` ClassFinished bool `json:"class_finished"` Title string `json:"title"` Intro string `json:"intro"` Author string `json:"author"` Icon string `json:"icon"` CreateTime int `json:"create_time"` LastRead string `json:"last_read"` Progress int `json:"progress"` Duration int `json:"duration"` CourseNum int `json:"course_num"` PublishNum int `json:"publish_num"` LogID string `json:"log_id"` LogType string `json:"log_type"` IsTop int `json:"is_top"` LastActionTime int `json:"last_action_time"` IsNew int `json:"is_new"` IsFinished int `json:"is_finished"` Size string `json:"size"` DdURL string `json:"dd_url"` AssetsType int `json:"assets_type"` DrmToken string `json:"drm_token"` AudioDetail Audio `json:"audio_detail"` ProductPrice int `json:"product_price"` Price string `json:"price"` ProductIntro string `json:"product_intro"` HasPlayAuth bool `json:"has_play_auth"` ExtInfo []ReplierInfo `json:"ext_info"` Status int `json:"status"` DdExtURL string `json:"dd_ext_url"` IsCollected bool `json:"is_collected"` WendaExtInfo struct { AnswerID int `json:"answer_id"` } `json:"wenda_ext_info"` }
Course metadata
func EnlightenClub ¶ added in v1.0.2
func EnlightenClub() (detail Course)
type CourseCategory ¶
type CourseCategory struct { Name string `json:"name"` Count int `json:"count"` Category string `json:"category"` }
CourseCategory course category metadata
type CourseCategoryList ¶
type CourseCategoryList struct { Data struct { List []CourseCategory `json:"list"` IsShowURL bool `json:"is_show_url"` PCURL string `json:"pc_url"` } `json:"data"` }
CourseCategoryList course type list
type CourseInfo ¶
type CourseInfo struct { ClassInfo ClassInfo `json:"class_info"` Items []CourseIntro `json:"items"` ArticleIntro ArticleIntro `json:"intro_article"` ChapterList []Chapter `json:"chapter_list"` FlatArticleList []ArticleBase `json:"flat_article_list"` UserType string `json:"user_type"` HasMoreFlatArticleList bool `json:"has_more_flat_article_list"` IsShowGrading bool `json:"is_show_grading"` }
CourseInfo product intro info
type CourseIntro ¶
type CourseIntro struct { Type int `json:"type"` Title string `json:"title"` Content string `json:"content"` }
CourseIntro course introduce
type CourseList ¶
type CourseList struct { List []Course `json:"list"` ISMore int `json:"is_more"` Page int `json:"page"` }
CourseList product list
type EbookBlock ¶
type EbookBlock struct { ChapterID string `json:"chapterId"` SectionID string `json:"sectionID"` EndOffset int `json:"endOffset"` StartOffset int `json:"startOffset"` }
EbookBlock ebook block
type EbookDetail ¶
type EbookDetail struct { ID int `json:"id"` Title string `json:"title"` Style int `json:"style"` Cover string `json:"cover"` Count int `json:"count"` Price string `json:"price"` Status int `json:"status"` OperatingTitle string `json:"operating_title"` AuthorInfo string `json:"author_info"` BookAuthor string `json:"book_author"` PublishTime string `json:"publish_time"` CatalogList []Catelog `json:"catalog_list"` BookIntro string `json:"book_intro"` BSpecialPrice string `json:"b_special_price"` CurrentPrice string `json:"current_price"` IsBuy bool `json:"is_buy"` IsTrial bool `json:"is_trial"` IsTtsSwitch bool `json:"is_tts_switch"` LogID string `json:"log_id"` LogType string `json:"log_type"` OriginalPrice string `json:"original_price"` AuthorList []string `json:"author_list"` CanTrialRead bool `json:"can_trial_read"` TrialReadProportion string `json:"trial_read_proportion"` WithVideo bool `json:"with_video"` Enid string `json:"enid"` BOverseasPurchase int `json:"b_overseas_purchase"` RankName string `json:"rank_name"` RankNum int `json:"rank_num"` IsVipBook int `json:"is_vip_book"` IsOnBookshelf bool `json:"is_on_bookshelf"` ProductScore string `json:"product_score"` ReadTime int `json:"read_time"` ReadNumber []interface{} `json:"read_number"` Press Press `json:"press"` DoubanScore string `json:"douban_score"` ClassifyName string `json:"classify_name"` ClassifyID int `json:"classify_id"` AddStudylistDdURL string `json:"add_studylist_dd_url"` }
EbookDetail ebook detail
type EbookInfo ¶
type EbookInfo struct { BookInfo struct { EbookBlock [][]EbookBlock `json:"block"` Orders []EbookOrders `json:"orders"` Toc []utils.EbookToc `json:"toc"` Pages []EbookInfoPage `json:"pages"` } `json:"bookInfo"` }
EbookInfo ebook info
type EbookInfoPage ¶ added in v1.1.0
type EbookOrders ¶
type EbookOrders struct { ChapterID string `json:"chapterId"` PathInEpub string `json:"pathInEpub"` }
EbookOrders ebook orders
type EbookPage ¶ added in v1.1.0
type EbookPage struct { IsEnd bool `json:"is_end"` Pages []struct { BeginOffset int64 `json:"begin_offset"` EndOffset int64 `json:"end_offset"` IsFirst bool `json:"is_first"` IsLast bool `json:"is_last"` Svg string `json:"svg"` ViewHeighToChapterTop int64 `json:"view_heigh_to_chapter_top"` } `json:"pages"` }
type EbookToc ¶
type EbookToc struct { Href string `json:"href"` Level int `json:"level"` PlayOrder int `json:"playOrder"` Offset int `json:"offset"` Text string `json:"text"` }
EbookToc ebook toc
type EbookVIPInfo ¶
type EbookVIPInfo struct { UID int `json:"uid"` Nickname string `json:"nickname"` Slogan string `json:"slogan"` Avatar string `json:"avatar"` AvatarS string `json:"avatar_s"` MonthCount int `json:"month_count"` TotalCount int `json:"total_count"` FinishedCount int `json:"finished_count"` SavePrice string `json:"save_price"` IsVip bool `json:"is_vip"` BeginTime int `json:"begin_time"` EndTime int `json:"end_time"` EnterpriseEndTime int `json:"enterprise_end_time"` ExpireTime int `json:"expire_time"` SurplusTime int `json:"surplus_time"` IsExpire bool `json:"is_expire"` CardID int `json:"card_id"` CardType int `json:"card_type"` PriceDesc string `json:"price_desc"` IsBuyMonthDiscount bool `json:"is_buy_month_discount"` MonthDiscountPrice int `json:"month_discount_price"` DdURL string `json:"dd_url"` ErrTips string `json:"err_tips"` }
EbookVIPInfo ebook vip info
type FlatArticleList ¶
type FlatArticleList struct { ID int `json:"id"` IDStr string `json:"id_str"` Enid string `json:"enid"` ClassEnid string `json:"class_enid"` OriginID int `json:"origin_id"` OriginIDStr string `json:"origin_id_str"` ProductType int `json:"product_type"` ProductID int `json:"product_id"` ProductIDStr string `json:"product_id_str"` ClassID int `json:"class_id"` ClassIDStr string `json:"class_id_str"` ChapterID int `json:"chapter_id"` ChapterIDStr string `json:"chapter_id_str"` Title string `json:"title"` Logo string `json:"logo"` URL string `json:"url"` Summary string `json:"summary"` Mold int `json:"mold"` PushContent string `json:"push_content"` PublishTime int `json:"publish_time"` PushTime int `json:"push_time"` PushStatus int `json:"push_status"` DdArticleID int64 `json:"dd_article_id"` DdArticleIDStr string `json:"dd_article_id_str"` DdArticleToken string `json:"dd_article_token"` Status int `json:"status"` CreateTime int `json:"create_time"` UpdateTime int `json:"update_time"` CurLearnCount int `json:"cur_learn_count"` IsFreeTry bool `json:"is_free_try"` IsUserFreeTry bool `json:"is_user_free_try"` OrderNum int `json:"order_num"` IsLike bool `json:"is_like"` IsRead bool `json:"is_read"` LogID string `json:"log_id"` LogType string `json:"log_type"` RecommendTitle string `json:"recommend_title"` AudioAliasIds []interface{} `json:"audio_alias_ids"` IsBuy bool `json:"is_buy"` DdMediaID int `json:"dd_media_id"` DdMediaIDStr string `json:"dd_media_id_str"` VideoStatus int `json:"video_status"` DdLiveID int `json:"dd_live_id"` NotJoinPlan int `json:"not_join_plan"` }
FlatArticleList flat
type MediaBaseInfo ¶
type MediaBaseInfo struct { MediaType int `json:"media_type"` // 1-audio,2-video SourceID string `json:"source_id"` SecurityToken string `json:"security_token"` }
MediaBaseInfo media info
type NoteBaseSource ¶
type NoteBaseSource struct { Title string `json:"title"` SubTitle string `json:"sub_title"` Img string `json:"img"` PType int `json:"p_type"` PidStr string `json:"pid_str"` IsPopLoginView bool `json:"is_pop_login_view"` NeedCheckBuy bool `json:"need_check_buy"` URL1 string `json:"url1"` URL2 string `json:"url2"` }
NoteBaseSource Note BaseSource
type NoteCount ¶
type NoteCount struct { RepostCount int `json:"repost_count"` CommentCount int `json:"comment_count"` LikeCount int `json:"like_count"` }
NoteCount note count
type NoteDetail ¶
type NoteDetail struct { DetailTitle string `json:"detail_title"` Comb interface{} `json:"comb"` State int `json:"state"` IsMine bool `json:"is_mine"` IsReposted bool `json:"is_reposted"` IsLike bool `json:"is_like"` OwnUIDHazy string `json:"own_uid_hazy"` Topic struct { TopicID int `json:"topic_id"` TopicIDHazy string `json:"topic_id_hazy"` IsElected bool `json:"is_elected"` IsTopmost bool `json:"is_topmost"` TopicName string `json:"topic_name"` } `json:"topic"` Tags []interface{} `json:"tags"` Folders interface{} `json:"folders"` NoteCount NoteCount `json:"note_count"` FPart NoteFPart `json:"f_part"` SPart interface{} `json:"s_part"` Class int `json:"class"` Level int `json:"level"` LevelType int `json:"level_type"` LevelPermission bool `json:"level_permission"` }
NoteDetail note detail
type NoteFPart ¶
type NoteFPart struct { UID int `json:"uid"` UIDHazy string `json:"uid_hazy"` NickName string `json:"nick_name"` Avatar string `json:"avatar"` Follow int `json:"follow"` IsV int `json:"is_v"` Slogan string `json:"slogan"` VInfo string `json:"v_info"` StudentID int `json:"student_id"` StudentIDHazy string `json:"student_id_hazy"` IsPoster bool `json:"is_poster"` QrCode string `json:"qr_code"` Note string `json:"note"` TimeDesc string `json:"time_desc"` NoteTitle string `json:"note_title"` NoteScore string `json:"note_score"` NoteLine string `json:"note_line"` NoteID string `json:"note_id"` NoteIDHazy string `json:"note_id_hazy"` Tip string `json:"tip"` Images []interface{} `json:"images"` BaseSource NoteBaseSource `json:"base_source"` }
NoteFPart Note FPart
type NotesList ¶
type NotesList struct { HasMore bool `json:"has_more"` List []interface{} `json:"list"` NoteDetailList []NoteDetail `json:"note_detail_list"` PresenterUID []interface{} `json:"presenter_uid"` PresenterUIDHazy []string `json:"presenter_uid_hazy"` }
NotesList topic NotesList
type OdobVipUser ¶ added in v1.1.0
type OdobVipUser struct { Card []struct { AvailableBuy bool `json:"available_buy"` CanGift int `json:"can_gift"` CardType int `json:"card_type"` ContractTemplate string `json:"contract_template"` Cover string `json:"cover"` CreatedAt string `json:"created_at"` Days int `json:"days"` Description string `json:"description"` Device string `json:"device"` DiscountTip string `json:"discount_tip"` Displayed int `json:"displayed"` FirstMonthPrice string `json:"first_month_price"` ID int `json:"id"` IosSwitch bool `json:"ios_switch"` IsFirstSubscribe bool `json:"is_first_subscribe"` IsSubscribed int `json:"is_subscribed"` MaxNum int `json:"max_num"` Name string `json:"name"` OriginPrice string `json:"origin_price"` Price string `json:"price"` PriceDesc string `json:"price_desc"` Ptype int64 `json:"ptype"` Rights []struct { Name string `json:"name"` Right bool `json:"right"` } `json:"rights"` Selected int `json:"selected"` Sku string `json:"sku"` SortNo int `json:"sort_no"` Status int `json:"status"` StyleType int `json:"style_type"` SubscribeDesc string `json:"subscribe_desc"` SubscribedFlag string `json:"subscribed_flag"` Type int `json:"type"` UpdatedAt string `json:"updated_at"` UsedCardCount int `json:"used_card_count"` UserMaxBuyCount int `json:"user_max_buy_count"` WelfareInfo string `json:"welfare_info"` } `json:"card"` User struct { Avatar string `json:"avatar"` AvatarS string `json:"avatar_s"` BeginTime int `json:"begin_time"` CanGivenCount int `json:"can_given_count"` CardID int `json:"card_id"` DdURL string `json:"dd_url"` EndTime int64 `json:"end_time"` EnterpriseEndTime int `json:"enterprise_end_time"` ErrTips string `json:"err_tips"` ExpireTime int `json:"expire_time"` GivenCardCount int `json:"given_card_count"` IsExpire bool `json:"is_expire"` IsVip bool `json:"is_vip"` Nickname string `json:"nickname"` PriceDesc string `json:"price_desc"` SavePrice string `json:"save_price"` Slogan string `json:"slogan"` SurplusTime int64 `json:"surplus_time"` TotalCount int `json:"total_count"` UID int `json:"uid"` VStateValue int `json:"v_state_value"` WeekCount int `json:"week_count"` } }
type QrCodeResp ¶ added in v1.1.2
type ReplierInfo ¶
type ReplierInfo struct { ReplierUID int `json:"replier_uid"` ReplierName string `json:"replier_name"` ReplierImg string `json:"replier_img"` ReplierIntro string `json:"replier_intro"` ReplierVStatus bool `json:"replier_v_status"` ReplierVStateValue int `json:"replier_v_state_value"` ReplierTitle string `json:"replier_title"` }
ReplierInfo Replier Info
type Response ¶
type Response struct { H respH `json:"h"` C respC `json:"c"` }
Response dedao success response
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service dedao service
func (*Service) ArticleCommentList ¶ added in v1.0.9
func (s *Service) ArticleCommentList(id, sort string, page, limit int) (list *ArticleCommentList, err error)
ArticleCommentList get article comment list
func (*Service) ArticleDetail ¶
func (s *Service) ArticleDetail(token, id, appID string) (detail *ArticleDetail, err error)
ArticleDetail get article detail
func (*Service) ArticleInfo ¶
func (s *Service) ArticleInfo(enid string, aType int) (info *ArticleInfo, err error)
ArticleInfo get article info enid article enid, aType 1-course article, 2-odob article
func (*Service) ArticleList ¶
func (s *Service) ArticleList(id, chapterID string, maxID int) (list *ArticleList, err error)
ArticleList get class article list
func (*Service) ArticlePoint ¶
func (s *Service) ArticlePoint(id, pType string) (detail *ArticleDetail, err error)
ArticlePoint get article point
func (*Service) AudioByAlias ¶
AudioByAlias get article audio info
func (*Service) AudioDetailAlias ¶ added in v1.2.4
AudioDetailAlias get odob audio info
func (*Service) CheckLogin ¶ added in v1.0.11
func (s *Service) CheckLogin(token, qrcode string) (check *CheckLoginResp, cookie string, err error)
func (*Service) CourseCount ¶
CourseCount 获取课程数量 by 分类
func (*Service) CourseDetail ¶
CourseDetail get course list
func (*Service) CourseInfo ¶
func (s *Service) CourseInfo(enid string) (info *CourseInfo, err error)
CourseInfo get course info
func (*Service) CourseList ¶
func (s *Service) CourseList(category, order string, page, limit int) (list *CourseList, err error)
CourseList get course list by page
func (*Service) CourseListAll ¶
func (s *Service) CourseListAll(category, order string) (list *CourseList, err error)
CourseListAll get all course list
func (*Service) CourseType ¶
func (s *Service) CourseType() (list *CourseCategoryList, err error)
CourseType get course type list
func (*Service) EbookDetail ¶
func (s *Service) EbookDetail(enid string) (detail *EbookDetail, err error)
EbookDetail get ebook detail
func (*Service) EbookPages ¶ added in v1.1.0
func (*Service) EbookReadToken ¶
EbookReadToken get ebook read token
func (*Service) EbookVIPInfo ¶
func (s *Service) EbookVIPInfo() (info *EbookVIPInfo, err error)
EbookVIPInfo get ebook vip info
func (*Service) GetQrcode ¶ added in v1.0.11
func (s *Service) GetQrcode(token string) (resp *QrCodeResp, err error)
func (*Service) LoginAccessToken ¶ added in v1.0.11
LoginAccessToken get login access token
func (*Service) TopicDetail ¶
func (s *Service) TopicDetail(id string) (detail *TopicDetail, err error)
TopicDetail topic detail by id hazy
func (*Service) TopicNotesList ¶
TopicNotesList Topic NotesList
type TopicAll ¶
type TopicAll struct { HasMore bool `json:"has_more"` List []TopicIntro `json:"list"` }
TopicAll topic all
type TopicDetail ¶
type TopicDetail struct { TopicIntro Presenters []TopicPresenter `json:"presenters"` TopArea []TopicTopArea `json:"top_area"` CreateTime int `json:"create_time"` UpdateTime int `json:"update_time"` State int `json:"state"` Ddurl string `json:"ddurl"` TopicIDStr string `json:"topic_id_str"` LastNotesID string `json:"last_notes_id"` LastNotesIDHazy string `json:"last_notes_id_hazy"` LastNotesUID string `json:"last_notes_uid"` LastNotesUIDHazy string `json:"last_notes_uid_hazy"` LastNotesContent string `json:"last_notes_content"` LastUpdateTime int `json:"last_update_time"` }
TopicDetail topic detail
type TopicIntro ¶
type TopicIntro struct { NotesTopicID string `json:"notes_topic_id"` TopicIDHazy string `json:"topic_id_hazy"` Name string `json:"name"` Img string `json:"img"` Topmost bool `json:"topmost"` Tag int `json:"tag"` Intro string `json:"intro"` ViewCount int `json:"view_count"` NotesCount int `json:"notes_count"` HasNewNotes bool `json:"has_new_notes"` UserState int `json:"user_state"` LogID string `json:"log_id"` LogType string `json:"log_type"` }
TopicIntro topic intro
type TopicPresenter ¶
type TopicPresenter struct { ID int `json:"id"` IDHazy string `json:"id_hazy"` UID int `json:"uid"` UIDHazy string `json:"uid_hazy"` IsV int `json:"isV"` Name string `json:"name"` Avatar string `json:"avatar"` TopicCount int `json:"topic_count"` Icon string `json:"icon"` Relation int `json:"relation"` }
TopicPresenter topic presenter
type TopicTopArea ¶
type TopicTopArea struct { ID int `json:"id"` IDHazy string `json:"id_hazy"` Icon string `json:"icon"` Title string `json:"title"` URL string `json:"url"` State int `json:"state"` IndexNum int `json:"index_num"` }
TopicTopArea Topic TopArea
type User ¶
type User struct { Nickname string `json:"nickname"` Avatar string `json:"avatar"` TodayStudyTime int `json:"today_study_time"` StudySerialDays int `json:"study_serial_days"` IsV int `JSON:"is_v"` VIPUser VIPUser `json:"vip_user"` IsTeacher int `json:"is_teacher"` UIDHazy string `json:"uid_hazy"` }
User user info
type Video ¶ added in v1.0.3
type Video struct { Token string `json:"token"` TokenVersion int `json:"token_version"` CoverImg string `json:"cover_img"` DdMediaID int64 `json:"dd_media_id"` DdMediaIDStr string `json:"dd_media_id_str"` Duration int `json:"duration"` Bitrate480 string `json:"bitrate_480"` Bitrate480Size int `json:"bitrate_480_size"` Bitrate480Audio string `json:"bitrate_480_audio"` Bitrate720 string `json:"bitrate_720"` Bitrate720Size int `json:"bitrate_720_size"` Bitrate720Audio string `json:"bitrate_720_audio"` Bitrate1080 string `json:"bitrate_1080"` Bitrate1080Size int `json:"bitrate_1080_size"` Bitrate1080Audio string `json:"bitrate_1080_audio"` IsDrm bool `json:"is_drm"` ListenProgress float64 `json:"listen_progress"` ListenFinished bool `json:"listen_finished"` LogID string `json:"log_id"` LogType string `json:"log_type"` Caption string `json:"caption"` }