controllers

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func About added in v0.0.3

func About(c *gin.Context)

func ActivateAccount

func ActivateAccount(c *gin.Context)

ActivateAccount 激活处理函数

func Admin added in v0.0.4

func Admin(c *gin.Context)

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

func AdminDocsContentDetail(req component.BetterRequest[component.Null]) component.Response

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

func AdminDocsProjectDetail(req component.BetterRequest[component.Null]) component.Response

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

func AdminDocsVersionDetail(req component.BetterRequest[component.Null]) component.Response

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

func AdminDocsVersionSetDefault(req component.BetterRequest[component.Null]) component.Response

AdminDocsVersionSetDefault 设置默认版本

func AdminDocsVersionUpdate added in v0.0.8

func AdminDocsVersionUpdate(req component.BetterRequest[DocsVersionUpdateReq]) component.Response

AdminDocsVersionUpdate 更新版本

func ApplySheet added in v0.0.3

func ApplyShow

ApplyShow 申请展示,是侧边栏

func ApplyTop

ApplyTop 置顶申请,考虑滚动

func ChangePassword

添加修改密码的处理函数

func CustomErrorPage added in v0.0.3

func CustomErrorPage(c *gin.Context, title, message string)

CustomErrorPage 自定义错误页面

func DeleteCategory

func DeleteCategory(req component.BetterRequest[struct {
	Id uint64 `json:"id"`
}]) component.Response

DeleteCategory 删除分类

func DeleteNotification

DeleteNotification 删除通知

func DocsContent added in v0.0.8

func DocsContent(c *gin.Context)

DocsContent 文档内容页面

func DocsHome added in v0.0.8

func DocsHome(c *gin.Context)

DocsHome 文档首页 - 显示所有项目列表

func DocsVersion added in v0.0.8

func DocsVersion(c *gin.Context)

DocsVersion 版本首页 - 显示版本的第一个文档

func EditArticle

EditArticle 文章状态管理

func EditUserEmail added in v0.0.7

EditUserEmail 编辑用户

func EditUserInfo

EditUserInfo 编辑用户

func EditUsername added in v0.0.7

EditUsername 编辑用户

func FirstOr

func FirstOr[T any](d []T, defaultValue T) T

func FollowUser added in v0.0.3

func ForbiddenPage added in v0.0.3

func ForbiddenPage(c *gin.Context)

ForbiddenPage 403页面

func GenerateRSS

func GenerateRSS(title, link, description string, items []Item) (string, error)

GenerateRSS 生成符合RSS 2.0规范的XML字符串

func GetArticlesEnum

func GetArticlesEnum() component.Response

func GetCaptcha

func GetCaptcha() component.Response

func GetCategoryList

GetCategoryList 获取分类列表

func GetFileByFileName

func GetFileByFileName(c *gin.Context)
func GetFooterLinks(req component.BetterRequest[null]) component.Response

GetFooterLinks 获取页脚配置

func GetFriendLinks(req component.BetterRequest[null]) component.Response

func GetLastUnread added in v0.0.3

GetLastUnread 获取未读通知数量

func GetMailSettings added in v0.0.8

func GetMailSettings(req component.BetterRequest[null]) component.Response

GetMailSettings 获取邮件设置

func GetNotificationList

GetNotificationList 获取通知列表

func GetNotificationTypes

GetNotificationTypes 获取所有通知类型

func GetSiteSettings added in v0.0.8

func GetSiteSettings(req component.BetterRequest[null]) component.Response

GetSiteSettings 获取站点设置

func GetSiteStatistics

func GetSiteStatistics() component.Response

func GetSponsors added in v0.0.8

func GetSponsors(req component.BetterRequest[null]) component.Response

GetSponsors 获取赞助商配置

func GetUnreadCount

GetUnreadCount 获取未读通知数量

func GetUserArticles

GetUserArticles 获取用户文章列表

func GetWebSettings added in v0.0.5

