Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` ParentID primitive.ObjectID `json:"parent_id" bson:"parent_id" map:"parent_id"` //父级ID Type int `json:"type" bson:"type" map:"type"` //分类类型 Name string `json:"name" bson:"name" map:"name"` //分类名 Tags []string `json:"tags" bson:"tags" map:"tags"` //标签 LimitUserAtLeastLevel int `json:"limit_user_at_least_level" bson:"limit_user_at_least_level" map:"limit_user_at_least_level"` //限制用户至少级别 OnlyUserIDNotLimitUserLevel []primitive.ObjectID `json:"only_user_id_not_limit_user_level" bson:"only_user_id_not_limit_user_level" map:"only_user_id_not_limit_user_level"` //只有哪些user_id不受等级限制 LimitUserRole []string `json:"limit_user_role" bson:"limit_user_role" map:"limit_user_role"` //限制用户角色 OnlyUserIDNotLimitUserRole []primitive.ObjectID `json:"only_user_id_not_limit_user_role" bson:"only_user_id_not_limit_user_role" map:"only_user_id_not_limit_user_role"` //只有哪些user_id不受角色限制 LimitUserTag []string `json:"limit_user_tag" bson:"limit_user_tag" map:"limit_user_tag"` //限制用户TAG OnlyUserIDNotLimitUserTag []primitive.ObjectID `json:"only_user_id_not_limit_user_tag" bson:"only_user_id_not_limit_user_tag" map:"only_user_id_not_limit_user_tag"` //只有哪些user_id不受tag限制 Location geometry.Point `json:"location" bson:"location,omitempty" map:"location,omitempty"` Visibility int `json:"visibility" bson:"visibility" map:"visibility"` //可见度 ExtraData string `json:"extra_data" bson:"extra_data" map:"extra_data"` //额外扩展信息数据,可灵活使用,比如将相关额外信息json后存入 Status int `json:"status" bson:"status" map:"status"` Enable bool `json:"enable" bson:"enable" map:"enable"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type Content ¶
type Content struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` PublishUserID primitive.ObjectID `json:"publish_user_id" bson:"publish_user_id" map:"publish_user_id"` //发布者user_id,为空代表系统发布 Type int `json:"type" bson:"type" map:"type"` //动态类型:文章,动态等。详见:predefined.ContentTypeXXX PublishType int `json:"publish_type" bson:"publish_type" map:"publish_type"` //发布类型,如:自己,转发等 AssociateType int `json:"associate_type" bson:"associate_type" map:"associate_type"` //关联内容类型 AssociateID primitive.ObjectID `json:"associate_id" bson:"associate_id" map:"associate_id"` //关联内容ID LimitAssociateType int `json:"limit_associate_type" bson:"limit_associate_type" map:"limit_associate_type"` //限制关联类型,0为不限制(正好覆盖ContentAssociateTypeSelf),限制只能限制1种,不能多种,比如,问题,只允许回答类型来关联 LimitAssociateNum int `json:"limit_associate_num" bson:"limit_associate_num" map:"limit_associate_num"` //限制关联次数,0为不限制,比如,问题,只允许答应回答1次 CategoryID primitive.ObjectID `json:"category_id" bson:"category_id" map:"category_id"` //分类ID SubjectID primitive.ObjectID `json:"subject_id" bson:"subject_id" map:"subject_id"` //主题ID AtUsers []primitive.ObjectID `json:"at_users" bson:"at_users" map:"at_users"` //@用户user_id Author string `json:"author" bson:"author" map:"author"` //作者 Title string `json:"title" bson:"title" map:"title"` //标题 Cover string `json:"cover" bson:"cover" map:"cover"` //封面图片 Description string `json:"description" bson:"description" map:"description"` //描述 Video string `json:"video" bson:"video" map:"video"` //视频 Voice string `json:"voice" bson:"voice" map:"voice"` //语音 Images []string `json:"images" bson:"images" map:"images"` //图片 Content string `json:"content" bson:"content" map:"content"` //内容,根据类型可纯文字,也可富文本 Link ContentLink `json:"link" bson:"link" map:"link"` //链接 Location geometry.Point `json:"location" bson:"location,omitempty" map:"location,omitempty"` UserTags []string `json:"user_tags" bson:"user_tags" map:"user_tags"` //用户可编辑的标签 Visibility int `json:"visibility" bson:"visibility" map:"visibility"` //可见度 Value int `json:"value" bson:"value" map:"value"` //价值,比如:当价格使用,整数类型,单位可以为:分 HideDetail bool `json:"hide_detail" bson:"hide_detail" map:"hide_detail"` //隐藏详情内容 OnlyUserIDShowDetail []primitive.ObjectID `json:"only_user_id_show_detail" bson:"only_user_id_show_detail" map:"only_user_id_show_detail"` //在隐藏详情内容时,只有设置的user_id可以查看详情 Copy bool `json:"copy" bson:"copy" map:"copy"` //是否复制,搬运。用于申明此内容非本人原创 LimitUserAtLeastLevel int `json:"limit_user_at_least_level" bson:"limit_user_at_least_level" map:"limit_user_at_least_level"` //限制至少用户级别 OnlyUserIDNotLimitUserLevel []primitive.ObjectID `json:"only_user_id_not_limit_user_level" bson:"only_user_id_not_limit_user_level" map:"only_user_id_not_limit_user_level"` //只有哪些user_id不受等级限制 LimitUserRole []string `json:"limit_user_role" bson:"limit_user_role" map:"limit_user_role"` //限制用户角色 OnlyUserIDNotLimitUserRole []primitive.ObjectID `json:"only_user_id_not_limit_user_role" bson:"only_user_id_not_limit_user_role" map:"only_user_id_not_limit_user_role"` //只有哪些user_id不受角色限制 LimitUserTag []string `json:"limit_user_tag" bson:"limit_user_tag" map:"limit_user_tag"` //限制用户tag OnlyUserIDNotLimitUserTag []primitive.ObjectID `json:"only_user_id_not_limit_user_tag" bson:"only_user_id_not_limit_user_tag" map:"only_user_id_not_limit_user_tag"` //只有哪些user_id不受tag限制 OnlyUserIDDiscuss []primitive.ObjectID `json:"only_user_id_discuss" bson:"only_user_id_discuss" map:"only_user_id_discuss"` //只有指定的user_id可以discuss,nil为不限制,非nil影响only_publish_user_id_can_reply_discuss OnlyUserIDCanReplyDiscuss []primitive.ObjectID `` //只有指定user_id可以回复评论,nil为不限制,only_user_id_discuss不为nil时,受only_user_id_discuss影响,需加入only_user_id_discuss /* 136-byte string literal not displayed */ OnlyUserIDCanNotReplyDiscuss []primitive.ObjectID `` //只有指定user_id不可以回复评论,nil为不限制,only_publish_user_id_can_not_reply_discuss权重大于only_publish_user_id_can_reply_discuss,即:only_publish_user_id_can_not_reply_discuss和only_publish_user_id_can_reply_discuss有user_id时,以only_publish_user_id_can_not_reply_discuss为准 /* 148-byte string literal not displayed */ LimitAllDiscussNum int `json:"limit_all_discuss_num" bson:"limit_all_discuss_num" map:"limit_all_discuss_num"` //限制所有评论次数,0为不限制,不为0时,limit_all_discuss_num控制所有的评论次数 LimitPublishUserDiscussNum int `json:"limit_publish_user_discuss_num" bson:"limit_publish_user_discuss_num" map:"limit_publish_user_discuss_num"` //限制发布者评论次数,0为不限制,-1为不允许发布者评论,受limit_all_discuss_num影响 LimitNotPublishUserAllUserDiscussNum int `` //限制非发布者的情况下的所有用户评论次数,0为不限制,-1为不允许非发布者评论,受limit_all_discuss_num影响 /* 151-byte string literal not displayed */ LimitNotPublishUserEveryUserDiscussNum int `` //限制非发布者的情况下,每一个用户的评论次数,0为不限制,受limit_all_discuss_num和limit_not_publish_user_all_user_discuss_num影响 /* 157-byte string literal not displayed */ HideDiscuss bool `json:"hide_discuss" bson:"hide_discuss" map:"hide_discuss"` //隐藏评论 OnlyUserIDShowDiscuss []primitive.ObjectID `json:"only_user_id_show_discuss" bson:"only_user_id_show_discuss" map:"only_user_id_show_discuss"` //在隐藏评论时,只有设置的user_id可以查看评论,只有hide_discuss为true时才有效 ForbidForward bool `json:"forbid_forward" bson:"forbid_forward" map:"forbid_forward"` //禁止转发 ForbidDownload bool `json:"forbid_download" bson:"forbid_download" map:"forbid_download"` //禁止下载 ForbidDiscuss bool `json:"forbid_discuss" bson:"forbid_discuss" map:"forbid_discuss"` //禁止评论 Tags []string `json:"tags" bson:"tags" map:"tags"` //标签,包括用户标签 Bestest bool `json:"bestest" bson:"bestest" map:"bestest"` //是否最优 Reliable bool `json:"reliable" bson:"reliable" map:"reliable"` //是否靠谱 ReadedUser []primitive.ObjectID `json:"readed_user" bson:"readed_user" map:"readed_user"` //阅读过用户user_id WantedUser []primitive.ObjectID `json:"wanted_user" bson:"wanted_user" map:"wanted_user"` //想要用户user_id LikedUser []primitive.ObjectID `json:"liked_user" bson:"liked_user" map:"liked_user"` //喜欢用户user_id HatedUser []primitive.ObjectID `json:"hated_user" bson:"hated_user" map:"hated_user"` //讨厌用户user_id Guise ContentGuise `json:"guise" bson:"guise" map:"guise"` //匿名伪装 AntiGuiseUser []primitive.ObjectID `json:"anti_guise_user" bson:"anti_guise_user" map:"anti_guise_user"` //反伪装的用户user_id DiscussEstimateTotal int `json:"discuss_estimate_total" bson:"discuss_estimate_total" map:"discuss_estimate_total"` //评论估计总数 DiscussEstimateEvaluationTotal int `json:"discuss_estimate_evaluation_total" bson:"discuss_estimate_evaluation_total" map:"discuss_estimate_evaluation_total"` //有价值的评论估计总数 //评论估计总数 StartTime time.Time `json:"start_time" bson:"start_time" map:"start_time"` EndTime time.Time `json:"end_time" bson:"end_time" map:"end_time"` ExtraData string `json:"extra_data" bson:"extra_data" map:"extra_data"` //额外扩展信息数据,可灵活使用,比如将相关额外信息json后存入 Status int `json:"status" bson:"status" map:"status"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type ContentGuise ¶
type ContentLink ¶
type Discuss ¶
type Discuss struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` Type int `json:"type" bson:"type" map:"type"` ObjectID primitive.ObjectID `json:"object_id" bson:"object_id" map:"object_id"` //根据type的类型,确定其类型的_id作为object_id PublishUserID primitive.ObjectID `json:"publish_user_id" bson:"publish_user_id" map:"publish_user_id"` //发布者user_id,为空代表系统发布 AtUsers []primitive.ObjectID `json:"at_users" bson:"at_users" map:"at_users"` //@用户user_id ReplyEstimateTotal int `json:"reply_estimate_total" bson:"reply_estimate_total" map:"reply_estimate_total"` //回复估计总数 ReplyDiscussID primitive.ObjectID `json:"reply_discuss_id" bson:"reply_discuss_id" map:"reply_discuss_id"` //回复评论id Text string `json:"text" bson:"text" map:"text"` //纯文本 Location geometry.Point `json:"location" bson:"location,omitempty" map:"location,omitempty"` LikedUser []primitive.ObjectID `json:"liked_user" bson:"liked_user" map:"liked_user"` //喜欢用户user_id HatedUser []primitive.ObjectID `json:"hated_user" bson:"hated_user" map:"hated_user"` //讨厌用户user_id Visibility int `json:"visibility" bson:"visibility" map:"visibility"` //可见度 Evaluation float64 `json:"evaluation" bson:"evaluation" map:"evaluation"` //价值评估,支持小数,比如:可做打星使用 Status int `json:"status" bson:"status" map:"status"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type Favorites ¶
type Favorites struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` Type int `json:"type" bson:"type" map:"type"` //收藏的类型,如:动态,文章 UserID primitive.ObjectID `json:"user_id" bson:"user_id" map:"user_id"` //关注者user_id ObjectID primitive.ObjectID `json:"object_id" bson:"object_id" map:"object_id"` //被收藏对象的ID,如动态的ID Content string `json:"content" bson:"content" map:"content"` //收藏内容,备份使用,因为有的时候ObjectID可能被删除 Status int `json:"status" bson:"status" map:"status"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
收藏夹
type FollowContent ¶
type FollowContent struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` FollowRelationshipID primitive.ObjectID `json:"follow_relationship_id" bson:"follow_relationship_id" map:"follow_relationship_id"` //关注关系ID Type int `json:"type" bson:"type" map:"type"` //关注内容类型,与内容发布类型对应 UserID primitive.ObjectID `json:"user_id" bson:"user_id" map:"user_id"` //关注者user_id ContentID primitive.ObjectID `json:"content_id" bson:"content_id" map:"content_id"` //被关注对象的内容的ID,如动态的ID,评论的ID ReadedTime time.Time `json:"readed_time" bson:"readed_time" map:"readed_time"` ExtensionID primitive.ObjectID `bson:"extension_id" json:"extension_id" map:"extension_id"` //扩展ID,冗余字段,从follow_relationship表硬传过来,用来检索用 CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
关注内容 当内容发布时,会在这个集合里插入一条记录,关注者关联此记录的UserID可获取被关注的ContentID,通过ContentID获取具体内容信息 当取消关注时,通过FollowRelationshipID会清除相关FollowContent的记录 是否被阅读过,阅读过的内容,可选择是否要在一段时间后自动删除,比如,一般是:一个月后
type FollowRelationship ¶
type FollowRelationship struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` Type int `json:"type" bson:"type" map:"type"` //关注关系类型 UserID primitive.ObjectID `json:"user_id" bson:"user_id" map:"user_id"` //关注者user_id ObjectID primitive.ObjectID `json:"object_id" bson:"object_id" map:"object_id"` //被关注对象的ID ObjectOwnerUserID primitive.ObjectID `bson:"object_owner_user_id" json:"object_owner_user_id" map:"object_owner_user_id"` //被关注对象的拥有者的user_id Mutual bool `json:"mutual" bson:"mutual" map:"mutual"` //是否互相关注对方 Stealth bool `bson:"stealth" json:"stealth" map:"stealth"` //是否隐身关注 ExtensionID primitive.ObjectID `bson:"extension_id" json:"extension_id" map:"extension_id"` //扩展ID CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
关注关系 互相确认成为联系人时,也算建立了关注关系,并且算互相关注
type GroupMessage ¶
type GroupMessage struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` Type int `json:"type" bson:"type" map:"type"` //消息类型 GroupID primitive.ObjectID `json:"group_id" bson:"group_id" map:"group_id"` //群组ID FromUserID primitive.ObjectID `json:"from_user_id" bson:"from_user_id" map:"from_user_id"` //系统消息时,from_user_id为NilObjectID ToUserID primitive.ObjectID `json:"to_user_id" bson:"to_user_id" map:"to_user_id"` //回复user_id Text string `json:"text" bson:"text" map:"text"` RichText string `json:"rich_text" bson:"rich_text" map:"rich_text"` //富文本,如:支持链接,排版等 Image string `json:"image" bson:"image" map:"image"` Voice string `json:"voice" bson:"voice" map:"voice"` Video string `json:"video" bson:"video" map:"video"` File string `json:"file" bson:"file" map:"file"` Link GroupMessageLink `json:"link" bson:"link" map:"link"` Status int `json:"status" bson:"status" map:"status"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type GroupMessageLink ¶
type GroupMessageLink struct { Type int `json:"type" bson:"type" map:"type"` //链接类型 URL string `json:"url" bson:"url" map:"url"` //链接地址 Normal bool `json:"normal" bson:"normal" map:"normal"` //是否正常链接 Inline bool `json:"inline" bson:"inline" map:"inline"` //是否内嵌,还是跳转 Block bool `json:"block" bson:"block" map:"block"` //是否需要屏蔽跳转 }
type KeywordBan ¶
type KeywordBan struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id" map:"_id,omitempty"` //ID Type int Keyword string `bson:"keyword" json:"keyword" map:"keyword"` //关键词 Replace string `bson:"replace" json:"replace" map:"replace"` //替换 Action int `bson:"action" json:"action" map:"action"` //动作:替换,屏蔽,删除,审核等 CreateTime time.Time `bson:"create_time" json:"create_time" map:"create_time"` //创建时间 UpdateTime time.Time `bson:"update_time" json:"update_time" map:"update_time"` //更新时间 }
type Message ¶
type Message struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` Type int `json:"type" bson:"type" map:"type"` //消息类型 FromUserID primitive.ObjectID `json:"from_user_id" bson:"from_user_id" map:"from_user_id"` //系统消息时,from_user_id为NilObjectID ToUserID primitive.ObjectID `json:"to_user_id" bson:"to_user_id" map:"to_user_id"` Text string `json:"text" bson:"text" map:"text"` RichText string `json:"rich_text" bson:"rich_text" map:"rich_text"` //富文本,如:支持链接,排版等 Image string `json:"image" bson:"image" map:"image"` Voice string `json:"voice" bson:"voice" map:"voice"` Video string `json:"video" bson:"video" map:"video"` File string `json:"file" bson:"file" map:"file"` Link MessageLink `json:"link" bson:"link" map:"link"` Status int `json:"status" bson:"status" map:"status"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type MessageLink ¶
type MessageLink struct { Type int `json:"type" bson:"type" map:"type"` //链接类型 URL string `json:"url" bson:"url" map:"url"` //链接地址 Normal bool `json:"normal" bson:"normal" map:"normal"` //是否正常链接 Inline bool `json:"inline" bson:"inline" map:"inline"` //是否内嵌,还是跳转 Block bool `json:"block" bson:"block" map:"block"` //是否需要屏蔽跳转 }
type PublishIntervene ¶
type PublishIntervene struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` UserID primitive.ObjectID `json:"user_id" bson:"user_id" map:"user_id"` //user_id为primitive.NilObjectID时,代表所有用户 Type int `json:"type" bson:"type" map:"type"` Reason string `json:"reason" bson:"reason" map:"reason"` //干预原因 Status int `json:"status" bson:"status" map:"status"` StartTime time.Time `json:"start_time" bson:"start_time" map:"start_time"` //干预开始时间 EndTime time.Time `json:"end_time" bson:"end_time" map:"end_time"` //干预结束时间 CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
发布干预,用来控制发布内容时的状态。出现在此集合中的用户,发布时会被进行状态处理,不能直接正常发布
type Subject ¶
type Subject struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty" map:"_id,omitempty"` PublishUserID primitive.ObjectID `json:"publish_user_id" bson:"publish_user_id" map:"publish_user_id"` //发布者,为空代表系统发布 Type int `json:"type" bson:"type" map:"type"` //主题类型 Subject string `json:"subject" bson:"subject" map:"subject"` //主题 Cover string `json:"cover" bson:"cover" map:"cover"` //封面图片 Description string `json:"description" bson:"description" map:"description"` //描述 Text string `json:"text" bson:"text" map:"text"` //文本 Images []string `json:"images" bson:"images" map:"images"` //图片 Video string `json:"video" bson:"video" map:"video"` //视频 Voice string `json:"voice" bson:"voice" map:"voice"` //语音 UserTags []string `json:"user_tags" bson:"user_tags" map:"user_tags"` //用户可编辑的标签 Tags []string `json:"tags" bson:"tags" map:"tags"` //标签,包括用户标签 Location geometry.Point `json:"location" bson:"location,omitempty" map:"location,omitempty"` LimitUserAtLeastLevel int `json:"limit_user_at_least_level" bson:"limit_user_at_least_level" map:"limit_user_at_least_level"` //限制用户至少级别 OnlyUserIDNotLimitUserLevel []primitive.ObjectID `json:"only_user_id_not_limit_user_level" bson:"only_user_id_not_limit_user_level" map:"only_user_id_not_limit_user_level"` //只有哪些user_id不受等级限制 LimitUserRole []string `json:"limit_user_role" bson:"limit_user_role" map:"limit_user_role"` //限制用户角色 OnlyUserIDNotLimitUserRole []primitive.ObjectID `json:"only_user_id_not_limit_user_role" bson:"only_user_id_not_limit_user_role" map:"only_user_id_not_limit_user_role"` //只有哪些user_id不受角色限制 LimitUserTag []string `json:"limit_user_tag" bson:"limit_user_tag" map:"limit_user_tag"` OnlyUserIDNotLimitUserTag []primitive.ObjectID `json:"only_user_id_not_limit_user_tag" bson:"only_user_id_not_limit_user_tag" map:"only_user_id_not_limit_user_tag"` //只有哪些user_id不受tag限制 Visibility int `json:"visibility" bson:"visibility" map:"visibility"` //可见度 ExtraData string `json:"extra_data" bson:"extra_data" map:"extra_data"` //额外扩展信息数据,可灵活使用,比如将相关额外信息json后存入 Status int `json:"status" bson:"status" map:"status"` Enable bool `json:"enable" bson:"enable" map:"enable"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.