controllers

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateAccount

func ActivateAccount(c *gin.Context)

ActivateAccount 激活处理函数

func BookmarkArticle added in v0.0.9

func DeleteArticle added in v0.1.1

func FollowUser added in v0.0.3

func GetArticlesEnum

func GetArticlesEnum() component.Response

func GetOAuthBindings added in v0.0.9

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

GetOAuthBindings 获取用户的OAuth绑定状态

func GetSiteStatistics

func GetSiteStatistics() component.Response

func GetUserArticles

GetUserArticles 获取用户文章列表

func GetUserBookmarkedArticles added in v0.0.9

GetUserBookmarkedArticles 获取用户收藏文章列表

func LikeArticle added in v0.0.2

func Login

func Login(c *gin.Context)

Login 处理登录请求

func LoginPublicKey added in v0.2.1

func LoginPublicKey(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func NotFound

func NotFound(c *gin.Context)

func ProviderCallback added in v0.0.9

func ProviderCallback(c *gin.Context)

ProviderCallback 处理OAuth登录/绑定回调(根据登录状态自动判断)

func ProviderLogin added in v0.0.9

func ProviderLogin(c *gin.Context)

ProviderLogin 开始OAuth登录/绑定流程(根据登录状态自动判断)

func Register

func Register(c *gin.Context)

Register 注册

func RenderRobotsTxt

func RenderRobotsTxt(c *gin.Context)

RenderRobotsTxt renders robots.txt.

func RenderRss added in v0.2.1

func RenderRss(c *gin.Context)

func RenderSitemapXml

func RenderSitemapXml(c *gin.Context)

RenderSitemapXml renders sitemap.xml.

func SearchArticles added in v0.0.8

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

func UnbindOAuth added in v0.0.9

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

UnbindOAuth 解绑OAuth账户

func WriteArticles

WriteArticles 创建或更新文章。

func WriteArticlesOrigin

WriteArticlesOrigin 返回当前用户可编辑文章的原始内容。

Types

type ActivateAccountData added in v0.1.1

type ActivateAccountData struct {
	Title       string
	Status      string
	Message     string
	Success     bool
	Description string
}

ActivateAccountData 激活页面数据

type ArticleReplyId

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

type BookmarkArticleReq added in v0.0.9

type BookmarkArticleReq struct {
	Id     uint64 `json:"id"`
	Action int    `json:"action" validate:"min=1,max=2"` // 1 收藏,2 取消
}

type DeleteArticleReq added in v0.1.1

type DeleteArticleReq struct {
	Id uint64 `json:"id"`
}

type DeleteReplyId

type DeleteReplyId struct {
	ReplyId uint64 `json:"replyId"`
}

type FollowUserReq added in v0.0.3

type FollowUserReq struct {
	Id     uint64 `json:"id"`
	Action int    `json:"action" validate:"min=1,max=2"` // 1 关注,2 取消
}

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 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 GetUserArticlesRequest

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

GetUserArticlesRequest 用户文章列表请求。

type GetUserBookmarkedArticlesRequest added in v0.0.9

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

GetUserBookmarkedArticlesRequest 用户收藏文章列表请求。

type LikeArticleReq added in v0.0.2

type LikeArticleReq struct {
	Id     uint64 `json:"id"`
	Action int    `json:"action" validate:"min=1,max=2"` // 1 点赞,2 取消
}

type LoginReq

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

type ReplyVo added in v0.1.1

type ReplyVo 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"`
	IsOwnReply      bool   `json:"isOwnReply"`
}

type SearchArticlesRequest added in v0.0.8

type SearchArticlesRequest struct {
	Query      string   `json:"query" form:"query" validate:"required,min=1,max=100"` // 搜索关键词
	Categories []uint64 `json:"categories" form:"categories"`                         // 分类ID列表
	Page       int      `json:"page" form:"page"`                                     // 页码,从1开始
	PageSize   int      `json:"pageSize" form:"pageSize"`                             // 每页数量
}

SearchArticlesRequest 搜索文章请求结构

type SitemapURL added in v0.0.9

type SitemapURL struct {
	Loc      string
	Lastmod  string
	Priority float64
}

type UserData added in v0.1.1

type UserData struct {
	Articles       []*vo.ArticlesSimpleVo
	UserDetail     *vo.UserCard
	FollowingList  []*users.EntityComplete
	FollowerList   []*users.EntityComplete
	Activities     []*userActivities.Entity
	MyFollowingIds []uint64
	IsOwnProfile   bool
}

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