api

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArticleSource added in v0.2.5

func BadgeList added in v0.2.2

func ChangePassword

ChangePassword updates the current user's password.

func DeleteBadge added in v0.2.2

func DeleteCategory

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

DeleteCategory 删除分类

func DeleteChat added in v0.1.1

DeleteChat 删除对话

func DeleteNotification

DeleteNotification 删除通知

func EditArticle

EditArticle 文章状态管理

func EditArticleCategories added in v0.2.2

EditArticleCategories 文章分类管理

func EditUserEmail

EditUserEmail updates the current user's email and resets activation state.

func EditUserInfo

EditUserInfo updates the current user's profile fields.

func EditUsername

EditUsername updates the current user's username.

func ForgotPassword

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

func GetAnnouncement

GetAnnouncement 获取公告设置

func GetCategoryList

GetCategoryList 获取分类列表

func GetChatList added in v0.1.1

GetChatList 获取私信列表

func GetFileByFileName

func GetFileByFileName(c *gin.Context)

func GetLastUnread

GetLastUnread 获取未读通知数量

func GetMailSettings

GetMailSettings 获取邮件设置

func GetMessages added in v0.1.1

GetMessages 获取消息记录

func GetNotificationList

GetNotificationList 获取通知列表

func GetNotificationTypes

GetNotificationTypes 获取所有通知类型

func GetPostingSettings added in v0.1.1

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

GetPostingSettings 获取发布内容设置

func GetSecuritySettings added in v0.1.1

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

GetSecuritySettings 获取安全与注册设置

func GetSiteSettings

GetSiteSettings 获取站点设置

func GetSponsors

GetSponsors 获取赞助商配置

func GetSuggestedUsers added in v0.1.1

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

GetSuggestedUsers 获取推荐用户(关注的人)

func GetTrafficOverview added in v0.1.1

func GetUnreadCount

GetUnreadCount 获取未读通知数量

func GetUnreadStatus added in v0.2.2

func GetUserActivities added in v0.1.1

GetUserActivities returns a user's activity timeline.

func GetUserCard added in v0.1.1

func GetUserHoverCard added in v0.2.1

func MarkAllAsRead

MarkAllAsRead 标记所有通知为已读

func MarkAsRead

MarkAsRead 标记通知为已读

func MarkChatRead added in v0.1.1

MarkChatRead 标记已读

func ResetPassword

ResetPassword 重置密码

func SaveAnnouncement

SaveAnnouncement 保存公告设置

func SaveBadge added in v0.2.2

func SaveCategory

SaveCategory 保存分类

SaveFriendLinks 保存友情链接

func SaveImgByGinContext

func SaveImgByGinContext(c *gin.Context)

SaveImgByGinContext handles image uploads with size and content checks.

func SaveMailSettings

SaveMailSettings 保存邮件设置

func SavePostingSettings added in v0.1.1

SavePostingSettings 保存发布内容设置

func SaveSecuritySettings added in v0.1.1

SaveSecuritySettings 保存安全与注册设置

func SaveSiteSettings

SaveSiteSettings 保存站点设置

func SaveSponsors

SaveSponsors 保存赞助商配置

func SaveUser

func SaveUser(userEntity *users.EntityComplete) error

func SaveUserBadges added in v0.2.2

func SendMessage added in v0.1.1

SendMessage 发送私信

func ServerVersion added in v0.2.6

func TestMailConnection

TestMailConnection 测试邮件连接

func UploadAvatar

func UploadAvatar(c *gin.Context)

UploadAvatar stores a new avatar for the current user.

func UserBadgeOptions added in v0.2.2

func UserInfo

UserInfo returns the current user's profile and statistics.

Types

type ArticleSourceReq added in v0.2.5

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

type ArticleSourceVo added in v0.2.5

type ArticleSourceVo struct {
	Id            uint64   `json:"id"`
	Title         string   `json:"title"`
	Description   string   `json:"description"`
	Content       string   `json:"content"`
	Type          int8     `json:"type"`
	CategoryId    []uint64 `json:"categoryId"`
	UserId        uint64   `json:"userId"`
	ArticleStatus int8     `json:"articleStatus"`
	ProcessStatus int8     `json:"processStatus"`
	CreatedAt     string   `json:"createdAt"`
	UpdatedAt     string   `json:"updatedAt"`
}

type ArticlesInfoAdminVo added in v0.1.1

type ArticlesInfoAdminVo struct {
	Id            uint64   `json:"id"`
	Title         string   `json:"title"`
	Description   string   `json:"description"`
	Type          int8     `json:"type"`
	CategoryId    []uint64 `json:"categoryId"`
	UserId        uint64   `json:"userId"`
	Username      string   `json:"username"`
	UserAvatarUrl string   `json:"userAvatarUrl"`
	ArticleStatus int8     `json:"articleStatus"`
	ProcessStatus int8     `json:"processStatus"`
	ViewCount     uint64   `json:"viewCount"`
	ReplyCount    uint64   `json:"replyCount"`
	LikeCount     uint64   `json:"likeCount"`
	CreatedAt     string   `json:"createdAt"`
	UpdatedAt     string   `json:"updatedAt"`
}

type ArticlesInfoVo added in v0.1.1

