api

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminDocsContentCreate

func AdminDocsContentCreate(req component.BetterRequest[DocsContentCreateReq]) component.Response

AdminDocsContentCreate 创建内容

func AdminDocsContentDelete

func AdminDocsContentDelete(req component.BetterRequest[DocsContentDeleteReq]) component.Response

AdminDocsContentDelete 删除内容

func AdminDocsContentDetail

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

AdminDocsContentDetail 内容详情

func AdminDocsContentDraft

func AdminDocsContentDraft(req component.BetterRequest[DocsContentDraftReq]) component.Response

AdminDocsContentDraft 设为草稿

func AdminDocsContentList

func AdminDocsContentList(req component.BetterRequest[DocsContentListReq]) component.Response

AdminDocsContentList 内容列表

func AdminDocsContentPreview

func AdminDocsContentPreview(req component.BetterRequest[DocsContentPreviewReq]) component.Response

AdminDocsContentPreview 预览内容

func AdminDocsContentPublish

func AdminDocsContentPublish(req component.BetterRequest[DocsContentPublishReq]) component.Response

AdminDocsContentPublish 发布内容

func AdminDocsContentUpdate

func AdminDocsContentUpdate(req component.BetterRequest[DocsContentUpdateReq]) component.Response

AdminDocsContentUpdate 更新内容

func AdminDocsProjectCreate

func AdminDocsProjectCreate(req component.BetterRequest[DocsProjectCreateReq]) component.Response

AdminDocsProjectCreate 创建项目

func AdminDocsProjectDelete

func AdminDocsProjectDelete(req component.BetterRequest[DocsProjectDeleteReq]) component.Response

AdminDocsProjectDelete 删除项目(软删除)

func AdminDocsProjectDetail

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

AdminDocsProjectDetail 获取项目详情

func AdminDocsProjectList

func AdminDocsProjectList(req component.BetterRequest[DocsProjectListReq]) component.Response

AdminDocsProjectList 获取项目列表

func AdminDocsProjectUpdate

func AdminDocsProjectUpdate(req component.BetterRequest[DocsProjectUpdateReq]) component.Response

AdminDocsProjectUpdate 更新项目

func AdminDocsVersionCreate

func AdminDocsVersionCreate(req component.BetterRequest[DocsVersionCreateReq]) component.Response

AdminDocsVersionCreate 创建版本

func AdminDocsVersionDelete

func AdminDocsVersionDelete(req component.BetterRequest[DocsVersionDeleteReq]) component.Response

AdminDocsVersionDelete 删除版本(软删除)

func AdminDocsVersionDetail

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

AdminDocsVersionDetail 获取版本详情

func AdminDocsVersionDirectoryUpdate

func AdminDocsVersionDirectoryUpdate(req component.BetterRequest[DocsVersionDirectoryUpdateReq]) component.Response

AdminDocsVersionDirectoryUpdate 更新版本目录结构

func AdminDocsVersionList

func AdminDocsVersionList(req component.BetterRequest[DocsVersionListReq]) component.Response

AdminDocsVersionList 获取版本列表

func AdminDocsVersionSetDefault

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

AdminDocsVersionSetDefault 设置默认版本

func AdminDocsVersionUpdate

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

AdminDocsVersionUpdate 更新版本

func ChangePassword

ChangePassword 添加修改密码的处理函数

func DeleteCategory

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

DeleteCategory 删除分类

func DeleteNotification

DeleteNotification 删除通知

func EditArticle

EditArticle 文章状态管理

func EditUserEmail

EditUserEmail 编辑用户

func EditUserInfo

EditUserInfo 编辑用户

func EditUsername

EditUsername 编辑用户

func ForgotPassword

ForgotPassword 忘记密码 - 发送重置邮件

func GetAnnouncement

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

GetAnnouncement 获取公告设置

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

GetLastUnread 获取未读通知数量

func GetMailSettings

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

GetMailSettings 获取邮件设置

func GetNotificationList

GetNotificationList 获取通知列表

func GetNotificationTypes

GetNotificationTypes 获取所有通知类型

func GetSiteSettings

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

GetSiteSettings 获取站点设置

func GetSponsors

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

GetSponsors 获取赞助商配置

func GetUnreadCount

GetUnreadCount 获取未读通知数量

func GetWebSettings

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

GetWebSettings 获取网页设置

func Invitation

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

func MarkAllAsRead

MarkAllAsRead 标记所有通知为已读

func MarkAsRead

MarkAsRead 标记通知为已读

func ResetPassword

ResetPassword 重置密码

func SaveAnnouncement

SaveAnnouncement 保存公告设置

func SaveCategory

SaveCategory 保存分类

SaveFooterLinks 保存页脚配置

func SaveImgByGinContext

func SaveImgByGinContext(c *gin.Context)

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

func SaveMailSettings

SaveMailSettings 保存邮件设置

func SaveSiteSettings

SaveSiteSettings 保存站点设置

func SaveSponsors

SaveSponsors 保存赞助商配置

func SaveUser

func SaveUser(userEntity *users.EntityComplete) error

func SaveWebSettings

