Initial commit: web_hghl_server
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user