forum

package
v0.2.63 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessGroups added in v0.2.61

func AccessGroups(c *gin.Context)

func Category

func Category(c *gin.Context)

func CreateReport added in v0.2.38

func Drafts added in v0.2.8

func Drafts(c *gin.Context)

func Home

func Home(c *gin.Context)
func Links(c *gin.Context)

func Login

func Login(c *gin.Context)

func Manage added in v0.2.8

func Manage(c *gin.Context)

func Messages

func Messages(c *gin.Context)

func Moderation added in v0.2.36

func Moderation(c *gin.Context)

func ModerationLogList added in v0.2.36

func ModerationReportList added in v0.2.38

func Notifications

func Notifications(c *gin.Context)

func PostWindow added in v0.2.49

func Publish

func Publish(c *gin.Context)

func ReloadTemplates

func ReloadTemplates()

func RenderErrorPage added in v0.2.14

func RenderErrorPage(c *gin.Context, status int, title string, messageCode component.MessageCode, params component.MessageParams)

RenderErrorPage renders the shared site error page for browser-facing flows that live outside the forum package, such as OAuth callbacks.

func RenderInternalOAuthErrorPage added in v0.2.14

func RenderInternalOAuthErrorPage(c *gin.Context, messageCode component.MessageCode)

func RenderNotFoundPage added in v0.2.14

func RenderNotFoundPage(c *gin.Context, messageCode component.MessageCode)

func RenderOAuthErrorPage added in v0.2.14

func RenderOAuthErrorPage(c *gin.Context, status int, messageCode component.MessageCode)

func ResetPassword

func ResetPassword(c *gin.Context)
func Search(c *gin.Context)

func Settings

func Settings(c *gin.Context)

func SiteThemeCSS added in v0.2.23

func SiteThemeCSS(c *gin.Context)

func Sponsors

func Sponsors(c *gin.Context)

func ThemePreview added in v0.2.23

func ThemePreview(c *gin.Context)

func TopicDetail added in v0.2.49

func TopicDetail(c *gin.Context)

func UpdateModerationPostStatus added in v0.2.49

func UpdateModerationPostStatus(req component.BetterRequest[ModerationPostStatusReq]) component.Response

func UpdateModerationReportStatus added in v0.2.38

func UpdateModerationReportStatus(req component.BetterRequest[ModerationReportStatusReq]) component.Response

func UpdateModerationTopicStatus added in v0.2.49

func UpdateModerationTopicStatus(req component.BetterRequest[ModerationTopicStatusReq]) component.Response

func UserProfile

func UserProfile(c *gin.Context)

Types

type AnnouncementPayload

type AnnouncementPayload struct {
	Enabled     bool   `json:"enabled"`
	HTML        string `json:"html"`
	PublishedAt string `json:"publishedAt,omitempty"`
}

type CategoryHeaderPayload

