app-cloudep-comment-server/pkg/domain/entity/comment.go

24 lines
1004 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entity
import (
"code.30cm.net/digimon/app-cloudep-comment-server/pkg/domain/comment"
"go.mongodb.org/mongo-driver/bson/primitive"
)
// Comments 只有一層的回應,沒有巢狀回覆
type Comments struct {
ID primitive.ObjectID `bson:"_id,omitempty"` // MongoDB 的 ObjectID
UID string `bson:"uid"` // 留言的使用者的 ID
ReferenceID string `bson:"reference_id"` // 參考的 id例如 product_id
ParentCommentID string `bson:"parent_comment_id"` // 父留言 id沒有就空白
Message string `bson:"message"` // 留言內容
Level comment.Level `bson:"level"` // 等級,數字較小的為上層
UpdatedAt int64 `bson:"updated_at"` // 更新時間
CreatedAt int64 `bson:"created_at"` // 建立時間
}
func (c *Comments) CollectionName() string {
return "comments"
}