Documentation
¶
Index ¶
- func FormatTimestamp(ts int64) time.Time
- type AnswerAcceptReq
- type AnswerAddReq
- type AnswerDeleteReq
- type AnswerInfo
- type AnswerListReq
- type AnswerListResp
- type AnswerUpdateReq
- type AppConfig
- type AvatarInfo
- type CommentAddReq
- type CommentDeleteReq
- type CommentInfo
- type CommentListReq
- type CommentListResp
- type CommentUpdateReq
- type LoginResponse
- type NotificationItem
- type NotificationListReq
- type NotificationListResp
- type NotificationReadAllReq
- type NotificationReadReq
- type NotificationStatusResp
- type PageModel
- type QuestionAddReq
- type QuestionCloseReq
- type QuestionDeleteReq
- type QuestionInfoResp
- type QuestionListItem
- type QuestionListReq
- type QuestionPageResp
- type QuestionReopenReq
- type QuestionUpdateReq
- type SearchObject
- type SearchReq
- type SearchResp
- type SearchResult
- type TagAddReq
- type TagDeleteReq
- type TagDetail
- type TagItem
- type TagListReq
- type TagListResp
- type TagUpdateReq
- type UserBasicInfo
- type UserDetailResp
- type UserInfoResp
- type VoteReq
- type VoteResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnswerAcceptReq ¶
type AnswerAddReq ¶
type AnswerDeleteReq ¶
type AnswerDeleteReq struct {
ID string `json:"id"`
}
type AnswerInfo ¶
type AnswerInfo struct {
ID string `json:"id"`
QuestionID string `json:"question_id"`
Content string `json:"content"`
HTML string `json:"html"`
VoteCount int `json:"vote_count"`
CommentCount int `json:"comment_count"`
Accepted int `json:"accepted"`
Status int `json:"status"`
CreatedAt int64 `json:"create_time"`
UpdatedAt int64 `json:"update_time"`
UserInfo *UserBasicInfo `json:"user_info"`
}
type AnswerListReq ¶
type AnswerListResp ¶
type AnswerListResp struct {
Count int64 `json:"count"`
List []AnswerInfo `json:"list"`
}
type AnswerUpdateReq ¶
type AppConfig ¶
type AppConfig struct {
Version string `yaml:"version"`
Server struct {
BaseURL string `yaml:"base_url"`
Token string `yaml:"token"`
} `yaml:"server"`
AI struct {
Provider string `yaml:"provider"`
BaseURL string `yaml:"base_url"`
ApiKey string `yaml:"api_key"`
Model string `yaml:"model"`
MaxTokens int `yaml:"max_tokens"`
Temperature float64 `yaml:"temperature"`
Timeout int `yaml:"timeout"`
} `yaml:"ai"`
Output struct {
Format string `yaml:"format"`
} `yaml:"output"`
Log struct {
Level string `yaml:"level"`
MaxSize int `yaml:"max_size"`
MaxBackups int `yaml:"max_backups"`
MaxAge int `yaml:"max_age"`
Compress bool `yaml:"compress"`
} `yaml:"log"`
}
func (*AppConfig) GetAIAPIKey ¶
func (*AppConfig) GetAIBaseURL ¶
func (*AppConfig) GetAIModel ¶
func (*AppConfig) GetAIProvider ¶
func (*AppConfig) GetOutputFormat ¶
func (*AppConfig) GetServerToken ¶
func (*AppConfig) GetServerURL ¶
type AvatarInfo ¶
type AvatarInfo struct {
Type string `json:"type"`
Gravatar string `json:"gravatar"`
Custom string `json:"custom"`
}
func (*AvatarInfo) GetURL ¶
func (a *AvatarInfo) GetURL() string
func (*AvatarInfo) UnmarshalJSON ¶
func (a *AvatarInfo) UnmarshalJSON(data []byte) error
type CommentAddReq ¶
type CommentDeleteReq ¶
type CommentDeleteReq struct {
CommentID string `json:"comment_id"`
}
type CommentInfo ¶
type CommentInfo struct {
CommentID string `json:"comment_id"`
ObjectID string `json:"object_id"`
QuestionID string `json:"question_id"`
ReplyUserID string `json:"reply_user_id"`
ReplyUsername string `json:"reply_username"`
ReplyUserDisplayName string `json:"reply_user_display_name"`
ReplyCommentID string `json:"reply_comment_id"`
OriginalText string `json:"original_text"`
ParsedText string `json:"parsed_text"`
VoteCount int `json:"vote_count"`
IsVote bool `json:"is_vote"`
Status int `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
UserID string `json:"user_id"`
Username string `json:"username"`
UserDisplayName string `json:"user_display_name"`
UserAvatar string `json:"user_avatar"`
UserStatus string `json:"user_status"`
}
func (CommentInfo) DisplayAuthor ¶
func (c CommentInfo) DisplayAuthor() string
DisplayAuthor returns the best available display name.
type CommentListReq ¶
type CommentListResp ¶
type CommentListResp struct {
Count int64 `json:"count"`
List []CommentInfo `json:"list"`
}
type CommentUpdateReq ¶
type LoginResponse ¶
type NotificationItem ¶
type NotificationListReq ¶
type NotificationListResp ¶
type NotificationListResp struct {
Count int64 `json:"count"`
List []NotificationItem `json:"list"`
}
type NotificationReadAllReq ¶
type NotificationReadAllReq struct {
Type string `json:"type,omitempty"`
}
type NotificationReadReq ¶
type NotificationReadReq struct {
ID string `json:"id"`
}
type NotificationStatusResp ¶
type QuestionAddReq ¶
type QuestionCloseReq ¶
type QuestionDeleteReq ¶
type QuestionDeleteReq struct {
ID string `json:"id"`
}
type QuestionInfoResp ¶
type QuestionInfoResp struct {
ID string `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
HTML string `json:"html"`
ViewCount int `json:"view_count"`
UniqueViewCount int `json:"unique_view_count"`
VoteCount int `json:"vote_count"`
AnswerCount int `json:"answer_count"`
CollectionCount int `json:"collection_count"`
FollowCount int `json:"follow_count"`
CommentCount int `json:"comment_count"`
Status int `json:"status"`
Pin int `json:"pin"`
AcceptedAnswerID string `json:"accepted_answer_id"`
LastAnswerID string `json:"last_answer_id"`
HotScore int `json:"hot_score"`
CreatedAt int64 `json:"create_time"`
UpdatedAt int64 `json:"update_time"`
UserInfo *UserBasicInfo `json:"user_info"`
Tags []TagItem `json:"tags"`
}
type QuestionListItem ¶
type QuestionListItem struct {
ID string `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
ViewCount int `json:"view_count"`
VoteCount int `json:"vote_count"`
AnswerCount int `json:"answer_count"`
CollectionCount int `json:"collection_count"`
CommentCount int `json:"comment_count"`
Status int `json:"status"`
Pin int `json:"pin"`
AcceptedAnswerID string `json:"accepted_answer_id"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Operator *UserBasicInfo `json:"operator"`
Tags []TagItem `json:"tags"`
}
func (QuestionListItem) DisplayAuthor ¶
func (q QuestionListItem) DisplayAuthor() string
type QuestionListReq ¶
type QuestionPageResp ¶
type QuestionPageResp struct {
Count int64 `json:"count"`
List []QuestionListItem `json:"list"`
}
type QuestionReopenReq ¶
type QuestionReopenReq struct {
ID string `json:"id"`
}
type QuestionUpdateReq ¶
type SearchObject ¶
type SearchObject struct {
ID string `json:"id"`
QuestionID string `json:"question_id"`
Title string `json:"title"`
Excerpt string `json:"excerpt"`
VoteCount int `json:"vote_count"`
AnswerCount int `json:"answer_count"`
Accepted bool `json:"accepted"`
CreatedAt int64 `json:"created_at"`
StatusStr string `json:"status"`
}
type SearchResp ¶
type SearchResp struct {
Count int64 `json:"count"`
List []*SearchResult `json:"list"`
}
type SearchResult ¶
type SearchResult struct {
ObjectType string `json:"object_type"`
Object *SearchObject `json:"object"`
}
type TagDeleteReq ¶
type TagDeleteReq struct {
SlugName string `json:"slug_name"`
}
type TagDetail ¶
type TagDetail struct {
ID string `json:"id"`
SlugName string `json:"slug_name"`
DisplayName string `json:"display_name"`
OriginalText string `json:"original_text"`
ParsedText string `json:"parsed_text"`
FollowCount int `json:"follow_count"`
QuestionCount int `json:"question_count"`
Status int `json:"status"`
Recommend bool `json:"recommend"`
Reserved bool `json:"reserved"`
MainTagID int64 `json:"main_tag_id"`
MainTagSlugName string `json:"main_tag_slug_name"`
CreatedAt int64 `json:"created_at"`
}
type TagListReq ¶
type TagListResp ¶
type TagUpdateReq ¶
type UserBasicInfo ¶
type UserBasicInfo struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
Avatar *AvatarInfo `json:"avatar"`
Rank int `json:"rank"`
}
type UserDetailResp ¶
type UserDetailResp struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
Avatar *AvatarInfo `json:"avatar"`
Rank int `json:"rank"`
Bio string `json:"bio"`
Website string `json:"website"`
Location string `json:"location"`
}
UserDetailResp 用户详情
type UserInfoResp ¶
type UserInfoResp struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
EMail string `json:"e_mail"`
Avatar *AvatarInfo `json:"avatar"`
Bio string `json:"bio"`
Website string `json:"website"`
Location string `json:"location"`
Rank int `json:"rank"`
AnswerCount int `json:"answer_count"`
QuestionCount int `json:"question_count"`
FollowCount int `json:"follow_count"`
IsAdmin bool `json:"is_admin"`
}
Click to show internal directories.
Click to hide internal directories.