Documentation ¶
Index ¶
- Constants
- Variables
- type Attachment
- type AttachmentBill
- type AttachmentType
- type CommentThumbs
- type CommentThumbsList
- type CommentThumbsMap
- type Contact
- type FavoriteItem
- type FavoriteList
- type NewTweetReq
- type ReactionItem
- type ReactionList
- type RelationTyp
- type TagInfo
- type TagInfoList
- type TagItem
- type TagList
- type TagType
- type TsDocItem
- type TsDocList
- type TsQueryReq
- type TsQueryResp
- type TsQueryType
- type TweetBlock
- type TweetBlockList
- type TweetBlockType
- type TweetBox
- type TweetInfo
- type TweetInfoList
- type TweetItem
- type TweetList
- type TweetVisibleType
- type UserInfo
- type UserInfoList
- type VistUser
Constants ¶
View Source
const ( ContactStatusRequesting int8 = iota + 1 ContactStatusAgree ContactStatusReject ContactStatusDeleted )
View Source
const ( // 推文内容分快类型 TweetBlockTitle TweetBlockType = iota + 1 TweetBlockText TweetBlockImage TweetBlockVideo TweetBlockAudio TweetBlockLink TweetBlockAttachment TweetBlockChargeAttachment // 推文可见性 TweetVisitPublic TweetVisibleType = iota TweetVisitPrivate TweetVisitFriend TweetVisitInvalid // 附件类型 AttachmentTypeImage AttachmentType = iota + 1 AttachmentTypeVideo AttachmentTypeOther )
Variables ¶
View Source
var ( ErrNotImplemented = errors.New("not implemented") ErrNoPermission = errors.New("no permission") )
internal core error variable for data logic implement.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶ added in v0.4.0
type AttachmentBill ¶ added in v0.4.0
type AttachmentType ¶ added in v0.4.0
type AttachmentType int
AttachmentType 附件类型, 1图片, 2视频, 3其他 TODO: 优化一下类型为 uint8, 需要底层数据库同步修改
type CommentThumbs ¶
type CommentThumbsList ¶
type CommentThumbsList []*CommentThumbs
type CommentThumbsMap ¶
type CommentThumbsMap map[int64]*CommentThumbs
type Contact ¶ added in v0.4.0
type Contact struct { ID int64 `db:"id" json:"id"` UserId int64 `db:"user_id" json:"user_id"` FriendId int64 `db:"friend_id" json:"friend_id"` GroupId int64 `json:"group_id"` Remark string `json:"remark"` Status int8 `json:"status"` // 1请求好友, 2已同意好友, 3已拒绝好友, 4已删除好友 IsTop int8 `json:"is_top"` IsBlack int8 `json:"is_black"` NoticeEnable int8 `json:"notice_enable"` IsDel int8 `json:"-"` DeletedOn int64 `db:"-" json:"-"` }
type FavoriteItem ¶ added in v0.4.0
type FavoriteItem struct { ID int64 `json:"id"` Tweet *TweetInfo `json:"-"` TweetID int64 `json:"post_id"` UserID int64 `json:"user_id"` }
Favorite 收藏
type NewTweetReq ¶ added in v0.4.0
type NewTweetReq struct { Contents TweetBlockList `json:"contents" binding:"required"` Tags []string `json:"tags" binding:"required"` Users []string `json:"users" binding:"required"` AttachmentPrice int64 `json:"attachment_price"` Visibility TweetVisibleType `json:"visibility"` ClientIP string `json:"-" binding:"-"` }
type ReactionItem ¶ added in v0.4.0
type ReactionItem struct { ID int64 `json:"id"` Tweet *TweetInfo `json:"-"` TweetID int64 `json:"post_id"` UserID int64 `json:"user_id"` }
Reaction 反应、表情符号, 点赞、喜欢等
type RelationTyp ¶ added in v0.4.0
type RelationTyp uint8
const ( RelationUnknow RelationTyp = iota RelationSelf RelationFriend RelationFollower RelationFollowing RelationAdmin RelationGuest )
func (RelationTyp) String ¶ added in v0.4.0
func (t RelationTyp) String() string
type TagInfo ¶ added in v0.4.0
type TagInfo struct { ID int64 `json:"id" db:"id"` UserID int64 `json:"user_id" db:"user_id"` Tag string `json:"tag"` QuoteNum int64 `json:"quote_num" db:"quote_num"` }
TagInfo 标签信息
type TagItem ¶ added in v0.4.0
type TagItem struct { ID int64 `json:"id"` UserID int64 `json:"user_id"` User *UserInfo `json:"user" db:"u"` Tag string `json:"tag"` QuoteNum int64 `json:"quote_num"` IsFollowing int8 `json:"is_following"` IsTop int8 `json:"is_top"` }
TagItem 标签信息条陈
type TsQueryReq ¶ added in v0.4.0
type TsQueryReq struct { Query string Visibility []TweetVisibleType Type TsQueryType }
TsQueryReq 搜索查询请求
type TsQueryResp ¶ added in v0.4.0
TsQueryResp 搜索查询响应
type TsQueryType ¶ added in v0.4.0
type TsQueryType string
TsQueryType 搜索查询类型
const ( // 搜索查询类型 TsQueryTypeDefault TsQueryType = "search" TsQueryTypeTag TsQueryType = "tag" )
type TweetBlock ¶ added in v0.4.0
type TweetBlock struct { ID int64 `json:"id" binding:"-"` PostID int64 `json:"post_id" binding:"-"` Content string `json:"content" binding:"required"` Type TweetBlockType `json:"type" binding:"required"` Sort int64 `json:"sort" binding:"required"` }
TweetBlock 推文分块
type TweetBlockType ¶ added in v0.4.0
type TweetBlockType int
TweetBlockType 推文内容分块类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源 TODO: 优化一下类型为 uint8, 需要底层数据库同步修改
type TweetInfo ¶ added in v0.4.0
type TweetInfo struct { ID int64 `json:"id"` UserID int64 `json:"user_id"` CommentCount int64 `json:"comment_count"` CollectionCount int64 `json:"collection_count"` UpvoteCount int64 `json:"upvote_count"` Visibility TweetVisibleType `json:"visibility"` IsTop int `json:"is_top"` IsEssence int `json:"is_essence"` IsLock int `json:"is_lock"` LatestRepliedOn int64 `json:"latest_replied_on"` Tags string `json:"tags"` AttachmentPrice int64 `json:"attachment_price"` IP string `json:"ip"` IPLoc string `json:"ip_loc"` CreatedOn int64 `json:"created_on"` ModifiedOn int64 `json:"modified_on"` }
TweetInfo 推文信息
type TweetItem ¶ added in v0.4.0
type TweetItem struct { ID int64 `json:"id"` UserID int64 `json:"user_id"` User *UserInfo `db:"user" json:"user"` Contents []*TweetBlock `db:"-" json:"contents"` CommentCount int64 `json:"comment_count"` CollectionCount int64 `json:"collection_count"` UpvoteCount int64 `json:"upvote_count"` Visibility TweetVisibleType `json:"visibility"` IsTop int `json:"is_top"` IsEssence int `json:"is_essence"` IsLock int `json:"is_lock"` LatestRepliedOn int64 `json:"latest_replied_on"` CreatedOn int64 `json:"created_on"` ModifiedOn int64 `json:"modified_on"` Tags map[string]int8 `json:"tags"` AttachmentPrice int64 `json:"attachment_price"` IPLoc string `json:"ip_loc"` }
TweetItem 一条推文信息
type TweetVisibleType ¶ added in v0.4.0
type TweetVisibleType uint8
TweetVisibleType 推文可见性,0公开,1私密,2好友
type UserInfo ¶ added in v0.4.0
type UserInfo struct { ID int64 `json:"id"` Nickname string `json:"nickname"` Username string `json:"username"` Status int `json:"status"` Avatar string `json:"avatar"` IsAdmin bool `json:"is_admin"` CreatedOn int64 `json:"created_on"` }
UserInfo 用户基本信息
type VistUser ¶ added in v0.4.0
type VistUser struct { Username string UserId int64 RelTyp RelationTyp }
Click to show internal directories.
Click to hide internal directories.