model

package
v0.0.0-...-9a9797c Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionLink struct {
	Title string `json:"title"`
	Url   string `json:"url"`
}

站点导航

type ArticleResponse

type ArticleResponse struct {
	ArticleSimpleResponse
	Content string `json:"content"`
}

type ArticleSimpleResponse

type ArticleSimpleResponse struct {
	ArticleId    int64          `json:"articleId"`
	User         *UserInfo      `json:"user"`
	Tags         *[]TagResponse `json:"tags"`
	Title        string         `json:"title"`
	Summary      string         `json:"summary"`
	Cover        *ImageInfo     `json:"cover"`
	SourceUrl    string         `json:"sourceUrl"`
	ViewCount    int64          `json:"viewCount"`
	CommentCount int64          `json:"commentCount"`
	LikeCount    int64          `json:"likeCount"`
	CreateTime   int64          `json:"createTime"`
	Status       int            `json:"status"`
	Favorited    bool           `json:"favorited"`
}

type CommentResponse

type CommentResponse struct {
	CommentId    int64             `json:"commentId"`
	User         *UserInfo         `json:"user"`
	EntityType   string            `json:"entityType"`
	EntityId     int64             `json:"entityId"`
	ContentType  string            `json:"contentType"`
	Content      string            `json:"content"`
	ImageList    []ImageInfo       `json:"imageList"`
	LikeCount    int64             `json:"likeCount"`
	CommentCount int64             `json:"commentCount"`
	Liked        bool              `json:"liked"`
	QuoteId      int64             `json:"quoteId"`
	Quote        *CommentResponse  `json:"quote"`
	Replies      *web.CursorResult `json:"replies"`
	IpLocation   string            `json:"ipLocation"`
	Status       int               `json:"status"`
	CreateTime   int64             `json:"createTime"`
}

CommentResponse 评论返回数据

type CreateArticleForm

type CreateArticleForm struct {
	Title       string
	Summary     string
	Content     string
	ContentType string
	Cover       *ImageDTO
	Tags        []string
	SourceUrl   string
}

func GetCreateArticleForm

func GetCreateArticleForm(ctx iris.Context) CreateArticleForm

type CreateCommentForm

type CreateCommentForm struct {
	EntityType string     `form:"entityType"`
	EntityId   int64      `form:"entityId"`
	Content    string     `form:"content"`
	ImageList  []ImageDTO `form:"imageList"`
	QuoteId    int64      `form:"quoteId"`
	UserAgent  string     `form:"userAgent"`
	Ip         string     `form:"ip"`
}

CreateCommentForm 发表评论

func GetCreateCommentForm

func GetCreateCommentForm(ctx iris.Context) CreateCommentForm

type CreateTopicForm

type CreateTopicForm struct {
	Type        constants.TopicType
	CaptchaId   string
	CaptchaCode string
	NodeId      int64
	Title       string
	Content     string
	HideContent string
	Tags        []string
	ImageList   []ImageDTO
	UserAgent   string
	Ip          string
}

func GetCreateTopicForm

func GetCreateTopicForm(ctx iris.Context) CreateTopicForm

type FavoriteResponse

type FavoriteResponse struct {
	FavoriteId int64     `json:"favoriteId"`
	EntityType string    `json:"entityType"`
	EntityId   int64     `json:"entityId"`
	Deleted    bool      `json:"deleted"`
	Title      string    `json:"title"`
	Content    string    `json:"content"`
	User       *UserInfo `json:"user"`
	Url        string    `json:"url"`
	CreateTime int64     `json:"createTime"`
}

收藏返回数据

type ImageDTO

type ImageDTO struct {
	Url string `json:"url"`
}

func GetImageDTO

func GetImageDTO(ctx iris.Context, paramName string) (img *ImageDTO)

func GetImageList

func GetImageList(ctx iris.Context, paramName string) []ImageDTO

type ImageInfo

type ImageInfo struct {
	Url     string `json:"url"`
	Preview string `json:"preview"`
}

图片

type LoginMethod

type LoginMethod struct {
	Password bool `json:"password"`
	QQ       bool `json:"qq"`
	Github   bool `json:"github"`
	Osc      bool `json:"osc"`
}

type MessageResponse

type MessageResponse struct {
	MessageId    int64     `json:"messageId"`
	From         *UserInfo `json:"from"`    // 消息发送人
	UserId       int64     `json:"userId"`  // 消息接收人编号
	Title        string    `json:"title"`   // 标题
	Content      string    `json:"content"` // 消息内容
	QuoteContent string    `json:"quoteContent"`
	Type         int       `json:"type"`
	DetailUrl    string    `json:"detailUrl"` // 消息详情url
	ExtraData    string    `json:"extraData"`
	Status       int       `json:"status"`
	CreateTime   int64     `json:"createTime"`
}

消息

type ModuleConfig

type ModuleConfig struct {
	Module  string `json:"module"`
	Enabled bool   `json:"enabled"`
}

Moduleconfig

模块配置

type NodeResponse

