Documentation ¶
Index ¶
- func FastCheckExternalMedia(media *ExternalMedia) error
- func RegesterExternalPlatform(externalPlatform ExternalPlatform)
- type BiliBiliVideo
- type Card
- type Comment
- type CommentDetail
- type ExternalMedia
- type ExternalPlatform
- type Like
- type LikeDetail
- type LikeDetails
- type Media
- type MediaType
- type Music163
- type PageResult
- type Post
- type PostDetail
- type PostType
- type QQMusic
- type ReplyTo
- type Role
- type SimpleUser
- type SupportPlatform
- type SupportPlatformProp
- type SupportPlatformProps
- type SupportPlatforms
- type TencentVideo
- type Url
- type User
- type UserDetail
- type UserProfile
- type Visibility
- type YouTuBeVideo
- type YoukuVideo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FastCheckExternalMedia ¶
func FastCheckExternalMedia(media *ExternalMedia) error
func RegesterExternalPlatform ¶
func RegesterExternalPlatform(externalPlatform ExternalPlatform)
Types ¶
type BiliBiliVideo ¶
type BiliBiliVideo struct {
BVID string `json:"bvid" property:"bvid;视频ID"`
}
func (*BiliBiliVideo) GetDisplayName ¶
func (*BiliBiliVideo) GetDisplayName() string
func (*BiliBiliVideo) GetMediaType ¶
func (*BiliBiliVideo) GetMediaType() MediaType
func (*BiliBiliVideo) GetName ¶
func (*BiliBiliVideo) GetName() string
func (*BiliBiliVideo) Html ¶
func (b *BiliBiliVideo) Html(isMobile bool) string
func (*BiliBiliVideo) Init ¶
func (b *BiliBiliVideo) Init(config map[string]string)
type Comment ¶
type Comment struct { gorm.Model UserID uint `gorm:"column:userId" json:"userId"` PostId uint `gorm:"column:postId;not null;index" json:"postId"` IP string `gorm:"column:ip;not null" json:"-"` Content string `gorm:"column:content;not null" json:"content"` ReplyTo *ReplyTo `gorm:"column:replyTo;serializer:json" json:"replyTo"` IsApproved bool `gorm:"column:isApproved;default:false" json:"isApproved"` }
type CommentDetail ¶
type CommentDetail struct { PostDetail *PostDetail `json:"post"` UserDetail *UserDetail `json:"user"` Comment *Comment `json:"comment"` ReplyTo *UserDetail `json:"replyto"` }
type ExternalMedia ¶
type ExternalPlatform ¶
type ExternalPlatform interface { GetName() string GetDisplayName() string GetMediaType() MediaType Init(config map[string]string) Html(isMobile bool) string }
func GetExternalPlatform ¶
func GetExternalPlatform(media *ExternalMedia) (ExternalPlatform, error)
type Like ¶
type Like struct { gorm.Model UserID uint `gorm:"column:userId;not null" json:"userId"` PostId uint `gorm:"column:postId;not null;index:index_postid" json:"postId"` IP string `gorm:"column:ip;not null" json:"ip"` }
func (*Like) MarshalJSON ¶
type LikeDetail ¶
type LikeDetail struct { PostDetail *PostDetail `json:"post"` UserDetail *UserDetail `json:"user"` Like *Like `json:"like"` }
type LikeDetails ¶
type LikeDetails struct { PostId uint `json:"postId"` LikeDetails []*LikeDetail `json:"likeDetails"` VisitorLikeCount uint `json:"visitorLikeCount"` IsLiked bool `json:"isLiked"` }
type Music163 ¶
type Music163 struct {
MusicID string `json:"musicid" property:"musicid;音乐ID"`
}
func (*Music163) GetDisplayName ¶
func (*Music163) GetMediaType ¶
type PageResult ¶
type PageResult struct { Page uint `json:"page"` PageSize uint `json:"pageSize"` Data interface{} `json:"data"` }
func NewPageResult ¶
func NewPageResult(page, pageSize uint, data []interface{}) PageResult
type Post ¶
type Post struct { gorm.Model UserID uint `gorm:"column:userId;index" json:"userId"` PostType PostType `gorm:"column:postType;not null" json:"postType"` Content string `gorm:"column:text;" json:"content"` Medias []Media `gorm:"column:medias;serializer:json" json:"medias"` Url *Url `gorm:"column:url;serializer:json" json:"url"` ExternalMedia *ExternalMedia `gorm:"column:externalMedia;serializer:json" json:"externalMedia"` Card *Card `gorm:"column:card;serializer:json" json:"card"` IsApproved bool `gorm:"column:isApproved;default:false" json:"isApproved"` Address string `gorm:"column:address;" json:"address"` Visibility Visibility `gorm:"column:visibility;" json:"visibility"` Priority uint `gorm:"column:priority;default:0" json:"priority"` IsUpdated bool `gorm:"column:isUpdated;default:false" json:"isUpdated"` }
type PostDetail ¶
type PostDetail struct { UserDetail *UserDetail `json:"user"` Post *Post `json:"post"` }
type QQMusic ¶
type QQMusic struct {
SongID string `json:"songid" property:"songid;音乐ID"`
}
func (*QQMusic) GetDisplayName ¶
func (*QQMusic) GetMediaType ¶
type SimpleUser ¶
type SupportPlatform ¶
type SupportPlatform struct { Name string `json:"name"` Displayname string `json:"displayname"` Props *SupportPlatformProps `json:"props"` }
type SupportPlatformProp ¶
type SupportPlatformProps ¶
type SupportPlatformProps []*SupportPlatformProp
type SupportPlatforms ¶
type SupportPlatforms map[string][]*SupportPlatform
func GetSupportPlatforms ¶
func GetSupportPlatforms() SupportPlatforms
type TencentVideo ¶
type TencentVideo struct {
VideoID string `json:"videoid" property:"videoid;视频ID"`
}
func (*TencentVideo) GetDisplayName ¶
func (*TencentVideo) GetDisplayName() string
func (*TencentVideo) GetMediaType ¶
func (*TencentVideo) GetMediaType() MediaType
func (*TencentVideo) GetName ¶
func (*TencentVideo) GetName() string
func (*TencentVideo) Html ¶
func (t *TencentVideo) Html(isMobile bool) string
func (*TencentVideo) Init ¶
func (t *TencentVideo) Init(config map[string]string)
type User ¶
type User struct { gorm.Model Email string `gorm:"uniqueIndex;not null;size:30" json:"email"` Role Role `gorm:"role;not null" json:"role"` Username string `gorm:"column:uname;not null;size:20" json:"username"` Password string `gorm:"not null" json:"password"` Enable bool `gorm:"not null;default:true" json:"enable"` }
func (*User) MarshalJSON ¶
type UserDetail ¶
type UserDetail struct { ID uint `json:"id"` User *User `json:"user"` Profile *UserProfile `json:"profile"` }
type UserProfile ¶
type Visibility ¶
type Visibility string
const ( PublicVisibility Visibility = "public" PrivateVisibility Visibility = "private" )
type YouTuBeVideo ¶
type YouTuBeVideo struct {
VideoID string `json:"videoid" property:"videoid;视频ID"`
}
func (*YouTuBeVideo) GetDisplayName ¶
func (*YouTuBeVideo) GetDisplayName() string
func (*YouTuBeVideo) GetMediaType ¶
func (*YouTuBeVideo) GetMediaType() MediaType
func (*YouTuBeVideo) GetName ¶
func (*YouTuBeVideo) GetName() string
func (*YouTuBeVideo) Html ¶
func (y *YouTuBeVideo) Html(isMobile bool) string
func (*YouTuBeVideo) Init ¶
func (y *YouTuBeVideo) Init(config map[string]string)
type YoukuVideo ¶
type YoukuVideo struct {
VideoID string `json:"videoid" property:"videoid;视频ID"`
}
func (*YoukuVideo) GetDisplayName ¶
func (*YoukuVideo) GetDisplayName() string
func (*YoukuVideo) GetMediaType ¶
func (*YoukuVideo) GetMediaType() MediaType
func (*YoukuVideo) GetName ¶
func (*YoukuVideo) GetName() string
func (*YoukuVideo) Html ¶
func (y *YoukuVideo) Html(isMobile bool) string
func (*YoukuVideo) Init ¶
func (y *YoukuVideo) Init(config map[string]string)
Click to show internal directories.
Click to hide internal directories.