type CategoryHeaderPayload struct {
	ID          uint64 `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Color       string `json:"color"`
	URL         string `json:"url"`
}

type CategoryNavPayload

type CategoryNavPayload struct {
	ID    uint64 `json:"id"`
	Label string `json:"label"`
	URL   string `json:"url"`
	Color string `json:"color"`
}

type CategoryPageProps

type CategoryPageProps struct {
	Category   CategoryHeaderPayload `json:"category"`
	Sort       string                `json:"sort"`
	Tabs       []TabPayload          `json:"tabs"`
	Topics     []TopicPayload        `json:"topics"`
	Pagination PaginationPayload     `json:"pagination"`
}

type CreateReportReq added in v0.2.38

type CreateReportReq struct {
	TargetType string `json:"targetType" validate:"required,oneof=topic post"`
	TargetId   uint64 `json:"targetId" validate:"required"`
	Reason     string `json:"reason" validate:"required,oneof=spam abuse illegal irrelevant other"`
	Note       string `json:"note"`
}

type DraftPayload added in v0.2.8

type DraftPayload struct {
	ID            uint64                 `json:"id"`
	Title         string                 `json:"title"`
	Description   string                 `json:"description"`
	EditURL       string                 `json:"editUrl"`
	ReplyCount    uint64                 `json:"replyCount"`
	ViewCount     uint64                 `json:"viewCount"`
	ProcessStatus int8                   `json:"processStatus"`
	UpdatedAt     string                 `json:"updatedAt"`
	CreatedAt     string                 `json:"createdAt"`
	Categories    []TopicCategoryPayload `json:"categories"`
}

type DraftsPageProps added in v0.2.8

type DraftsPageProps struct {
	Total      int64             `json:"total"`
	Drafts     []DraftPayload    `json:"drafts"`
	Pagination PaginationPayload `json:"pagination"`
}

type ErrorPageProps

type ErrorPageProps struct {
	Code        string                  `json:"code"`
	Title       string                  `json:"title"`
	MessageCode component.MessageCode   `json:"messageCode,omitempty"`
	Params      component.MessageParams `json:"params,omitempty"`
}

type FooterPayload

type FooterPayload struct {
	Links   []pageConfig.FooterItem `json:"links"`
	Primary []string                `json:"primary"`
}

type FriendLinkPayload

type FriendLinkPayload struct {
	Name    string `json:"name"`
	Desc    string `json:"desc"`
	URL     string `json:"url"`
	LogoURL string `json:"logoUrl"`
}

type HomeProps

type HomeProps struct {
	Sort         string              `json:"sort"`
	Tabs         []TabPayload        `json:"tabs"`
	Topics       []TopicPayload      `json:"topics"`
	Pagination   PaginationPayload   `json:"pagination"`
	Announcement AnnouncementPayload `json:"announcement"`
}

type LayoutPayload

type LayoutPayload struct {
	Site    SitePayload         `json:"site"`
	Viewer  ViewerPayload       `json:"viewer"`
	Header  []NavItemPayload    `json:"header,omitempty"`
	Sidebar SidebarPayload      `json:"sidebar"`
	Footer  FooterPayload       `json:"footer"`
	Unread  UnreadStatusPayload `json:"unread"`
	Theme   ThemePayload        `json:"theme"`
}

type LinkGroupPayload

type LinkGroupPayload struct {
	Name  string              `json:"name"`
	Emoji string              `json:"emoji"`
	Color string              `json:"color"`
	Links []FriendLinkPayload `json:"links"`
}

type LinksPageProps

type LinksPageProps struct {
	Groups     []LinkGroupPayload `json:"groups"`
	TotalCount int                `json:"totalCount"`
}

type LoginPageProps

type LoginPageProps struct {
	InitialMode string `json:"initialMode"`
	RedirectURL string `json:"redirectUrl"`
	GitHubURL   string `json:"githubUrl"`
	GoogleReady bool   `json:"googleReady"`
}

type ManageHomeProps added in v0.2.8

type ManageHomeProps struct{}

type MessagesPageProps

type MessagesPageProps struct {
	Conversations  []*vo.ChatItemVo        `json:"conversations"`
	SuggestedUsers []UserConnectionPayload `json:"suggestedUsers"`
}

type ModerationLogItem added in v0.2.36

type ModerationLogItem struct {
	ID          uint64                 `json:"id"`
	Action      string                 `json:"action"`
	Actor       TopicAuthorPayload     `json:"actor"`
	Subject     ModerationLogSubject   `json:"subject"`
	Categories  []TopicCategoryPayload `json:"categories"`
	MessageCode string                 `json:"messageCode"`
	Params      map[string]any         `json:"params"`
	CreatedAt   string                 `json:"createdAt"`
}

type ModerationLogListReq added in v0.2.36

type ModerationLogListReq struct {
	Cursor   uint64 `json:"cursor"`
	PageSize int    `json:"pageSize"`
}

type ModerationLogListResponse added in v0.2.36

type ModerationLogListResponse struct {
	Items      []ModerationLogItem `json:"items"`
	NextCursor uint64              `json:"nextCursor"`
	HasNext    bool                `json:"hasNext"`
}

type ModerationLogSubject added in v0.2.36

type ModerationLogSubject struct {
	Type    string `json:"type"`
	ID      uint64 `json:"id"`
	Title   string `json:"title"`
	URL     string `json:"url,omitempty"`
	Excerpt string `json:"excerpt,omitempty"`
}

type ModerationPageProps added in v0.2.36

type ModerationPageProps struct {
	CategoryTabs []TabPayload      `json:"categoryTabs"`
	Topics       []TopicPayload    `json:"topics"`
	Pagination   PaginationPayload `json:"pagination"`
}

type ModerationPostStatusReq added in v0.2.49

type ModerationPostStatusReq struct {
	PostId uint64 `json:"postId" validate:"required"`
	Action string `json:"action" validate:"oneof=ban unban"`
}

type ModerationReportItem added in v0.2.38

type ModerationReportItem struct {
	ID         uint64                 `json:"id"`
	TargetType string                 `json:"targetType"`
	TargetID   uint64                 `json:"targetId"`
	TargetURL  string                 `json:"targetUrl"`
	Title      string                 `json:"title"`
	Excerpt    string                 `json:"excerpt"`
	Reason     string                 `json:"reason"`
	Note       string                 `json:"note"`
	Status     string                 `json:"status"`
	Resolution string                 `json:"resolution"`
	Reporter   TopicAuthorPayload     `json:"reporter"`
	Handler    TopicAuthorPayload     `json:"handler"`
	Categories []TopicCategoryPayload `json:"categories"`
	CreatedAt  string                 `json:"createdAt"`
	HandledAt  string                 `json:"handledAt,omitempty"`
}

type ModerationReportListReq added in v0.2.38

type ModerationReportListReq struct {
	Status   string `json:"status" validate:"omitempty,oneof=open closed resolved rejected"`
	Cursor   uint64 `json:"cursor"`
	PageSize int    `json:"pageSize"`
	Category uint64 `json:"category"`
}

type ModerationReportListResponse added in v0.2.38

type ModerationReportListResponse struct {
	Items      []ModerationReportItem `json:"items"`
	NextCursor uint64                 `json:"nextCursor"`
	HasNext    bool                   `json:"hasNext"`
}

type ModerationReportStatusReq added in v0.2.38

type ModerationReportStatusReq struct {
	Id     uint64 `json:"id" validate:"required"`
	Action string `json:"action" validate:"oneof=ban resolve reject"`
}

type ModerationTopicStatusReq added in v0.2.49

type ModerationTopicStatusReq struct {
	TopicId uint64 `json:"topicId" validate:"required"`
	Action  string `json:"action" validate:"oneof=ban unban"`
}
type NavItemPayload struct {
	Key       string `json:"key"`
	Label     string `json:"label"`
	I18nLabel string `json:"i18nLabel,omitempty"`
	URL       string `json:"url"`
}

type NotificationPayload

type NotificationPayload struct {
	ID        uint64                                `json:"id"`
	EventType string                                `json:"eventType"`
	IsRead    bool                                  `json:"isRead"`
	CreatedAt string                                `json:"createdAt"`
	Title     string                                `json:"title"`
	Content   string                                `json:"content"`
	Actor     TopicAuthorPayload                    `json:"actor"`
	Topic     *NotificationTopicPayload             `json:"topic,omitempty"`
	Payload   eventNotification.NotificationPayload `json:"payload"`
}

func BuildNotificationPayload added in v0.2.12

func BuildNotificationPayload(notification *eventNotification.Entity) NotificationPayload

func BuildNotificationPayloads added in v0.2.49

func BuildNotificationPayloads(notifications []*eventNotification.Entity) []NotificationPayload

type NotificationTopicPayload added in v0.2.49

type NotificationTopicPayload struct {
	ID    uint64 `json:"id"`
	Title string `json:"title"`
	URL   string `json:"url"`
}

type NotificationsPageProps

type NotificationsPageProps struct {
	Total         int64                 `json:"total"`
	UnreadCount   int64                 `json:"unreadCount"`
	Notifications []NotificationPayload `json:"notifications"`
	Pagination    PaginationPayload     `json:"pagination"`
}

type OpenGraphMeta added in v0.2.2

type OpenGraphMeta struct {
	Title         string   `json:"title,omitempty"`
	Description   string   `json:"description,omitempty"`
	Type          string   `json:"type,omitempty"`
	URL           string   `json:"url,omitempty"`
	SiteName      string   `json:"siteName,omitempty"`
	Image         string   `json:"image,omitempty"`
	PublishedTime string   `json:"publishedTime,omitempty"`
	ModifiedTime  string   `json:"modifiedTime,omitempty"`
	Author        string   `json:"author,omitempty"`
	Section       string   `json:"section,omitempty"`
	Tags          []string `json:"tags,omitempty"`
}

type PageComponent added in v0.2.59

type PageComponent string
const (
	PageComponentHome          PageComponent = "home.index"
	PageComponentTopic         PageComponent = "topic.detail"
	PageComponentUser          PageComponent = "user.profile"
	PageComponentCategory      PageComponent = "category.index"
	PageComponentLinks         PageComponent = "links.index"
	PageComponentSponsors      PageComponent = "sponsors.index"
	PageComponentNotifications PageComponent = "notifications.index"
	PageComponentMessages      PageComponent = "messages.index"
	PageComponentDrafts        PageComponent = "drafts.index"
	PageComponentModeration    PageComponent = "moderation.index"
	PageComponentSettings      PageComponent = "settings.index"
	PageComponentAccessGroups  PageComponent = "access-groups.index"
	PageComponentThemePreview  PageComponent = "theme.preview"
	PageComponentPublish       PageComponent = "publish.index"
	PageComponentSearch        PageComponent = "search.index"
	PageComponentLogin         PageComponent = "auth.login"
	PageComponentResetPassword PageComponent = "auth.resetPassword"
	PageComponentError         PageComponent = "error.index"
	PageComponentAdmin         PageComponent = "admin.shell"
)

type PageMeta

type PageMeta struct {
	Title       string         `json:"title"`
	Description string         `json:"description,omitempty"`
	Canonical   string         `json:"canonical,omitempty"`
	PrevURL     string         `json:"prevUrl,omitempty"`
	NextURL     string         `json:"nextUrl,omitempty"`
	Robots      string         `json:"robots,omitempty"`
	OpenGraph   *OpenGraphMeta `json:"openGraph,omitempty"`
	Twitter     *TwitterMeta   `json:"twitter,omitempty"`
	JSONLD      any            `json:"jsonLd,omitempty"`
}

type PagePayload

type PagePayload struct {
	Component PageComponent `json:"component"`
	Props     any           `json:"props"`
	Meta      PageMeta      `json:"meta"`
	Layout    LayoutPayload `json:"layout"`
	URL       string        `json:"url"`
	Version   string        `json:"version"`
}

type PaginationPayload

type PaginationPayload struct {
	Page     int    `json:"page"`
	NextPage int    `json:"nextPage"`
	HasNext  bool   `json:"hasNext"`
	NextURL  string `json:"nextUrl"`
}

type PostPayload added in v0.2.49

type PostPayload struct {
	ID              uint64             `json:"id"`
	TopicID         uint64             `json:"topicId"`
	PostNo          uint64             `json:"postNo"`
	Content         string             `json:"content"`
	RenderedContent string             `json:"renderedContent"`
	ProcessStatus   int8               `json:"processStatus"`
	IsHidden        bool               `json:"isHidden"`
	CanModerate     bool               `json:"canModerate"`
	Author          TopicAuthorPayload `json:"author"`
	CreatedAt       string             `json:"createdAt"`
	ReplyToPostID   uint64             `json:"replyToPostId,omitempty"`
	ReplyToUserID   uint64             `json:"replyToUserId,omitempty"`
	ReplyToUsername string             `json:"replyToUsername,omitempty"`
	IsOwnPost       bool               `json:"isOwnPost"`
	UpdatedAt       string             `json:"updatedAt"`
}

type PostWindowPayload added in v0.2.49

type PostWindowPayload struct {
	Posts        []PostPayload        `json:"posts"`
	ReplyTargets []ReplyTargetPayload `json:"replyTargets"`
	AnchorPostID uint64               `json:"anchorPostId,omitempty"`
	BeforePostNo uint64               `json:"beforePostNo,omitempty"`
	AfterPostNo  uint64               `json:"afterPostNo,omitempty"`
	HasBefore    bool                 `json:"hasBefore"`
	HasAfter     bool                 `json:"hasAfter"`
	Total        int64                `json:"total"`
	MaxPostNo    uint64               `json:"maxPostNo"`
}

type PostWindowReq added in v0.2.49

type PostWindowReq struct {
	TopicID      uint64 `form:"topicId"`
	AnchorPostID uint64 `form:"anchorPostId"`
	AnchorPostNo uint64 `form:"anchorPostNo"`
	BeforePostNo uint64 `form:"beforePostNo"`
	AfterPostNo  uint64 `form:"afterPostNo"`
	Limit        int    `form:"limit"`
}

type PublishCategoryPayload

type PublishCategoryPayload struct {
	ID           uint64 `json:"id"`
	Name         string `json:"name"`
	Color        string `json:"color"`
	IsRestricted bool   `json:"isRestricted"`
	CanCreate    bool   `json:"canCreate"`
}

type PublishPageProps

type PublishPageProps struct {
	TopicID    uint64                   `json:"topicId"`
	IsEditing  bool                     `json:"isEditing"`
	Categories []PublishCategoryPayload `json:"categories"`
	Topic      PublishTopicPayload      `json:"topic"`
}

type PublishTopicPayload added in v0.2.49

type PublishTopicPayload struct {
	Title       string   `json:"title"`
	Content     string   `json:"content"`
	CategoryIDs []uint64 `json:"categoryIds"`
	TopicStatus int8     `json:"topicStatus"`
}

type ReplyTargetPayload added in v0.2.53

type ReplyTargetPayload struct {
	ID              uint64             `json:"id"`
	PostNo          uint64             `json:"postNo,omitempty"`
	Author          TopicAuthorPayload `json:"author"`
	RenderedContent string             `json:"renderedContent,omitempty"`
	Unavailable     bool               `json:"unavailable,omitempty"`
}

type ResetPasswordPageProps

type ResetPasswordPageProps struct {
	Token string `json:"token"`
}

type SearchPageProps

type SearchPageProps struct {
	Query      string            `json:"query"`
	Topics     []TopicPayload    `json:"topics"`
	Total      int64             `json:"total"`
	TotalPages int               `json:"totalPages"`
	Pagination PaginationPayload `json:"pagination"`
}

type SettingsPageProps

type SettingsPageProps struct {
	User  *vo.UserDetailedVo   `json:"user"`
	Stats SettingsStatsPayload `json:"stats"`
	Tabs  []TabPayload         `json:"tabs"`
}

type SettingsStatsPayload

type SettingsStatsPayload struct {
	TopicCount        uint   `json:"topicCount"`
	ReplyCount        uint   `json:"replyCount"`
	FollowerCount     uint   `json:"followerCount"`
	FollowingCount    uint   `json:"followingCount"`
	LikeReceivedCount uint   `json:"likeReceivedCount"`
	LikeGivenCount    uint   `json:"likeGivenCount"`
	CollectionCount   uint   `json:"collectionCount"`
	CreatedAt         string `json:"createdAt"`
}

type SidebarGroupPayload added in v0.2.45

type SidebarGroupPayload struct {
	Key       string           `json:"key"`
	Title     string           `json:"title"`
	I18nLabel string           `json:"i18nLabel,omitempty"`
	Items     []NavItemPayload `json:"items"`
}

type SidebarPayload

type SidebarPayload struct {
	Main       []NavItemPayload      `json:"main,omitempty"`
	Resources  []NavItemPayload      `json:"resources,omitempty"`
	Groups     []SidebarGroupPayload `json:"groups,omitempty"`
	Categories []CategoryNavPayload  `json:"categories"`
	ActiveKey  string                `json:"activeKey"`
}

type SitePayload

type SitePayload struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	Favicon       string `json:"favicon"`
	ExternalLinks string `json:"externalLinks,omitempty"`
	BrandType     string `json:"brandType"`
	BrandText     string `json:"brandText"`
	BrandImage    string `json:"brandImage"`
}

type SponsorPayload

type SponsorPayload struct {
	Name      string `json:"name"`
	Message   string `json:"message"`
	Link      string `json:"link"`
	AvatarURL string `json:"avatarUrl"`
}

type SponsorSectionPayload

type SponsorSectionPayload struct {
	Key      string           `json:"key"`
	Label    string           `json:"label"`
	Tone     string           `json:"tone"`
	Sponsors []SponsorPayload `json:"sponsors"`
}

type SponsorsContactPayload added in v0.2.2

type SponsorsContactPayload = pageConfig.SponsorsContact

type SponsorsPageIntroPayload added in v0.2.2

type SponsorsPageIntroPayload = pageConfig.SponsorsPageIntro

type SponsorsPageProps

type SponsorsPageProps struct {
	Sections   []SponsorSectionPayload  `json:"sections"`
	TotalCount int                      `json:"totalCount"`
	Content    SponsorsPageIntroPayload `json:"content"`
	Contact    SponsorsContactPayload   `json:"contact"`
	Rules      []SponsorsRulePayload    `json:"rules"`
}

type SponsorsRulePayload added in v0.2.2

type SponsorsRulePayload = pageConfig.SponsorsRule

type TabPayload

type TabPayload struct {
	Key    string `json:"key"`
	Label  string `json:"label"`
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

type ThemePayload added in v0.2.23

type ThemePayload struct {
	Enabled    bool              `json:"enabled"`
	Href       string            `json:"href,omitempty"`
	Colors     map[string]string `json:"colors,omitempty"`
	Current    string            `json:"current"`
	ThemeColor string            `json:"themeColor"`
}

type ThemePreviewProps added in v0.2.23

type ThemePreviewProps struct {
	Theme    pageConfig.SiteThemeConfig `json:"theme"`
	Defaults pageConfig.SiteThemeConfig `json:"defaults"`
}

type TopicAuthorPayload

type TopicAuthorPayload struct {
	ID        uint64                  `json:"id"`
	Username  string                  `json:"username"`
	AvatarURL string                  `json:"avatarUrl"`
	WornBadge *badgeservice.UserBadge `json:"wornBadge,omitempty"`
}

type TopicCategoryPayload

type TopicCategoryPayload struct {
	ID    uint64 `json:"id"`
	Name  string `json:"name"`
	URL   string `json:"url"`
	Color string `json:"color"`
}

type TopicDetailPayload added in v0.2.49

type TopicDetailPayload struct {
	ID            uint64                 `json:"id"`
	Title         string                 `json:"title"`
	Description   string                 `json:"description"`
	FirstImageURL string                 `json:"firstImageUrl,omitempty"`
	URL           string                 `json:"url"`
	TopicStatus   int8                   `json:"topicStatus"`
	ProcessStatus int8                   `json:"processStatus"`
	Author        TopicAuthorPayload     `json:"author"`
	Participants  []TopicAuthorPayload   `json:"participants"`
	Categories    []TopicCategoryPayload `json:"categories"`
	ReplyCount    uint64                 `json:"replyCount"`
	MaxPostNo     uint64                 `json:"maxPostNo"`
	ViewCount     uint64                 `json:"viewCount"`
	LikeCount     uint64                 `json:"likeCount"`
	IsLiked       bool                   `json:"isLiked"`
	IsBookmarked  bool                   `json:"isBookmarked"`
	IsWatched     bool                   `json:"isWatched"`
	CreatedAt     string                 `json:"createdAt"`
	UpdatedAt     string                 `json:"updatedAt"`
}

type TopicDetailProps added in v0.2.49

type TopicDetailProps struct {
	Topic       TopicDetailPayload `json:"topic"`
	PostStream  PostWindowPayload  `json:"postStream"`
	HotTopics   []TopicPayload     `json:"hotTopics"`
	Permissions TopicPermissions   `json:"permissions"`
}

type TopicPayload

type TopicPayload struct {
	ID             uint64                 `json:"id"`
	Title          string                 `json:"title"`
	Description    string                 `json:"description"`
	FirstImageURL  string                 `json:"firstImageUrl,omitempty"`
	URL            string                 `json:"url"`
	PinWeight      int                    `json:"pinWeight"`
	ProcessStatus  int8                   `json:"processStatus"`
	Author         TopicAuthorPayload     `json:"author"`
	Participants   []TopicAuthorPayload   `json:"participants"`
	Categories     []TopicCategoryPayload `json:"categories"`
	ReplyCount     uint64                 `json:"replyCount"`
	ViewCount      uint64                 `json:"viewCount"`
	ActivityText   string                 `json:"activityText"`
	LastUpdateTime string                 `json:"lastUpdateTime"`
	Unseen         bool                   `json:"unseen,omitempty"`
}

type TopicPermissions added in v0.2.49

type TopicPermissions struct {
	IsOwnTopic       bool `json:"isOwnTopic"`
	CanPost          bool `json:"canPost"`
	CanModerateTopic bool `json:"canModerateTopic"`
}

type TwitterMeta added in v0.2.2

type TwitterMeta struct {
	Card        string `json:"card,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Image       string `json:"image,omitempty"`
}