type ArticlesInfoVo struct {
	Id            uint64 `json:"id"`
	Title         string `json:"title"`
	Type          int8   `json:"type"`
	UserId        uint64 `json:"userId"`
	Username      string `json:"username"`
	ArticleStatus int8   `json:"articleStatus"`
	ProcessStatus int8   `json:"processStatus"`
	CreatedAt     string `json:"createdAt"`
	UpdatedAt     string `json:"updatedAt"`
}

type ArticlesListReq

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

type BadgeDeleteReq added in v0.2.2

type BadgeDeleteReq struct {
	Code string `json:"code"`
}

type BadgeSaveReq added in v0.2.2

type BadgeSaveReq struct {
	Code        string `json:"code"`
	Type        string `json:"type"`
	GrantMode   string `json:"grantMode"`
	Name        string `json:"name"`
	Description string `json:"description"`
	IconType    string `json:"iconType"`
	IconKey     string `json:"iconKey"`
	IconURL     string `json:"iconUrl"`
	Color       string `json:"color"`
	Level       string `json:"level"`
	IsEnabled   bool   `json:"isEnabled"`
	SortOrder   int    `json:"sortOrder"`
}

type CategoryItem

type CategoryItem struct {
	Id       uint64 `json:"id"`
	Category string `json:"category"`
	Desc     string `json:"desc"`
	Icon     string `json:"icon"`
	Color    string `json:"color"`
	Slug     string `json:"slug"`
	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"`
	Icon     string `json:"icon"`
	Color    string `json:"color"`
	Slug     string `json:"slug"`
	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 is the password change request.

type DailyTraffic added in v0.1.1

type DailyTraffic struct {
	Date         string `json:"date"`
	RegCount     int64  `json:"regCount"`
	ArticleCount int64  `json:"articleCount"`
	ReplyCount   int64  `json:"replyCount"`
}

type DeleteChatReq added in v0.1.1

type DeleteChatReq struct {
	ConvId uint64 `json:"convId" validate:"required"`
}

DeleteChatReq 删除对话请求

type DeleteNotificationReq

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

DeleteNotificationReq 删除通知请求

type EditArticleCategoriesReq added in v0.2.2

type EditArticleCategoriesReq struct {
	Id         uint64   `json:"id" validate:"required"`
	CategoryId []uint64 `json:"categoryId" validate:"min=1,max=3"`
}

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 is the password reset email request.

type GetAllRoleItemReq

type GetAllRoleItemReq struct {
}

type GetChatListReq added in v0.1.1

type GetChatListReq struct {
}

GetChatListReq 获取私信列表请求

type GetMessagesReq added in v0.1.1

type GetMessagesReq struct {
	ConvId   uint64 `json:"convId" validate:"required"`
	Page     int    `json:"page" validate:"required,min=1"`
	PageSize int    `json:"pageSize" validate:"required,min=1,max=100"`
}

GetMessagesReq 获取消息记录请求

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 GetUserActivitiesReq added in v0.1.1

type GetUserActivitiesReq struct {
	UserId uint64 `form:"userId" validate:"required"`
	LastId uint64 `form:"lastId"`
	Limit  int    `form:"limit" validate:"max=50"`
}

type GetUserCardReq added in v0.1.1

type GetUserCardReq struct {
	UserId uint64 `form:"userId" json:"userId" binding:"required"`
}

type MarkAllAsReadReq

type MarkAllAsReadReq struct{}

MarkAllAsReadReq 标记所有通知已读请求

type MarkAsReadReq

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

MarkAsReadReq 标记通知已读请求

type MarkReadReq added in v0.1.1

type MarkReadReq struct {
	ConvId uint64 `json:"convId" validate:"required"`
}

MarkReadReq 标记已读请求

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 is the password reset confirmation request.

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 SaveFriendLinksReq

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

type SaveMailSettingsReq

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

type SavePostingSettingsReq added in v0.1.1

type SavePostingSettingsReq struct {
	Settings pageConfig.PostingContent `json:"settings" validate:"required"`
}

type SaveSecuritySettingsReq added in v0.1.1

type SaveSecuritySettingsReq struct {
	Settings pageConfig.SecurityAndRegistration `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 SaveUserBadgesReq added in v0.2.2

type SaveUserBadgesReq struct {
	UserId     uint64   `json:"userId"`
	BadgeCodes []string `json:"badgeCodes"`
}

type SendMessageReq added in v0.1.1

type SendMessageReq struct {
	PeerId  uint64 `json:"peerId" validate:"required"`
	Content string `json:"content" validate:"required"`
	MsgType int8   `json:"msgType" validate:"oneof=1 2 3"` // 1: Text, 2: Image, 3: Voice
}

SendMessageReq 发送私信请求

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 TrafficOverviewReq added in v0.1.1

type TrafficOverviewReq struct {
	StartDate string `json:"startDate"` // YYYY-MM-DD
	EndDate   string `json:"endDate"`   // YYYY-MM-DD
}

type UserBadgeOptionsReq added in v0.2.2

type UserBadgeOptionsReq struct {
	UserId uint64 `json:"userId"`
}

type UserBadgeOptionsResp added in v0.2.2

type UserBadgeOptionsResp struct {
	Options []badgeservice.Badge     `json:"options"`
	Active  []badgeservice.UserBadge `json:"active"`
}

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"`
	Badges         []badgeservice.UserBadge            `json:"badges"`
}

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