type NodeResponse struct {
	NodeId      int64  `json:"nodeId"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ScoreConfig

type ScoreConfig struct {
	PostTopicScore   int `json:"postTopicScore"`   // 发帖获得积分
	PostCommentScore int `json:"postCommentScore"` // 跟帖获得积分
	CheckInScore     int `json:"checkInScore"`     // 签到积分
}

积分配置

type SearchTopicResponse

type SearchTopicResponse struct {
	TopicId    int64          `json:"topicId"`
	User       *UserInfo      `json:"user"`
	Node       *NodeResponse  `json:"node"`
	Tags       *[]TagResponse `json:"tags"`
	Title      string         `json:"title"`
	Summary    string         `json:"summary"`
	CreateTime int64          `json:"createTime"`
}

type SysConfigResponse

type SysConfigResponse struct {
	SiteTitle                  string         `json:"siteTitle"`
	SiteDescription            string         `json:"siteDescription"`
	SiteKeywords               []string       `json:"siteKeywords"`
	SiteNavs                   []ActionLink   `json:"siteNavs"`
	SiteNotification           string         `json:"siteNotification"`
	RecommendTags              []string       `json:"recommendTags"`
	UrlRedirect                bool           `json:"urlRedirect"`
	ScoreConfig                ScoreConfig    `json:"scoreConfig"`
	DefaultNodeId              int64          `json:"defaultNodeId"`
	ArticlePending             bool           `json:"articlePending"`
	TopicCaptcha               bool           `json:"topicCaptcha"`
	UserObserveSeconds         int            `json:"userObserveSeconds"`
	TokenExpireDays            int            `json:"tokenExpireDays"`
	LoginMethod                LoginMethod    `json:"loginMethod"`
	CreateTopicEmailVerified   bool           `json:"createTopicEmailVerified"`
	CreateArticleEmailVerified bool           `json:"createArticleEmailVerified"`
	CreateCommentEmailVerified bool           `json:"createCommentEmailVerified"`
	EnableHideContent          bool           `json:"enableHideContent"`
	Modules                    []ModuleConfig `json:"modules"`
	EmailWhitelist             []string       `json:"emailWhitelist"` // 邮箱白名单
}

SysConfigResponse

配置返回结构体

type TagResponse

type TagResponse struct {
	TagId   int64  `json:"tagId"`
	TagName string `json:"tagName"`
}

type TopicResponse

type TopicResponse struct {
	TopicId         int64               `json:"topicId"`
	Type            constants.TopicType `json:"type"`
	User            *UserInfo           `json:"user"`
	Node            *NodeResponse       `json:"node"`
	Tags            *[]TagResponse      `json:"tags"`
	Title           string              `json:"title"`
	Summary         string              `json:"summary"`
	Content         string              `json:"content"`
	ImageList       []ImageInfo         `json:"imageList"`
	LastCommentTime int64               `json:"lastCommentTime"`
	ViewCount       int64               `json:"viewCount"`
	CommentCount    int64               `json:"commentCount"`
	LikeCount       int64               `json:"likeCount"`
	Liked           bool                `json:"liked"`
	CreateTime      int64               `json:"createTime"`
	Recommend       bool                `json:"recommend"`
	RecommendTime   int64               `json:"recommendTime"`
	Sticky          bool                `json:"sticky"`
	StickyTime      int64               `json:"stickyTime"`
	Status          int                 `json:"status"`
	Favorited       bool                `json:"favorited"`
	IpLocation      string              `json:"ipLocation"`
}

帖子列表返回实体

type UserDetail

type UserDetail struct {
	UserInfo
	Username             string `json:"username"`
	BackgroundImage      string `json:"backgroundImage"`
	SmallBackgroundImage string `json:"smallBackgroundImage"`
	HomePage             string `json:"homePage"`
	Status               int    `json:"status"`
}

UserDetail 用户详细信息

type UserInfo

type UserInfo struct {
	Id           int64            `json:"id"`
	Nickname     string           `json:"nickname"`
	Avatar       string           `json:"avatar"`
	SmallAvatar  string           `json:"smallAvatar"`
	Gender       constants.Gender `json:"gender"`
	Birthday     *time.Time       `json:"birthday"`
	TopicCount   int              `json:"topicCount"`   // 话题数量
	CommentCount int              `json:"commentCount"` // 跟帖数量
	FansCount    int              `json:"fansCount"`    // 粉丝数量
	FollowCount  int              `json:"followCount"`  // 关注数量
	Score        int              `json:"score"`        // 积分
	Description  string           `json:"description"`
	CreateTime   int64            `json:"createTime"`

	Forbidden bool `json:"forbidden"` // 是否禁言
	Followed  bool `json:"followed"`  // 是否关注
}

UserInfo 用户简单信息

type UserProfile

type UserProfile struct {
	UserDetail
	Roles         []string `json:"roles"`
	PasswordSet   bool     `json:"passwordSet"` // 密码已设置
	Email         string   `json:"email"`
	EmailVerified bool     `json:"emailVerified"`
}

UserProfile 用户个人信息

Jump to

Keyboard shortcuts

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