Documentation
¶
Index ¶
- func About(c *gin.Context)
- func ActivateAccount(c *gin.Context)
- func Admin(c *gin.Context)
- func AdminDocsContentCreate(req component.BetterRequest[DocsContentCreateReq]) component.Response
- func AdminDocsContentDelete(req component.BetterRequest[DocsContentDeleteReq]) component.Response
- func AdminDocsContentDetail(req component.BetterRequest[component.Null]) component.Response
- func AdminDocsContentDraft(req component.BetterRequest[DocsContentDraftReq]) component.Response
- func AdminDocsContentList(req component.BetterRequest[DocsContentListReq]) component.Response
- func AdminDocsContentPreview(req component.BetterRequest[DocsContentPreviewReq]) component.Response
- func AdminDocsContentPublish(req component.BetterRequest[DocsContentPublishReq]) component.Response
- func AdminDocsContentUpdate(req component.BetterRequest[DocsContentUpdateReq]) component.Response
- func AdminDocsProjectCreate(req component.BetterRequest[DocsProjectCreateReq]) component.Response
- func AdminDocsProjectDelete(req component.BetterRequest[DocsProjectDeleteReq]) component.Response
- func AdminDocsProjectDetail(req component.BetterRequest[component.Null]) component.Response
- func AdminDocsProjectList(req component.BetterRequest[DocsProjectListReq]) component.Response
- func AdminDocsProjectUpdate(req component.BetterRequest[DocsProjectUpdateReq]) component.Response
- func AdminDocsVersionCreate(req component.BetterRequest[DocsVersionCreateReq]) component.Response
- func AdminDocsVersionDelete(req component.BetterRequest[DocsVersionDeleteReq]) component.Response
- func AdminDocsVersionDetail(req component.BetterRequest[component.Null]) component.Response
- func AdminDocsVersionDirectoryUpdate(req component.BetterRequest[DocsVersionDirectoryUpdateReq]) component.Response
- func AdminDocsVersionList(req component.BetterRequest[DocsVersionListReq]) component.Response
- func AdminDocsVersionSetDefault(req component.BetterRequest[component.Null]) component.Response
- func AdminDocsVersionUpdate(req component.BetterRequest[DocsVersionUpdateReq]) component.Response
- func ApplyAddLink(req component.BetterRequest[ApplyAddLinkReq]) component.Response
- func ApplySheet(req component.BetterRequest[ApplySheetListReq]) component.Response
- func ApplyShow(req component.BetterRequest[ApplyShowReq]) component.Response
- func ApplyTop(req component.BetterRequest[ApplyTopReq]) component.Response
- func ArticleReply(req component.BetterRequest[ArticleReplyId]) component.Response
- func ArticlesList(req component.BetterRequest[ArticlesListReq]) component.Response
- func ChangePassword(req component.BetterRequest[ChangePasswordReq]) component.Response
- func CustomErrorPage(c *gin.Context, title, message string)
- func DeleteCategory(req ...) component.Response
- func DeleteNotification(req component.BetterRequest[DeleteNotificationReq]) component.Response
- func DeleteReply(req component.BetterRequest[DeleteReplyId]) component.Response
- func DocsContent(c *gin.Context)
- func DocsHome(c *gin.Context)
- func DocsVersion(c *gin.Context)
- func EditArticle(req component.BetterRequest[EditArticleReq]) component.Response
- func EditUser(req component.BetterRequest[EditUserReq]) component.Response
- func EditUserEmail(req component.BetterRequest[EditUserEmailReq]) component.Response
- func EditUserInfo(req component.BetterRequest[EditUserInfoReq]) component.Response
- func EditUsername(req component.BetterRequest[EditUsernameReq]) component.Response
- func FirstOr[T any](d []T, defaultValue T) T
- func FollowUser(req component.BetterRequest[FollowUserReq]) component.Response
- func ForbiddenPage(c *gin.Context)
- func GenerateRSS(title, link, description string, items []Item) (string, error)
- func GetAllRoleItem(req component.BetterRequest[GetAllRoleItemReq]) component.Response
- func GetArticlesEnum() component.Response
- func GetCaptcha() component.Response
- func GetCategoryList(req component.BetterRequest[CategoryListReq]) component.Response
- func GetFileByFileName(c *gin.Context)
- func GetFooterLinks(req component.BetterRequest[null]) component.Response
- func GetFriendLinks(req component.BetterRequest[null]) component.Response
- func GetLastUnread(req component.BetterRequest[GetUnreadCountReq]) component.Response
- func GetMailSettings(req component.BetterRequest[null]) component.Response
- func GetNotificationList(req component.BetterRequest[GetNotificationListReq]) component.Response
- func GetNotificationTypes(req component.BetterRequest[GetNotificationTypesReq]) component.Response
- func GetPermissionList(req component.BetterRequest[PermissionListReq]) component.Response
- func GetSiteSettings(req component.BetterRequest[null]) component.Response
- func GetSiteStatistics() component.Response
- func GetSponsors(req component.BetterRequest[null]) component.Response
- func GetUnreadCount(req component.BetterRequest[GetUnreadCountReq]) component.Response
- func GetUserArticles(req component.BetterRequest[GetUserArticlesRequest]) component.Response
- func GetWebSettings(req component.BetterRequest[null]) component.Response
- func Home(c *gin.Context)
- func InternalServerErrorPage(c *gin.Context)
- func Invitation(req component.BetterRequest[null]) component.Response
- func IsValidEmail(email string) bool
- 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 MarkAllAsRead(req component.BetterRequest[MarkAllAsReadReq]) component.Response
- func MarkAsRead(req component.BetterRequest[MarkAsReadReq]) component.Response
- func NotFound(c *gin.Context)
- func NotFoundPage(c *gin.Context)
- func Notifications(c *gin.Context)
- func OptRecordPage(req component.BetterRequest[OptRecordPageReq]) component.Response
- func Post(c *gin.Context)
- func PostDetail(c *gin.Context)
- func PrivacyPolicy(c *gin.Context)
- func Profile(c *gin.Context)
- func PublishV3(c *gin.Context)
- func QueryNotificationList(req component.BetterRequest[QueryNotificationListReq]) component.Response
- 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 RoleDel(req component.BetterRequest[RoleSaveDel]) component.Response
- func RoleList(req component.BetterRequest[RoleListReq]) component.Response
- func RoleSave(req component.BetterRequest[RoleSaveReq]) component.Response
- func SaveCategory(req component.BetterRequest[CategorySaveReq]) component.Response
- func SaveFooterLinks(req component.BetterRequest[SaveFooterLinksReq]) component.Response
- func SaveFriendLinks(req component.BetterRequest[SaveFriendLinksReq]) component.Response
- func SaveImgByGinContext(c *gin.Context)
- func SaveMailSettings(req component.BetterRequest[SaveMailSettingsReq]) component.Response
- func SaveSiteSettings(req component.BetterRequest[SaveSiteSettingsReq]) component.Response
- func SaveSponsors(req component.BetterRequest[SaveSponsorsReq]) component.Response
- func SaveUser(userEntity *users.EntityComplete) error
- func SaveWebSettings(req component.BetterRequest[SaveWebSettingsReq]) component.Response
- func SearchArticles(req component.BetterRequest[SearchArticlesRequest]) component.Response
- func SearchPage(c *gin.Context)
- func SendAEmail4User(userEntity *users.EntityComplete) error
- func SponsorsView(c *gin.Context)
- func TakeUpTo64Chars(s string) string
- func TermsOfService(c *gin.Context)
- func TestMailConnection(req component.BetterRequest[TestMailConnectionReq]) component.Response
- func UnauthorizedPage(c *gin.Context)
- func UploadAvatar(c *gin.Context)
- func User(c *gin.Context)
- func UserInfo(req component.BetterRequest[null]) component.Response
- func UserList(req component.BetterRequest[UserListReq]) component.Response
- func ValidatePassword(password string) error
- func ValidateUsername(username string) bool
- func WriteArticles(req component.BetterRequest[WriteArticleReq]) component.Response
- func WriteArticlesOrigin(req component.BetterRequest[WriteArticlesOriginReq]) component.Response
- type ApplyAddLinkReq
- type ApplySheetListReq
- type ApplyShowReq
- type ApplyTopReq
- type ArticleReplyId
- type ArticlesInfoAdminDto
- type ArticlesInfoDto
- type ArticlesListReq
- type ArticlesSimpleDto
- type CDATA
- type CategoryItem
- type CategoryListReq
- type CategorySaveReq
- type ChangePasswordReq
- type Channel
- type DeleteNotificationReq
- type DeleteReplyId
- type DocContent
- type DocProject
- type DocVersion
- type DocsContentCreateReq
- type DocsContentDeleteReq
- type DocsContentDraftReq
- type DocsContentItem
- type DocsContentListReq
- type DocsContentPreviewReq
- type DocsContentPreviewResponse
- type DocsContentPublishReq
- type DocsContentUpdateReq
- type DocsProjectCreateReq
- type DocsProjectDeleteReq
- type DocsProjectItem
- type DocsProjectListReq
- type DocsProjectUpdateReq
- type DocsVersionCreateReq
- type DocsVersionDeleteReq
- type DocsVersionDirectoryUpdateReq
- type DocsVersionItem
- type DocsVersionListReq
- type DocsVersionSetDefaultReq
- type DocsVersionUpdateReq
- type EditArticleReq
- type EditUserEmailReq
- type EditUserInfoReq
- type EditUserReq
- type EditUsernameReq
- type ErrorPageData
- type FollowUserReq
- type ForumInfo
- type GetAllRoleItemReq
- type GetArticlesDetailRequest
- type GetArticlesPageRequest
- type GetNotificationListReq
- type GetNotificationTypesReq
- type GetUnreadCountReq
- type GetUserArticlesRequest
- type Item
- type LikeArticleReq
- type LinkStatistics
- type LinkStatisticsInfo
- type LoginReq
- type MarkAllAsReadReq
- type MarkAsReadReq
- type OptRecordPageReq
- type PageButton
- type PermissionItem
- type PermissionListReq
- type QueryNotificationListReq
- type RSS
- type RegReq
- type ReplyDto
- type RoleItem
- type RoleListReq
- type RoleSaveDel
- type RoleSaveReq
- type SaveFooterLinksReq
- type SaveFriendLinksReq
- type SaveMailSettingsReq
- type SaveSiteSettingsReq
- type SaveSponsorsReq
- type SaveWebSettingsReq
- type SearchArticlesRequest
- type SiteStats
- type TestMailConnectionReq
- type TestMailConnectionResp
- type UserInfoShow
- type UserItem
- type UserListReq
- type WriteArticleReq
- type WriteArticlesOriginReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminDocsContentCreate ¶ added in v0.0.8
func AdminDocsContentCreate(req component.BetterRequest[DocsContentCreateReq]) component.Response
AdminDocsContentCreate 创建内容
func AdminDocsContentDelete ¶ added in v0.0.8
func AdminDocsContentDelete(req component.BetterRequest[DocsContentDeleteReq]) component.Response
AdminDocsContentDelete 删除内容
func AdminDocsContentDetail ¶ added in v0.0.8
AdminDocsContentDetail 内容详情
func AdminDocsContentDraft ¶ added in v0.0.8
func AdminDocsContentDraft(req component.BetterRequest[DocsContentDraftReq]) component.Response
AdminDocsContentDraft 设为草稿
func AdminDocsContentList ¶ added in v0.0.8
func AdminDocsContentList(req component.BetterRequest[DocsContentListReq]) component.Response
AdminDocsContentList 内容列表
func AdminDocsContentPreview ¶ added in v0.0.8
func AdminDocsContentPreview(req component.BetterRequest[DocsContentPreviewReq]) component.Response
AdminDocsContentPreview 预览内容
func AdminDocsContentPublish ¶ added in v0.0.8
func AdminDocsContentPublish(req component.BetterRequest[DocsContentPublishReq]) component.Response
AdminDocsContentPublish 发布内容
func AdminDocsContentUpdate ¶ added in v0.0.8
func AdminDocsContentUpdate(req component.BetterRequest[DocsContentUpdateReq]) component.Response
AdminDocsContentUpdate 更新内容
func AdminDocsProjectCreate ¶ added in v0.0.8
func AdminDocsProjectCreate(req component.BetterRequest[DocsProjectCreateReq]) component.Response
AdminDocsProjectCreate 创建项目
func AdminDocsProjectDelete ¶ added in v0.0.8
func AdminDocsProjectDelete(req component.BetterRequest[DocsProjectDeleteReq]) component.Response
AdminDocsProjectDelete 删除项目(软删除)
func AdminDocsProjectDetail ¶ added in v0.0.8
AdminDocsProjectDetail 获取项目详情
func AdminDocsProjectList ¶ added in v0.0.8
func AdminDocsProjectList(req component.BetterRequest[DocsProjectListReq]) component.Response
AdminDocsProjectList 获取项目列表
func AdminDocsProjectUpdate ¶ added in v0.0.8
func AdminDocsProjectUpdate(req component.BetterRequest[DocsProjectUpdateReq]) component.Response
AdminDocsProjectUpdate 更新项目
func AdminDocsVersionCreate ¶ added in v0.0.8
func AdminDocsVersionCreate(req component.BetterRequest[DocsVersionCreateReq]) component.Response
AdminDocsVersionCreate 创建版本
func AdminDocsVersionDelete ¶ added in v0.0.8
func AdminDocsVersionDelete(req component.BetterRequest[DocsVersionDeleteReq]) component.Response
AdminDocsVersionDelete 删除版本(软删除)
func AdminDocsVersionDetail ¶ added in v0.0.8
AdminDocsVersionDetail 获取版本详情
func AdminDocsVersionDirectoryUpdate ¶ added in v0.0.8
func AdminDocsVersionDirectoryUpdate(req component.BetterRequest[DocsVersionDirectoryUpdateReq]) component.Response
AdminDocsVersionDirectoryUpdate 更新版本目录结构
func AdminDocsVersionList ¶ added in v0.0.8
func AdminDocsVersionList(req component.BetterRequest[DocsVersionListReq]) component.Response
AdminDocsVersionList 获取版本列表
func AdminDocsVersionSetDefault ¶ added in v0.0.8
AdminDocsVersionSetDefault 设置默认版本
func AdminDocsVersionUpdate ¶ added in v0.0.8
func AdminDocsVersionUpdate(req component.BetterRequest[DocsVersionUpdateReq]) component.Response
AdminDocsVersionUpdate 更新版本
func ApplyAddLink ¶ added in v0.0.3
func ApplyAddLink(req component.BetterRequest[ApplyAddLinkReq]) component.Response
func ApplySheet ¶ added in v0.0.3
func ApplySheet(req component.BetterRequest[ApplySheetListReq]) component.Response
func ApplyShow ¶
func ApplyShow(req component.BetterRequest[ApplyShowReq]) component.Response
ApplyShow 申请展示,是侧边栏
func ApplyTop ¶
func ApplyTop(req component.BetterRequest[ApplyTopReq]) component.Response
ApplyTop 置顶申请,考虑滚动
func ArticleReply ¶
func ArticleReply(req component.BetterRequest[ArticleReplyId]) component.Response
func ArticlesList ¶
func ArticlesList(req component.BetterRequest[ArticlesListReq]) component.Response
func ChangePassword ¶
func ChangePassword(req component.BetterRequest[ChangePasswordReq]) component.Response
添加修改密码的处理函数
func CustomErrorPage ¶ added in v0.0.3
CustomErrorPage 自定义错误页面
func DeleteCategory ¶
func DeleteCategory(req component.BetterRequest[struct { Id uint64 `json:"id"` }]) component.Response
DeleteCategory 删除分类
func DeleteNotification ¶
func DeleteNotification(req component.BetterRequest[DeleteNotificationReq]) component.Response
DeleteNotification 删除通知
func DeleteReply ¶
func DeleteReply(req component.BetterRequest[DeleteReplyId]) component.Response
func EditArticle ¶
func EditArticle(req component.BetterRequest[EditArticleReq]) component.Response
EditArticle 文章状态管理
func EditUser ¶
func EditUser(req component.BetterRequest[EditUserReq]) component.Response
func EditUserEmail ¶ added in v0.0.7
func EditUserEmail(req component.BetterRequest[EditUserEmailReq]) component.Response
EditUserEmail 编辑用户
func EditUserInfo ¶
func EditUserInfo(req component.BetterRequest[EditUserInfoReq]) component.Response
EditUserInfo 编辑用户
func EditUsername ¶ added in v0.0.7
func EditUsername(req component.BetterRequest[EditUsernameReq]) component.Response
EditUsername 编辑用户
func FollowUser ¶ added in v0.0.3
func FollowUser(req component.BetterRequest[FollowUserReq]) component.Response
func GenerateRSS ¶
GenerateRSS 生成符合RSS 2.0规范的XML字符串
func GetAllRoleItem ¶
func GetAllRoleItem(req component.BetterRequest[GetAllRoleItemReq]) component.Response
func GetArticlesEnum ¶
func GetCaptcha ¶
func GetCategoryList ¶
func GetCategoryList(req component.BetterRequest[CategoryListReq]) component.Response
GetCategoryList 获取分类列表
func GetFileByFileName ¶
func GetFooterLinks ¶ added in v0.0.8
func GetFooterLinks(req component.BetterRequest[null]) component.Response
GetFooterLinks 获取页脚配置
func GetFriendLinks ¶ added in v0.0.3
func GetFriendLinks(req component.BetterRequest[null]) component.Response
func GetLastUnread ¶ added in v0.0.3
func GetLastUnread(req component.BetterRequest[GetUnreadCountReq]) component.Response
GetLastUnread 获取未读通知数量
func GetMailSettings ¶ added in v0.0.8
func GetMailSettings(req component.BetterRequest[null]) component.Response
GetMailSettings 获取邮件设置
func GetNotificationList ¶
func GetNotificationList(req component.BetterRequest[GetNotificationListReq]) component.Response
GetNotificationList 获取通知列表
func GetNotificationTypes ¶
func GetNotificationTypes(req component.BetterRequest[GetNotificationTypesReq]) component.Response
GetNotificationTypes 获取所有通知类型
func GetPermissionList ¶
func GetPermissionList(req component.BetterRequest[PermissionListReq]) component.Response
func GetSiteSettings ¶ added in v0.0.8
func GetSiteSettings(req component.BetterRequest[null]) component.Response
GetSiteSettings 获取站点设置
func GetSiteStatistics ¶
func GetSponsors ¶ added in v0.0.8
func GetSponsors(req component.BetterRequest[null]) component.Response
GetSponsors 获取赞助商配置
func GetUnreadCount ¶
func GetUnreadCount(req component.BetterRequest[GetUnreadCountReq]) component.Response
GetUnreadCount 获取未读通知数量
func GetUserArticles ¶
func GetUserArticles(req component.BetterRequest[GetUserArticlesRequest]) component.Response
GetUserArticles 获取用户文章列表
func GetWebSettings ¶ added in v0.0.5
func GetWebSettings(req component.BetterRequest[null]) component.Response
GetWebSettings 获取网页设置
func InternalServerErrorPage ¶ added in v0.0.3
InternalServerErrorPage 500页面
func Invitation ¶
func Invitation(req component.BetterRequest[null]) component.Response
func IsValidEmail ¶ added in v0.0.7
func LikeArticle ¶ added in v0.0.2
func LikeArticle(req component.BetterRequest[LikeArticleReq]) component.Response
func MarkAllAsRead ¶
func MarkAllAsRead(req component.BetterRequest[MarkAllAsReadReq]) component.Response
MarkAllAsRead 标记所有通知为已读
func MarkAsRead ¶
func MarkAsRead(req component.BetterRequest[MarkAsReadReq]) component.Response
MarkAsRead 标记通知为已读
func Notifications ¶ added in v0.0.3
func OptRecordPage ¶
func OptRecordPage(req component.BetterRequest[OptRecordPageReq]) component.Response
func PostDetail ¶ added in v0.0.3
func QueryNotificationList ¶ added in v0.0.3
func QueryNotificationList(req component.BetterRequest[QueryNotificationListReq]) component.Response
func RenderErrorPage ¶ added in v0.0.3
func RenderErrorPage(c *gin.Context, data ErrorPageData)
RenderErrorPage 渲染错误页面的通用函数
func RenderRssV2 ¶
func RoleDel ¶
func RoleDel(req component.BetterRequest[RoleSaveDel]) component.Response
func RoleList ¶
func RoleList(req component.BetterRequest[RoleListReq]) component.Response
func RoleSave ¶
func RoleSave(req component.BetterRequest[RoleSaveReq]) component.Response
func SaveCategory ¶
func SaveCategory(req component.BetterRequest[CategorySaveReq]) component.Response
SaveCategory 保存分类
func SaveFooterLinks ¶ added in v0.0.8
func SaveFooterLinks(req component.BetterRequest[SaveFooterLinksReq]) component.Response
SaveFooterLinks 保存页脚配置
func SaveFriendLinks ¶ added in v0.0.3
func SaveFriendLinks(req component.BetterRequest[SaveFriendLinksReq]) component.Response
func SaveImgByGinContext ¶ added in v0.0.6
SaveImgByGinContext 处理图片上传请求 包含文件大小限制、格式验证、内容检查等安全措施
func SaveMailSettings ¶ added in v0.0.8
func SaveMailSettings(req component.BetterRequest[SaveMailSettingsReq]) component.Response
SaveMailSettings 保存邮件设置
func SaveSiteSettings ¶ added in v0.0.8
func SaveSiteSettings(req component.BetterRequest[SaveSiteSettingsReq]) component.Response
SaveSiteSettings 保存站点设置
func SaveSponsors ¶ added in v0.0.8
func SaveSponsors(req component.BetterRequest[SaveSponsorsReq]) component.Response
SaveSponsors 保存赞助商配置
func SaveUser ¶ added in v0.0.8
func SaveUser(userEntity *users.EntityComplete) error
func SaveWebSettings ¶ added in v0.0.5
func SaveWebSettings(req component.BetterRequest[SaveWebSettingsReq]) component.Response
SaveWebSettings 保存网页设置
func SearchArticles ¶ added in v0.0.8
func SearchArticles(req component.BetterRequest[SearchArticlesRequest]) component.Response
SearchArticles 搜索文章接口 通过名字和类别查询文章,先查Meilisearch索引,再查文章表获取具体数据
func SendAEmail4User ¶
func SendAEmail4User(userEntity *users.EntityComplete) error
func SponsorsView ¶ added in v0.0.3
func TestMailConnection ¶ added in v0.0.8
func TestMailConnection(req component.BetterRequest[TestMailConnectionReq]) component.Response
TestMailConnection 测试邮件连接
func UnauthorizedPage ¶ added in v0.0.3
UnauthorizedPage 401页面
func UserInfo ¶
func UserInfo(req component.BetterRequest[null]) component.Response
UserInfo 获取登录用户信息
func UserList ¶
func UserList(req component.BetterRequest[UserListReq]) component.Response
func ValidatePassword ¶ added in v0.0.3
ValidatePassword 验证密码复杂度
func ValidateUsername ¶ added in v0.0.3
func WriteArticles ¶
func WriteArticles(req component.BetterRequest[WriteArticleReq]) component.Response
WriteArticles 写文章
func WriteArticlesOrigin ¶
func WriteArticlesOrigin(req component.BetterRequest[WriteArticlesOriginReq]) component.Response
WriteArticlesOrigin 写文章
Types ¶
type ApplyAddLinkReq ¶ added in v0.0.3
type ApplyAddLinkReq struct {
SiteName string `json:"siteName" validate:"required"`
SiteUrl string `json:"siteUrl" validate:"required"`
SiteLogo string `json:"siteLogo" validate:"required"`
SiteDesc string `json:"siteDesc" validate:"required"`
Email string `json:"email"`
Contact string `json:"contact"`
}
type ApplySheetListReq ¶ added in v0.0.3
type ApplyShowReq ¶
type ApplyTopReq ¶
type ApplyTopReq struct {
ArticleId uint64 `json:"articleId"`
}
type ArticleReplyId ¶
type ArticlesInfoAdminDto ¶ added in v0.0.4
type ArticlesInfoAdminDto struct {
Id uint64 `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Type int8 `json:"type"` // 文章类型:0 博文,1教程,2问答,3分享
UserId uint64 `json:"userId"` //
Username string `json:"username"`
UserAvatarUrl string `json:"userAvatarUrl"`
ArticleStatus int8 `json:"articleStatus"` // 文章状态:0 草稿 1 发布
ProcessStatus int8 `json:"processStatus"` // 管理状态:0 正常 1 封禁
ViewCount uint64 `json:"viewCount"`
ReplyCount uint64 `json:"replyCount"`
LikeCount uint64 `json:"likeCount"`
CreatedAt string `json:"createdAt"` // 改为 string 类型
UpdatedAt string `json:"updatedAt"` // 改为 string 类型
}
type ArticlesInfoDto ¶
type ArticlesInfoDto struct {
Id uint64 `json:"id"`
Title string `json:"title"`
Type int8 `json:"type"` // 文章类型:0 博文,1教程,2问答,3分享
UserId uint64 `json:"userId"` //
Username string `json:"username"`
ArticleStatus int8 `json:"articleStatus"` // 文章状态:0 草稿 1 发布
ProcessStatus int8 `json:"processStatus"` // 管理状态:0 正常 1 封禁
CreatedAt string `json:"createdAt"` // 改为 string 类型
UpdatedAt string `json:"updatedAt"` // 改为 string 类型
}
type ArticlesListReq ¶
type ArticlesSimpleDto ¶
type ArticlesSimpleDto struct {
Id uint64 `json:"id"`
Title string `json:"title,omitempty"`
Content string `json:"content,omitempty"`
CreateTime string `json:"createTime,omitempty"`
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
Username string `json:"username,omitempty"`
AuthorId uint64 `json:"authorId,omitempty"`
ViewCount uint64 `json:"viewCount,omitempty"`
CommentCount uint64 `json:"commentCount"`
Type int8 `json:"type,omitempty"`
TypeStr string `json:"typeStr,omitempty"`
Category string `json:"category,omitempty"`
Categories []string `json:"categories,omitempty"`
CategoriesId []uint64 `json:"categoriesId,omitempty"`
AvatarUrl string `json:"avatarUrl,omitempty"`
}
type CategoryItem ¶
type CategoryListReq ¶
type CategorySaveReq ¶
type ChangePasswordReq ¶
type ChangePasswordReq struct {
OldPassword string `json:"oldPassword" validate:"required"`
NewPassword string `json:"newPassword" validate:"required"`
}
添加新的请求结构体
type DeleteNotificationReq ¶
type DeleteNotificationReq struct {
NotificationId uint64 `json:"notificationId" validate:"required"`
}
DeleteNotificationReq 删除通知请求
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 DocsContentCreateReq ¶ added in v0.0.8
type DocsContentCreateReq struct {
VersionId uint64 `json:"versionId" validate:"required"`
Title string `json:"title" validate:"required,min=1,max=200"`
Slug string `json:"slug" validate:"required,min=1,max=200"`
Content string `json:"content"`
SortOrder int `json:"sortOrder"`
}
DocsContentCreateReq 创建内容请求
type DocsContentDeleteReq ¶ added in v0.0.8
type DocsContentDeleteReq struct {
Id uint64 `json:"id" validate:"required"`
}
DocsContentDeleteReq 删除内容请求
type DocsContentDraftReq ¶ added in v0.0.8
type DocsContentDraftReq struct {
Id uint64 `json:"id" validate:"required"`
}
DocsContentDraftReq 设为草稿请求
type DocsContentItem ¶ added in v0.0.8
type DocsContentItem struct {
Id uint64 `json:"id"`
VersionId uint64 `json:"versionId"`
VersionName string `json:"versionName"`
ProjectId uint64 `json:"projectId"`
ProjectName string `json:"projectName"`
Title string `json:"title"`
Slug string `json:"slug"`
Content string `json:"content"`
IsPublished int8 `json:"isPublished"`
SortOrder int `json:"sortOrder"`
ViewCount uint64 `json:"viewCount"`
LikeCount uint64 `json:"likeCount"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
DocsContentItem 内容项响应
type DocsContentListReq ¶ added in v0.0.8
type DocsContentListReq struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
VersionId *uint64 `json:"versionId"`
Keyword string `json:"keyword"`
Status *int8 `json:"status"` // 0:草稿 1:已发布
}
DocsContentListReq 内容列表请求
type DocsContentPreviewReq ¶ added in v0.0.8
type DocsContentPreviewReq struct {
Content string `json:"content" validate:"required"`
}
DocsContentPreviewReq 预览内容请求
type DocsContentPreviewResponse ¶ added in v0.0.8
DocsContentPreviewResponse 预览响应
type DocsContentPublishReq ¶ added in v0.0.8
type DocsContentPublishReq struct {
Id uint64 `json:"id" validate:"required"`
}
DocsContentPublishReq 发布内容请求
type DocsContentUpdateReq ¶ added in v0.0.8
type DocsContentUpdateReq struct {
Id uint64 `json:"id" validate:"required"`
VersionId uint64 `json:"versionId" validate:"required"`
Title string `json:"title" validate:"required,min=1,max=200"`
Slug string `json:"slug" validate:"required,min=1,max=200"`
Content string `json:"content"`
SortOrder int `json:"sortOrder"`
}
DocsContentUpdateReq 更新内容请求
type DocsProjectCreateReq ¶ added in v0.0.8
type DocsProjectCreateReq struct {
Name string `json:"name" validate:"required,min=1,max=100"`
Slug string `json:"slug" validate:"required,min=1,max=100"`
Description string `json:"description"`
LogoUrl string `json:"logoUrl"`
Status int8 `json:"status" validate:"oneof=1 2 3"`
IsPublic int8 `json:"isPublic" validate:"oneof=0 1"`
OwnerId uint64 `json:"ownerId"`
}
DocsProjectCreateReq 创建项目请求
type DocsProjectDeleteReq ¶ added in v0.0.8
type DocsProjectDeleteReq struct {
Id uint64 `json:"id" validate:"required"`
}
DocsProjectDeleteReq 删除项目请求
type DocsProjectItem ¶ added in v0.0.8
type DocsProjectItem struct {
Id uint64 `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
LogoUrl string `json:"logoUrl"`
Status int8 `json:"status"`
IsPublic int8 `json:"isPublic"`
OwnerId uint64 `json:"ownerId"`
OwnerName string `json:"ownerName"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
DocsProjectItem 项目列表项
type DocsProjectListReq ¶ added in v0.0.8
type DocsProjectListReq struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
Keyword string `json:"keyword"`
Status *int8 `json:"status"`
IsPublic *int8 `json:"isPublic"`
}
DocsProjectListReq 项目列表请求
type DocsProjectUpdateReq ¶ added in v0.0.8
type DocsProjectUpdateReq struct {
Id uint64 `json:"id" validate:"required"`
Name string `json:"name" validate:"required,min=1,max=100"`
Slug string `json:"slug" validate:"required,min=1,max=100"`
Description string `json:"description"`
LogoUrl string `json:"logoUrl"`
Status int8 `json:"status" validate:"oneof=1 2 3"`
IsPublic int8 `json:"isPublic" validate:"oneof=0 1"`
OwnerId uint64 `json:"ownerId"`
}
DocsProjectUpdateReq 更新项目请求
type DocsVersionCreateReq ¶ added in v0.0.8
type DocsVersionCreateReq struct {
ProjectId uint64 `json:"projectId" validate:"required"`
Name string `json:"name" validate:"required,min=1,max=100"`
Slug string `json:"slug" validate:"required,min=1,max=100"`
Description string `json:"description"`
Status int8 `json:"status" validate:"oneof=1 2 3"`
IsDefault int8 `json:"isDefault" validate:"oneof=0 1"`
SortOrder int `json:"sortOrder"`
}
DocsVersionCreateReq 创建版本请求
type DocsVersionDeleteReq ¶ added in v0.0.8
type DocsVersionDeleteReq struct {
}
DocsVersionDeleteReq 删除版本请求
type DocsVersionDirectoryUpdateReq ¶ added in v0.0.8
type DocsVersionDirectoryUpdateReq struct {
DirectoryStructure []docVersions.DirectoryItem `json:"directoryStructure"`
}
DocsVersionDirectoryUpdateReq 更新目录结构请求
type DocsVersionItem ¶ added in v0.0.8
type DocsVersionItem struct {
Id uint64 `json:"id"`
ProjectId uint64 `json:"projectId"`
ProjectName string `json:"projectName"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Status int8 `json:"status"`
IsDefault int8 `json:"isDefault"`
SortOrder int `json:"sortOrder"`
DirectoryStructure []docVersions.DirectoryItem `json:"directoryStructure"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
DocsVersionItem 版本列表项
type DocsVersionListReq ¶ added in v0.0.8
type DocsVersionListReq struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
ProjectId *uint64 `json:"projectId"`
Keyword string `json:"keyword"`
Status int8 `json:"status"`
}
DocsVersionListReq 版本列表请求
type DocsVersionSetDefaultReq ¶ added in v0.0.8
type DocsVersionSetDefaultReq struct {
Id uint64 `json:"id" validate:"required"`
}
DocsVersionSetDefaultReq 设置默认版本请求
type DocsVersionUpdateReq ¶ added in v0.0.8
type DocsVersionUpdateReq struct {
Id uint64 `json:"id" validate:"required"`
ProjectId uint64 `json:"projectId" validate:"required"`
Name string `json:"name" validate:"required,min=1,max=100"`
Slug string `json:"slug" validate:"required,min=1,max=100"`
Description string `json:"description"`
Status int8 `json:"status" validate:"oneof=1 2 3"`
IsDefault int8 `json:"isDefault" validate:"oneof=0 1"`
SortOrder int `json:"sortOrder"`
}
DocsVersionUpdateReq 更新版本请求
type EditArticleReq ¶
type EditUserEmailReq ¶ added in v0.0.7
type EditUserEmailReq struct {
Email string `json:"email" validate:"required,email"`
}
type EditUserInfoReq ¶
type EditUserReq ¶
type EditUsernameReq ¶ added in v0.0.7
type EditUsernameReq struct {
Username string `json:"username" validate:"required"`
}
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 GetAllRoleItemReq ¶
type GetAllRoleItemReq struct {
}
type GetArticlesPageRequest ¶
type GetNotificationListReq ¶
type GetNotificationListReq struct {
Page int `json:"page" validate:"required,min=1"`
PageSize int `json:"pageSize" validate:"required,min=1,max=100"`
UnreadOnly bool `json:"unreadOnly"`
}
GetNotificationListReq 获取通知列表请求
type GetNotificationTypesReq ¶
type GetNotificationTypesReq struct{}
GetNotificationTypesReq 获取通知类型请求
type GetUserArticlesRequest ¶
添加新的请求结构体
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 MarkAsReadReq ¶
type MarkAsReadReq struct {
NotificationId uint64 `json:"notificationId" validate:"required"`
}
MarkAsReadReq 标记通知已读请求
type OptRecordPageReq ¶
type OptRecordPageReq struct {
}
type PageButton ¶ added in v0.0.2
type PermissionItem ¶
type PermissionListReq ¶
type PermissionListReq struct {
}
type QueryNotificationListReq ¶ added in v0.0.3
type QueryNotificationListReq struct {
StartId int `json:"startId"`
PageSize int `json:"pageSize" validate:"required,min=1,max=100"`
UnreadOnly bool `json:"unreadOnly"`
}
QueryNotificationListReq 获取通知列表请求
type RSS ¶
type RSS struct {
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
Channel Channel `xml:"channel"`
}
RSS 2.0规范核心结构体
type RegReq ¶
type RegReq struct {
Email string `json:"email" validate:"required,email"`
Username string `json:"userName" validate:"required"`
Password string `json:"passWord" validate:"required"`
InvitationCode string `json:"invitationCode,omitempty"`
CaptchaId string `json:"captchaId" validate:"required"`
CaptchaCode string `json:"captchaCode" validate:"required"`
}
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 RoleItem ¶
type RoleItem struct {
RoleId uint64 `json:"roleId"`
RoleName string `json:"roleName"`
Effective int `json:"effective"`
Permissions []PermissionItem `json:"permissions"`
CreateTime string `json:"createTime"`
}
type RoleListReq ¶
type RoleListReq struct {
}
type RoleSaveDel ¶
type RoleSaveDel struct {
Id uint `json:"id"`
}
type RoleSaveReq ¶
type SaveFooterLinksReq ¶ added in v0.0.8
type SaveFooterLinksReq struct {
}
type SaveFriendLinksReq ¶ added in v0.0.3
type SaveFriendLinksReq struct {
LinksInfo []pageConfig.FriendLinksGroup `json:"linksInfo"`
}
type SaveMailSettingsReq ¶ added in v0.0.8
type SaveMailSettingsReq struct {
Settings pageConfig.MailSettingsConfig `json:"settings" validate:"required"`
}
type SaveSiteSettingsReq ¶ added in v0.0.8
type SaveSiteSettingsReq struct {
Settings pageConfig.SiteSettingsConfig `json:"settings"`
}
type SaveSponsorsReq ¶ added in v0.0.8
type SaveSponsorsReq struct {
SponsorsInfo pageConfig.SponsorsConfig `json:"sponsorsInfo"`
}
type SaveWebSettingsReq ¶ added in v0.0.5
type SaveWebSettingsReq struct {
Settings pageConfig.WebSettingsConfig `json:"settings"`
}
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 SiteStats ¶
type SiteStats struct {
UserCount int64 `json:"userCount"`
UserMonthCount int64 `json:"userMonthCount"`
ArticleCount int64 `json:"articleCount"`
ArticleMonthCount int64 `json:"articleMonthCount"`
Reply int64 `json:"reply"`
LinksCount int `json:"linksCount"`
}
func GetSiteStatisticsData ¶
func GetSiteStatisticsData() SiteStats
type TestMailConnectionReq ¶ added in v0.0.8
type TestMailConnectionReq struct {
Settings pageConfig.MailSettingsConfig `json:"settings" validate:"required"`
TestEmail string `json:"testEmail" validate:"required,email"`
}
type TestMailConnectionResp ¶ added in v0.0.8
type UserInfoShow ¶
type UserInfoShow vo.UserInfoShow
func GetLoginUser ¶
func GetLoginUser(c *gin.Context) UserInfoShow
func GetUserShowByUserId ¶
func GetUserShowByUserId(userId uint64) UserInfoShow
type UserItem ¶
type UserItem struct {
UserId uint64 `json:"userId"`
Username string `json:"username"`
AvatarUrl string `json:"avatarUrl"`
Email string `json:"email"`
Status int8 `json:"status"`
Validate int8 `json:"validate"`
Prestige int64 `json:"prestige"`
RoleList []datastruct.Option[string, uint64] `json:"roleList"`
RoleId uint64 `json:"roleId,omitempty"`
CreateTime string `json:"createTime"`
}
type UserListReq ¶
type WriteArticleReq ¶
type WriteArticlesOriginReq ¶
type WriteArticlesOriginReq struct {
Id int64 `json:"id"`
}
Source Files
¶
- adminController.go
- adminDocsController.go
- articleController.go
- businessController.go
- dataService.go
- docsController.go
- errorHandler.go
- fileController.go
- forumviewController.go
- notFoundController.go
- notificationController.go
- searchController.go
- seoController.go
- transform.go
- userController.go
- userOptController.go
- utils.go
- viewController.go