Documentation
¶
Index ¶
- Variables
- func ParseCookies(cookie string, v interface{}) (err error)
- type Answer
- type Article
- type Column
- type ColumnTopic
- type ColumnTopics
- type Columns
- type Comment
- type Comments
- type CookieOptions
- type File
- type Group
- type GroupInfo
- type GroupInfoResp
- type Groups
- type Image
- type ImageMeta
- type Menu
- type Menus
- type Question
- type Response
- type Service
- func (s *Service) GetArticle(url string) (info string, err error)
- func (s *Service) GetColumnTopics(groupID, columnID string) (list ColumnTopics, err error)
- func (s *Service) GetColumns(groupID string) (list Columns, err error)
- func (s *Service) GetGroupInfo(groupID string) (info GroupInfoResp, err error)
- func (s *Service) GetGroupTopics(groupID, scope, count, endTime string) (list Topics, err error)
- func (s *Service) GetGroups() (list Groups, err error)
- func (s *Service) GetMenus(groupID string) (list Menus, err error)
- func (s *Service) GetSettings() (io.ReadCloser, error)
- func (s *Service) GetTopicInfo(topicID string) (info TopicInfo, err error)
- func (s *Service) GetUserSelf() (user UserInfo, err error)
- type ShowComment
- type Summary
- type Topic
- type TopicInfo
- type Topics
- type User
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BaseURL = "https://api.zsxq.com/v2" UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" )
Functions ¶
func ParseCookies ¶
ParseCookies parse cookie string to cookie options
Types ¶
type ColumnTopic ¶
type ColumnTopics ¶
type ColumnTopics struct {
Topics []ColumnTopic `json:"topics,omitempty"`
}
type Comment ¶
type Comment struct {
CommentId int64 `json:"comment_id"`
CreateTime string `json:"create_time"`
Owner User `json:"owner"`
Text string `json:"text"`
LikesCount int `json:"likes_count"`
RewardsCount int `json:"rewards_count"`
Sticky bool `json:"sticky"`
Images []Image `json:"images,omitempty"`
RepliesCount int `json:"replies_count,omitempty"`
RepliedComments []struct {
CommentId int64 `json:"comment_id"`
ParentCommentId int64 `json:"parent_comment_id"`
CreateTime string `json:"create_time"`
Owner User `json:"owner"`
Text string `json:"text"`
LikesCount int `json:"likes_count"`
RewardsCount int `json:"rewards_count"`
Sticky bool `json:"sticky"`
Repliee User `json:"repliee"`
} `json:"replied_comments,omitempty"`
}
type CookieOptions ¶
type CookieOptions struct {
Zsxqsessionid string `json:"zsxqsessionid"`
AbtestEnv string `json:"abtest_env" mapstructure:"abtest_env"`
ZsxqAccessToken string `json:"zsxq_access_token" mapstructure:"zsxq_access_token"`
UabCollina string `json:"_uab_collina" mapstructure:"_uab_collina"`
Debug bool `json:"debug"`
}
CookieOptions dedao cookie options
type GroupInfo ¶
type GroupInfo struct {
GroupId int64 `json:"group_id"`
Number int `json:"number"`
Name string `json:"name"`
Description string `json:"description"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
PrivilegeUserLastTopicCreateTime string `json:"privilege_user_last_topic_create_time"`
LatestTopicCreateTime string `json:"latest_topic_create_time"`
AliveTime string `json:"alive_time"`
BackgroundUrl string `json:"background_url"`
Type string `json:"type"`
RiskLevel string `json:"risk_level"`
Category struct {
CategoryId int `json:"category_id"`
Title string `json:"title"`
} `json:"category"`
Owner User `json:"owner"`
AdminIds []int64 `json:"admin_ids"`
GuestIds []int64 `json:"guest_ids"`
PartnerIds []int64 `json:"partner_ids"`
Promos []interface{} `json:"promos"`
Policies struct {
NeedExamine bool `json:"need_examine"`
EnableScoreboard bool `json:"enable_scoreboard"`
FreeQuestionsLimitCount int `json:"free_questions_limit_count"`
EnableMemberNumber bool `json:"enable_member_number"`
MembersVisibility string `json:"members_visibility"`
AllowSharing bool `json:"allow_sharing"`
AllowPrivateChat bool `json:"allow_private_chat"`
AllowSearch bool `json:"allow_search"`
AllowJoin bool `json:"allow_join"`
AllowAnonymousQuestion bool `json:"allow_anonymous_question"`
SilenceNewMember bool `json:"silence_new_member"`
EnableWatermark bool `json:"enable_watermark"`
ParseBookTitle bool `json:"parse_book_title"`
AllowCopy bool `json:"allow_copy"`
AllowDownload bool `json:"allow_download"`
EnableIap bool `json:"enable_iap"`
} `json:"policies"`
Privileges struct {
AccessGroupData string `json:"access_group_data"`
AccessIncomesData string `json:"access_incomes_data"`
AccessWeeklyReports string `json:"access_weekly_reports"`
CreateTopic string `json:"create_topic"`
CreateComment string `json:"create_comment"`
} `json:"privileges"`
Statistics struct {
Topics struct {
TopicsCount int `json:"topics_count"`
AnswersCount int `json:"answers_count"`
DigestsCount int `json:"digests_count"`
} `json:"topics"`
Files struct {
Count int `json:"count"`
} `json:"files"`
Members struct {
Count int `json:"count"`
} `json:"members"`
} `json:"statistics"`
UserSpecific struct {
JoinTime string `json:"join_time"`
RewardedOwner bool `json:"rewarded_owner"`
EnableFootprint bool `json:"enable_footprint"`
} `json:"user_specific"`
}
type GroupInfoResp ¶
type GroupInfoResp struct {
Group GroupInfo `json:"group"`
}
type Response ¶
type Response struct {
Succeeded bool `json:"succeeded"`
Code int `json:"code,omitempty"`
Info string `json:"info,omitempty"`
RespData respC `json:"resp_data"`
}
Response response
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service dedao service
func (*Service) GetColumnTopics ¶
func (s *Service) GetColumnTopics(groupID, columnID string) (list ColumnTopics, err error)
GetColumnTopics group columns topics 导读二级分类
func (*Service) GetColumns ¶
GetColumns group columns 导读分类
func (*Service) GetGroupInfo ¶
func (s *Service) GetGroupInfo(groupID string) (info GroupInfoResp, err error)
func (*Service) GetGroupTopics ¶
GetGroupTopics scope= all 最新, digests 精华, by_owner 只看星主, questions 问答,with_files 文件
func (*Service) GetSettings ¶
func (s *Service) GetSettings() (io.ReadCloser, error)
func (*Service) GetTopicInfo ¶
GetTopicInfo group columns topics
func (*Service) GetUserSelf ¶
type ShowComment ¶
type ShowComment struct {
CommentId int64 `json:"comment_id"`
CreateTime string `json:"create_time"`
Owner User `json:"owner"`
Text string `json:"text"`
LikesCount int `json:"likes_count"`
RewardsCount int `json:"rewards_count"`
Sticky bool `json:"sticky"`
RepliesCount int `json:"replies_count,omitempty"`
ParentCommentId int64 `json:"parent_comment_id,omitempty"`
Repliee User `json:"repliee,omitempty"`
Images []Image `json:"images,omitempty"`
}
type Topic ¶
type Topic struct {
Question Question `json:"question"` // 提问
Answer Answer `json:"answer"` // 回答
TopicId int64 `json:"topic_id"`
Group Group `json:"group"`
Type string `json:"type"`
Talk struct {
Owner User `json:"owner"`
Text string `json:"text"`
Article Article `json:"article,omitempty"`
Images []Image `json:"images,omitempty"`
Files []File `json:"files,omitempty"`
} `json:"talk"`
// LatestLikes []struct {
// CreateTime string `json:"create_time"`
// Owner User `json:"owner"`
// } `json:"latest_likes"`
// ShowComments []ShowComment `json:"show_comments"`
LikesCount int `json:"likes_count"`
RewardsCount int `json:"rewards_count"`
CommentsCount int `json:"comments_count"`
ReadingCount int `json:"reading_count"`
ReadersCount int `json:"readers_count"`
Digested bool `json:"digested"`
Sticky bool `json:"sticky"`
CreateTime string `json:"create_time"`
UserSpecific struct {
Liked bool `json:"liked"`
Subscribed bool `json:"subscribed"`
} `json:"user_specific"`
Title string `json:"title"`
Columns []struct {
ColumnId int64 `json:"column_id"`
Name string `json:"name"`
} `json:"columns"`
}
type User ¶
type User struct {
UserId int64 `json:"user_id"`
Name string `json:"name"`
AvatarUrl string `json:"avatar_url"`
Description string `json:"description,omitempty"`
Location string `json:"location"`
Alias string `json:"alias,omitempty"`
Number int `json:"number,omitempty"`
UniqueId string `json:"unique_id,omitempty"`
}
type UserInfo ¶
type UserInfo struct {
User User `json:"user"`
Chat struct {
Identifier string `json:"identifier"`
} `json:"chat"`
Accounts struct {
Phone struct {
CountryCode string `json:"country_code"`
PhoneNumber string `json:"phone_number"`
} `json:"phone"`
Wechat struct {
Name string `json:"name"`
AvatarUrl string `json:"avatar_url"`
} `json:"wechat"`
} `json:"accounts"`
IdentityStatus string `json:"identity_status"`
SubscribedWechat bool `json:"subscribed_wechat"`
Subscriptions struct {
SubscribedXiaomiquanvip bool `json:"subscribed_xiaomiquanvip"`
SubscribedXingqiusvip bool `json:"subscribed_xingqiusvip"`
} `json:"subscriptions"`
AssociatedEnterprise bool `json:"associated_enterprise"`
}
Click to show internal directories.
Click to hide internal directories.