func GetWebSettings(req component.BetterRequest[null]) component.Response

GetWebSettings 获取网页设置

func Home added in v0.0.3

func Home(c *gin.Context)

func InternalServerErrorPage added in v0.0.3

func InternalServerErrorPage(c *gin.Context)

InternalServerErrorPage 500页面

func Invitation

func Invitation(req component.BetterRequest[null]) component.Response

func IsValidEmail added in v0.0.7

func IsValidEmail(email string) bool

func LikeArticle added in v0.0.2

func LinksView added in v0.0.3

func LinksView(c *gin.Context)

func Login

func Login(c *gin.Context)

Login 处理登录请求

func LoginView added in v0.0.3

func LoginView(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func MarkAllAsRead

MarkAllAsRead 标记所有通知为已读

func MarkAsRead

MarkAsRead 标记通知为已读

func NotFound

func NotFound(c *gin.Context)

func NotFoundPage added in v0.0.3

func NotFoundPage(c *gin.Context)

NotFoundPage 404页面

func Notifications added in v0.0.3

func Notifications(c *gin.Context)

func Post added in v0.0.3

func Post(c *gin.Context)

func PostDetail added in v0.0.3

func PostDetail(c *gin.Context)

func PrivacyPolicy added in v0.0.3

func PrivacyPolicy(c *gin.Context)

PrivacyPolicy 隐私政策页面

func Profile added in v0.0.3

func Profile(c *gin.Context)

func PublishV3 added in v0.0.3

func PublishV3(c *gin.Context)

func QueryNotificationList added in v0.0.3

func Register

func Register(c *gin.Context)

Register 注册

func RenderErrorPage added in v0.0.3

func RenderErrorPage(c *gin.Context, data ErrorPageData)

RenderErrorPage 渲染错误页面的通用函数

func RenderRobotsTxt

func RenderRobotsTxt(c *gin.Context)

RenderRobotsTxt 渲染 robots.txt

func RenderRssV2

func RenderRssV2(c *gin.Context)

func RenderSitemapXml

func RenderSitemapXml(c *gin.Context)

RenderSitemapXml 渲染 sitemap.xml

func SaveCategory

SaveCategory 保存分类

SaveFooterLinks 保存页脚配置

func SaveImgByGinContext added in v0.0.6

func SaveImgByGinContext(c *gin.Context)

SaveImgByGinContext 处理图片上传请求 包含文件大小限制、格式验证、内容检查等安全措施

func SaveMailSettings added in v0.0.8

SaveMailSettings 保存邮件设置

func SaveSiteSettings added in v0.0.8

SaveSiteSettings 保存站点设置

func SaveSponsors added in v0.0.8

SaveSponsors 保存赞助商配置

func SaveUser added in v0.0.8

func SaveUser(userEntity *users.EntityComplete) error

func SaveWebSettings added in v0.0.5

SaveWebSettings 保存网页设置

func SearchArticles added in v0.0.8

SearchArticles 搜索文章接口 通过名字和类别查询文章,先查Meilisearch索引,再查文章表获取具体数据

func SearchPage added in v0.0.8

func SearchPage(c *gin.Context)

SearchPage 搜索页面

func SendAEmail4User

func SendAEmail4User(userEntity *users.EntityComplete) error

func SponsorsView added in v0.0.3

func SponsorsView(c *gin.Context)

func TakeUpTo64Chars

func TakeUpTo64Chars(s string) string

TakeUpTo64Chars 按字符数截取字符串,最多取 64 个字符

func TermsOfService added in v0.0.3

func TermsOfService(c *gin.Context)

TermsOfService 用户协议页面

func TestMailConnection added in v0.0.8

TestMailConnection 测试邮件连接

func UnauthorizedPage added in v0.0.3

func UnauthorizedPage(c *gin.Context)

UnauthorizedPage 401页面

func UploadAvatar

func UploadAvatar(c *gin.Context)

UploadAvatar 头像上传处理函数

func User added in v0.0.3

func User(c *gin.Context)

func UserInfo

func UserInfo(req component.BetterRequest[null]) component.Response

UserInfo 获取登录用户信息

func ValidatePassword added in v0.0.3

func ValidatePassword(password string) error

ValidatePassword 验证密码复杂度

func ValidateUsername added in v0.0.3

func ValidateUsername(username string) bool

func WriteArticles

WriteArticles 写文章

func WriteArticlesOrigin

WriteArticlesOrigin 写文章

Types

type ApplyAddLinkReq added in v0.0.3

type ApplyAddLinkReq struct {
	SiteName string `json:"siteName" validate:"required"`
	SiteUrl  string `json:"siteUrl" validate:"required"`
	SiteDesc string `json:"siteDesc" validate:"required"`
	Email    string `json:"email"`
	Contact  string `json:"contact"`
}

type ApplySheetListReq added in v0.0.3

type ApplySheetListReq struct {
	Page     int    `form:"page"`
	PageSize int    `form:"pageSize"`
	Search   string `form:"search"`
	UserId   uint64 `form:"userId"`
}

type ApplyShowReq

type ApplyShowReq struct {
	Title     string   `json:"comment"`
	Desc      string   `json:"desc"`
	ImageList []string `json:"imageList"`
}

type ApplyTopReq

type ApplyTopReq struct {
	ArticleId uint64 `json:"articleId"`
}

type ArticleReplyId

type ArticleReplyId struct {
	ArticleId uint64 `json:"articleId"`
	Content   string `json:"content"`
	ReplyId   uint64 `json:"replyId"`
}

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 ArticlesListReq struct {
	Page     int    `form:"page"`
	PageSize int    `form:"pageSize"`
	Search   string `form:"search"`
	UserId   uint64 `form:"userId"`
}

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 CDATA

type CDATA string

func (CDATA) MarshalXML

func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type CategoryItem

type CategoryItem struct {
	Id       uint64 `json:"id"`
	Category string `json:"category"`
	Desc     string `json:"desc"`
	Sort     int    `json:"sort"`
	Status   int8   `json:"status"`
}

type CategoryListReq

type CategoryListReq struct {
	Page     int `json:"page"`
	PageSize int `json:"pageSize"`
}

type CategorySaveReq

type CategorySaveReq struct {
	Id       uint64 `json:"id"`
	Category string `json:"category" validate:"required"`
	Desc     string `json:"desc"`
	Sort     int    `json:"sort"`
	Status   int8   `json:"status"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	OldPassword string `json:"oldPassword" validate:"required"`
	NewPassword string `json:"newPassword" validate:"required"`
}

添加新的请求结构体

type Channel

type Channel struct {
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`
	PubDate     string `xml:"pubDate"`
	Items       []Item `xml:"item"`
}

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

type DocsContentPreviewResponse struct {
	Html string `json:"html"`
	Toc  string `json:"toc"`
}

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 EditArticleReq struct {
	Id            uint64 `json:"id" validate:"required"`
	ProcessStatus int8   `json:"processStatus" validate:"oneof=0 1"` // 0正常 1封禁
}

type EditUserEmailReq added in v0.0.7

type EditUserEmailReq struct {
	Email string `json:"email" validate:"required,email"`
}

type EditUserInfoReq

type EditUserInfoReq struct {
	Nickname            string                    `json:"nickname"`
	Bio                 string                    `json:"bio"`
	Signature           string                    `json:"signature"`
	Website             string                    `json:"website"`
	WebsiteName         string                    `json:"websiteName"`
	ExternalInformation users.ExternalInformation `json:"externalInformation"`
}

type EditUserReq

type EditUserReq struct {
	UserId   uint64 `json:"userId"`
	Status   int8   `json:"status"`
	Validate int8   `json:"validate"`
	RoleId   uint64 `json:"roleId"`
}

type EditUsernameReq added in v0.0.7

type EditUsernameReq struct {
	Username string `json:"username" validate:"required"`
}

type ErrorPageData added in v0.0.3

type ErrorPageData struct {
	Title      string
	Message    string
	ErrorCode  string
	StatusCode int
}

ErrorPageData 错误页面数据结构

type FollowUserReq added in v0.0.3

type FollowUserReq struct {
	Id     uint64 `json:"id"`
	Action int    `json:"action" validate:"min=1,max=2"` // 1 like 2 cancel
}

type ForumInfo added in v0.0.4

type ForumInfo struct {
	Title        string
	Desc         string
	Independence bool
}

func GetGooseForumInfo added in v0.0.4

func GetGooseForumInfo() ForumInfo

type GetAllRoleItemReq

type GetAllRoleItemReq struct {
}

type GetArticlesDetailRequest

type GetArticlesDetailRequest struct {
	Id           uint64 `json:"id"`
	MaxCommentId uint64 `json:"maxCommentId"`
	PageSize     int    `json:"pageSize"`
}

type GetArticlesPageRequest

type GetArticlesPageRequest struct {
	Page       int    `form:"page"`
	PageSize   int    `form:"pageSize"`
	Search     string `form:"search"`
	Categories []int  `form:"categories"`
}

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 GetUnreadCountReq

type GetUnreadCountReq struct{}

GetUnreadCountReq 获取未读数量请求

type GetUserArticlesRequest

type GetUserArticlesRequest struct {
	Page     int `json:"page"`
	PageSize int `json:"pageSize"`
}

添加新的请求结构体

type Item

type Item struct {
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description CDATA  `xml:"description"`
	PubDate     string `xml:"pubDate"`
	GUID        string `xml:"guid"` // 可选唯一标识符
}

type LikeArticleReq added in v0.0.2

type LikeArticleReq struct {
	Id     uint64 `json:"id"`
	Action int    `json:"action" validate:"min=1,max=2"` // 1 like 2 cancel
}

type LinkStatistics added in v0.0.5

type LinkStatistics struct {
	Name       string
	Counter    int
	Proportion int
}

type LinkStatisticsInfo added in v0.0.5

type LinkStatisticsInfo struct {
	Community LinkStatistics
	Blog      LinkStatistics
	Tool      LinkStatistics
}

type LoginReq

type LoginReq struct {
	Username    string `json:"username" validate:"required"` // 可以是用户名或邮箱
	Password    string `json:"password" validate:"required"`
	CaptchaId   string `json:"captchaId"`
	CaptchaCode string `json:"captchaCode"`
}

type MarkAllAsReadReq

type MarkAllAsReadReq struct{}

MarkAllAsReadReq 标记所有通知已读请求

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 PageButton struct {
	Index int
	Page  int
}

type PermissionItem

type PermissionItem struct {
	Id   uint64 `json:"id"`
	Name string `json:"name"`
}

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 RoleSaveReq struct {
	Id          uint     `json:"id"`
	RoleName    string   `json:"roleName" validate:"required"`
	Permissions []uint64 `json:"permissions" validate:"required,min=1,max=100"`
}

type SaveFooterLinksReq added in v0.0.8

type SaveFooterLinksReq struct {
	FooterConfig pageConfig.FooterConfig `json:"footerConfig"`
}

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 TestMailConnectionResp struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

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 UserListReq struct {
	Username string `json:"username"`
	UserId   uint64 `json:"userId"`
	Email    string `json:"email"`
	Page     int    `json:"page"`
	PageSize int    `json:"pageSize"`
}

type WriteArticleReq

type WriteArticleReq struct {
	Id         int64    `json:"id"`
	Content    string   `json:"content" validate:"required"`
	Title      string   `json:"title" validate:"required"`
	Type       int8     `json:"type"`
	CategoryId []uint64 `json:"categoryId" validate:"min=1,max=3"`
}

type WriteArticlesOriginReq

type WriteArticlesOriginReq struct {
	Id int64 `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL