You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.3 KiB
66 lines
1.3 KiB
3 months ago
|
package model
|
||
|
|
||
|
import (
|
||
|
"encoding/binary"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
type CommentInHB struct {
|
||
|
Id []byte `json:"id"`
|
||
|
VideoId []byte `json:"video_id"`
|
||
|
UserId []byte `json:"user_id"`
|
||
|
ConversationId []byte `json:"conversation_id"`
|
||
|
LastId []byte `json:"last_id"`
|
||
|
ToUserId []byte `json:"to_user_id"`
|
||
|
Content []byte `json:"content"`
|
||
|
Timestamp []byte `json:"timestamp"`
|
||
|
}
|
||
|
|
||
|
func ToInt64(data []byte) int64 {
|
||
|
return int64(binary.BigEndian.Uint64(data))
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetId() int64 {
|
||
|
str := string(c.Id)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetVideoId() int64 {
|
||
|
str := string(c.VideoId)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetUserId() int64 {
|
||
|
str := string(c.UserId)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetConversationId() int64 {
|
||
|
str := string(c.ConversationId)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetLastId() int64 {
|
||
|
str := string(c.LastId)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetToUserId() int64 {
|
||
|
str := string(c.ToUserId)
|
||
|
i, _ := strconv.ParseInt(str, 10, 64)
|
||
|
return i
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetContent() string {
|
||
|
return string(c.Content)
|
||
|
}
|
||
|
|
||
|
func (c *CommentInHB) GetTimestamp() string {
|
||
|
return string(c.Timestamp)
|
||
|
}
|