type UnreadStatusPayload added in v0.2.2

type UnreadStatusPayload struct {
	Notifications          bool   `json:"notifications"`
	Messages               bool   `json:"messages"`
	ModerationReports      bool   `json:"moderationReports"`
	LatestNotificationType string `json:"latestNotificationType,omitempty"`
}

type UserActivityPayload

type UserActivityPayload struct {
	ID             uint64 `json:"id"`
	Action         int    `json:"action"`
	SubjectType    string `json:"subjectType"`
	SubjectID      uint64 `json:"subjectId"`
	ContentPreview string `json:"contentPreview"`
	URL            string `json:"url"`
	Label          string `json:"label"`
	CreatedAt      string `json:"createdAt"`
}

type UserConnectionPayload

type UserConnectionPayload struct {
	ID        uint64 `json:"id"`
	Username  string `json:"username"`
	Nickname  string `json:"nickname"`
	AvatarURL string `json:"avatarUrl"`
	Bio       string `json:"bio"`
	URL       string `json:"url"`
}

type UserLikePayload added in v0.2.44

type UserLikePayload struct {
	ID      uint64 `json:"id"`
	TopicID uint64 `json:"topicId"`
	Title   string `json:"title"`
	URL     string `json:"url"`
	LikedAt string `json:"likedAt"`
}

