28 lines
870 B
Go
28 lines
870 B
Go
package pubdef
|
|
|
|
// CommentObjectType 评论对象类型
|
|
type CommentObjectType int64
|
|
|
|
const (
|
|
CommentObjectTypeVideo CommentObjectType = 0 // 视频
|
|
CommentObjectTypePlaylet CommentObjectType = 4 // 短剧
|
|
CommentObjectTypePlayletChapter CommentObjectType = 11 // 短剧剧集
|
|
)
|
|
|
|
var commentObjectTypeNameMap = map[CommentObjectType]string{
|
|
CommentObjectTypeVideo: "视频",
|
|
CommentObjectTypePlaylet: "短剧",
|
|
CommentObjectTypePlayletChapter: "短剧剧集",
|
|
}
|
|
|
|
// CommentObjectTypeName 返回对象类型对应的展示名称
|
|
func CommentObjectTypeName(objectType CommentObjectType) string {
|
|
return commentObjectTypeNameMap[objectType]
|
|
}
|
|
|
|
// ValidCommentObjectType 判断评论对象类型是否合法
|
|
func ValidCommentObjectType(objectType CommentObjectType) bool {
|
|
_, ok := commentObjectTypeNameMap[objectType]
|
|
return ok
|
|
}
|