SaveWebSettings 保存网页设置

func TestMailConnection

TestMailConnection 测试邮件连接

func UploadAvatar

func UploadAvatar(c *gin.Context)

UploadAvatar 头像上传处理函数

func UserInfo

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

UserInfo 获取登录用户信息

Types

type ApplyAddLinkReq

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

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

type ArticlesInfoAdminDto

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 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"`
}

ChangePasswordReq 添加新的请求结构体

type DeleteNotificationReq

type DeleteNotificationReq struct {
	NotificationId uint64 `json:"notificationId" validate:"required"`
}

DeleteNotificationReq 删除通知请求

type DocsContentCreateReq

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

type DocsContentDeleteReq struct {
	Id uint64 `json:"id" validate:"required"`
}

DocsContentDeleteReq 删除内容请求

type DocsContentDraftReq

type DocsContentDraftReq struct {
	Id uint64 `json:"id" validate:"required"`
}

DocsContentDraftReq 设为草稿请求

type DocsContentItem

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

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

type DocsContentPreviewReq struct {
	Content string `json:"content" validate:"required"`
}

DocsContentPreviewReq 预览内容请求

type DocsContentPreviewResponse

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

DocsContentPreviewResponse 预览响应

type DocsContentPublishReq

type DocsContentPublishReq struct {
	Id uint64 `json:"id" validate:"required"`
}

DocsContentPublishReq 发布内容请求

type DocsContentUpdateReq

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

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

type DocsProjectDeleteReq struct {
	Id uint64 `json:"id" validate:"required"`
}

DocsProjectDeleteReq 删除项目请求

type DocsProjectItem

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

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

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

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

type DocsVersionDeleteReq struct {
}

DocsVersionDeleteReq 删除版本请求

type DocsVersionDirectoryUpdateReq

type DocsVersionDirectoryUpdateReq struct {
	DirectoryStructure []docVersions.DirectoryItem `json:"directoryStructure"`
}

DocsVersionDirectoryUpdateReq 更新目录结构请求

type DocsVersionItem

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

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

type DocsVersionSetDefaultReq struct {
	Id uint64 `json:"id" validate:"required"`
}

DocsVersionSetDefaultReq 设置默认版本请求

type DocsVersionUpdateReq

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

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

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

type ForgotPasswordReq

type ForgotPasswordReq struct {
	Email       string `json:"email" validate:"required,email"`
	CaptchaId   string `json:"captchaId" validate:"required"`
	CaptchaCode string `json:"captchaCode" validate:"required"`
}

ForgotPasswordReq 忘记密码请求结构体

type GetAllRoleItemReq

type GetAllRoleItemReq struct {
}

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 MarkAllAsReadReq

type MarkAllAsReadReq struct{}

MarkAllAsReadReq 标记所有通知已读请求

type MarkAsReadReq

type MarkAsReadReq struct {
	NotificationId uint64 `json:"notificationId" validate:"required"`
}

MarkAsReadReq 标记通知已读请求

type OptRecordPageReq

type OptRecordPageReq struct {
}

type PermissionItem

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

type PermissionListReq

type PermissionListReq struct {
}

type QueryNotificationListReq

type QueryNotificationListReq struct {
	StartId    int  `json:"startId"`
	PageSize   int  `json:"pageSize" validate:"required,min=1,max=100"`
	UnreadOnly bool `json:"unreadOnly"`
}

QueryNotificationListReq 获取通知列表请求

type ResetPasswordReq

type ResetPasswordReq struct {
	Token       string `json:"token" validate:"required"`
	NewPassword string `json:"newPassword" validate:"required"`
}

ResetPasswordReq 重置密码请求结构体

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 SaveAnnouncementReq

type SaveAnnouncementReq struct {
	Settings pageConfig.AnnouncementConfig `json:"settings" validate:"required"`
}

type SaveFooterLinksReq

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

type SaveFriendLinksReq

type SaveFriendLinksReq struct {
	LinksInfo []pageConfig.FriendLinksGroup `json:"linksInfo"`
}

type SaveMailSettingsReq

type SaveMailSettingsReq struct {
	Settings pageConfig.MailSettingsConfig `json:"settings" validate:"required"`
}

type SaveSiteSettingsReq

type SaveSiteSettingsReq struct {
	Settings pageConfig.SiteSettingsConfig `json:"settings"`
}

type SaveSponsorsReq

type SaveSponsorsReq struct {
	SponsorsInfo pageConfig.SponsorsConfig `json:"sponsorsInfo"`
}

type SaveWebSettingsReq

type SaveWebSettingsReq struct {
	Settings pageConfig.WebSettingsConfig `json:"settings"`
}

type TestMailConnectionReq

type TestMailConnectionReq struct {
	Settings  pageConfig.MailSettingsConfig `json:"settings" validate:"required"`
	TestEmail string                        `json:"testEmail" validate:"required,email"`
}

type TestMailConnectionResp

type TestMailConnectionResp struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

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"`
	LastActiveTime string                              `json:"lastActiveTime"`
}

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"`
}

Jump to

Keyboard shortcuts

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