Documentation
¶
Index ¶
- func About(c *gin.Context)
- func ActivateAccount(c *gin.Context)
- func Admin(c *gin.Context)
- func ArticleReply(req component.BetterRequest[ArticleReplyId]) component.Response
- func BookmarkArticle(req component.BetterRequest[LikeArticleReq]) component.Response
- func CustomErrorPage(c *gin.Context, title, message string)
- func DeleteReply(req component.BetterRequest[DeleteReplyId]) component.Response
- func DocsContent(c *gin.Context)
- func DocsHome(c *gin.Context)
- func DocsVersion(c *gin.Context)
- func FollowUser(req component.BetterRequest[FollowUserReq]) component.Response
- func ForbiddenPage(c *gin.Context)
- func GetArticlesEnum() component.Response
- func GetOAuthBindings(req component.BetterRequest[null]) component.Response
- func GetSiteStatistics() component.Response
- func GetUserArticles(req component.BetterRequest[GetUserArticlesRequest]) component.Response
- func GetUserBookmarkedArticles(req component.BetterRequest[GetUserBookmarkedArticlesRequest]) component.Response
- func Home(c *gin.Context)
- func InternalServerErrorPage(c *gin.Context)
- func LikeArticle(req component.BetterRequest[LikeArticleReq]) component.Response
- func LinksView(c *gin.Context)
- func Login(c *gin.Context)
- func LoginView(c *gin.Context)
- func Logout(c *gin.Context)
- func NotFound(c *gin.Context)
- func NotFoundPage(c *gin.Context)
- func Notifications(c *gin.Context)
- func Post(c *gin.Context)
- func PostDetail(c *gin.Context)
- func PrivacyPolicy(c *gin.Context)
- func Profile(c *gin.Context)
- func ProviderCallback(c *gin.Context)
- func ProviderLogin(c *gin.Context)
- func Publish(c *gin.Context)
- func Register(c *gin.Context)
- func RenderErrorPage(c *gin.Context, data ErrorPageData)
- func RenderRobotsTxt(c *gin.Context)
- func RenderRssV2(c *gin.Context)
- func RenderSitemapXml(c *gin.Context)
- func ResetPasswordView(c *gin.Context)
- func SearchArticles(req component.BetterRequest[SearchArticlesRequest]) component.Response
- func SearchPage(c *gin.Context)
- func SponsorsView(c *gin.Context)
- func TakeUpTo64Chars(s string) string
- func TermsOfService(c *gin.Context)
- func UnauthorizedPage(c *gin.Context)
- func UnbindOAuth(req component.BetterRequest[null]) component.Response
- func User(c *gin.Context)
- func WriteArticles(req component.BetterRequest[WriteArticleReq]) component.Response
- func WriteArticlesOrigin(req component.BetterRequest[WriteArticlesOriginReq]) component.Response
- type ArticleReplyId
- type BookmarkArticleReq
- type DeleteReplyId
- type DocContent
- type DocProject
- type DocVersion
- type ErrorPageData
- type FollowUserReq
- type ForumInfo
- type GetArticlesDetailRequest
- type GetArticlesPageRequest
- type GetUserArticlesRequest
- type GetUserBookmarkedArticlesRequest
- type LikeArticleReq
- type LinkStatistics
- type LinkStatisticsInfo
- type LoginReq
- type PageButton
- type ReplyDto
- type SearchArticlesRequest
- type SitemapURL
- type WriteArticleReq
- type WriteArticlesOriginReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArticleReply ¶
func ArticleReply(req component.BetterRequest[ArticleReplyId]) component.Response
func BookmarkArticle ¶ added in v0.0.9
func BookmarkArticle(req component.BetterRequest[LikeArticleReq]) component.Response
func CustomErrorPage ¶ added in v0.0.3
CustomErrorPage 自定义错误页面
func DeleteReply ¶
func DeleteReply(req component.BetterRequest[DeleteReplyId]) component.Response
func FollowUser ¶ added in v0.0.3
func FollowUser(req component.BetterRequest[FollowUserReq]) component.Response
func GetArticlesEnum ¶
func GetOAuthBindings ¶ added in v0.0.9
func GetOAuthBindings(req component.BetterRequest[null]) component.Response
GetOAuthBindings 获取用户的OAuth绑定状态
func GetSiteStatistics ¶
func GetUserArticles ¶
func GetUserArticles(req component.BetterRequest[GetUserArticlesRequest]) component.Response
GetUserArticles 获取用户文章列表
func GetUserBookmarkedArticles ¶ added in v0.0.9
func GetUserBookmarkedArticles(req component.BetterRequest[GetUserBookmarkedArticlesRequest]) component.Response
GetUserBookmarkedArticles 获取用户收藏文章列表
func InternalServerErrorPage ¶ added in v0.0.3
InternalServerErrorPage 500页面
func LikeArticle ¶ added in v0.0.2
func LikeArticle(req component.BetterRequest[LikeArticleReq]) component.Response
func Notifications ¶ added in v0.0.3
func PostDetail ¶ added in v0.0.3
func ProviderCallback ¶ added in v0.0.9
ProviderCallback 处理OAuth登录/绑定回调(根据登录状态自动判断)
func ProviderLogin ¶ added in v0.0.9
ProviderLogin 开始OAuth登录/绑定流程(根据登录状态自动判断)
func RenderErrorPage ¶ added in v0.0.3
func RenderErrorPage(c *gin.Context, data ErrorPageData)
RenderErrorPage 渲染错误页面的通用函数
func RenderRssV2 ¶
func ResetPasswordView ¶ added in v0.0.9
func SearchArticles ¶ added in v0.0.8
func SearchArticles(req component.BetterRequest[SearchArticlesRequest]) component.Response
SearchArticles 搜索文章接口 通过名字和类别查询文章,先查Meilisearch索引,再查文章表获取具体数据
func SponsorsView ¶ added in v0.0.3
func UnauthorizedPage ¶ added in v0.0.3
UnauthorizedPage 401页面
func UnbindOAuth ¶ added in v0.0.9
func UnbindOAuth(req component.BetterRequest[null]) component.Response
UnbindOAuth 解绑OAuth账户
func WriteArticles ¶
func WriteArticles(req component.BetterRequest[WriteArticleReq]) component.Response
WriteArticles 写文章
func WriteArticlesOrigin ¶
func WriteArticlesOrigin(req component.BetterRequest[WriteArticlesOriginReq]) component.Response
WriteArticlesOrigin 写文章
Types ¶
type ArticleReplyId ¶
type BookmarkArticleReq ¶ added in v0.0.9
type DeleteReplyId ¶
type DeleteReplyId struct {
ReplyId uint64 `json:"replyId"`
}
type DocContent ¶ added in v0.0.8
type DocContent struct {
ID uint64 `json:"id"`
VersionID uint64 `json:"version_id"`
Slug string `json:"slug"`
Title string `json:"title"`
Content string `json:"content"`
SortOrder int `json:"sort_order"`
Status int `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
DocContent 文档内容结构
type DocProject ¶ added in v0.0.8
type DocProject struct {
ID uint64 `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
Status int `json:"status"` // 1:已发布 0:草稿
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
DocProject 文档项目结构
type DocVersion ¶ added in v0.0.8
type DocVersion struct {
ID uint64 `json:"id"`
ProjectID uint64 `json:"project_id"`
Version string `json:"version"`
Name string `json:"name"`
Description string `json:"description"`
Directory []docVersions.DirectoryItem `json:"directory"` // JSON格式的目录结构
IsDefault bool `json:"is_default"`
Status int `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
DocVersion 文档版本结构
type ErrorPageData ¶ added in v0.0.3
ErrorPageData 错误页面数据结构
type FollowUserReq ¶ added in v0.0.3
type ForumInfo ¶ added in v0.0.4
func GetGooseForumInfo ¶ added in v0.0.4
func GetGooseForumInfo() ForumInfo
type GetArticlesPageRequest ¶
type GetUserArticlesRequest ¶
GetUserArticlesRequest 添加新的请求结构体
type GetUserBookmarkedArticlesRequest ¶ added in v0.0.9
type GetUserBookmarkedArticlesRequest struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
GetUserBookmarkedArticlesRequest 获取用户收藏文章列表请求结构体
type LikeArticleReq ¶ added in v0.0.2
type LinkStatistics ¶ added in v0.0.5
type LinkStatisticsInfo ¶ added in v0.0.5
type LinkStatisticsInfo struct {
Community LinkStatistics
Blog LinkStatistics
Tool LinkStatistics
}
type PageButton ¶ added in v0.0.2
type ReplyDto ¶
type ReplyDto struct {
Id uint64 `json:"id"`
ArticleId uint64 `json:"articleId"`
UserId uint64 `json:"userId"`
UserAvatarUrl string `json:"userAvatarUrl"`
Username string `json:"username"`
Content string `json:"content"`
CreateTime string `json:"createTime"`
ReplyToId uint64 `json:"replyToId,omitempty"`
ReplyToUsername string `json:"replyToUsername,omitempty"`
ReplyToUserId uint64 `json:"replyToUserId,omitempty"`
}
type SearchArticlesRequest ¶ added in v0.0.8
type SearchArticlesRequest struct {
Query string `json:"query" form:"query" validate:"required,min=1,max=100"` // 搜索关键词
Categories []uint64 `json:"categories" form:"categories"` // 分类ID列表
Page int `json:"page" form:"page"` // 页码,从1开始
PageSize int `json:"pageSize" form:"pageSize"` // 每页数量
}
SearchArticlesRequest 搜索文章请求结构
type SitemapURL ¶ added in v0.0.9
type WriteArticleReq ¶
type WriteArticlesOriginReq ¶
type WriteArticlesOriginReq struct {
Id int64 `json:"id"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.