type UserProfileProps

type UserProfileProps struct {
	User         *vo.UserCard             `json:"user"`
	Section      string                   `json:"section"`
	ActivityTab  string                   `json:"activityTab"`
	Tabs         []TabPayload             `json:"tabs"`
	ActivityTabs []TabPayload             `json:"activityTabs"`
	Pagination   PaginationPayload        `json:"pagination"`
	Badges       []badgeservice.UserBadge `json:"badges"`
	Topics       []TopicPayload           `json:"topics"`
	Activities   []UserActivityPayload    `json:"activities"`
	Likes        []UserLikePayload        `json:"likes"`
	Following    []UserConnectionPayload  `json:"following"`
	Followers    []UserConnectionPayload  `json:"followers"`
	IsOwnProfile bool                     `json:"isOwnProfile"`
	CanMessage   bool                     `json:"canMessage"`
	CanFollow    bool                     `json:"canFollow"`
	MessageURL   string                   `json:"messageUrl"`
	SettingsURL  string                   `json:"settingsUrl"`
}

type ViewerPayload

type ViewerPayload struct {
	ID                        uint64   `json:"id"`
	Username                  string   `json:"username"`
	Email                     string   `json:"email"`
	AvatarURL                 string   `json:"avatarUrl"`
	IsAuthenticated           bool     `json:"isAuthenticated"`
	CanAccessAdmin            bool     `json:"canAccessAdmin"`
	IsModerator               bool     `json:"isModerator"`
	RequiresEmailVerification bool     `json:"requiresEmailVerification"`
	AdminPermissions          []uint64 `json:"adminPermissions"`
}

Jump to

Keyboard shortcuts

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