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

26 lines
991 B
Go
Raw Normal View History

2025-01-15 05:17:30 +00:00
package repository
import (
"context"
2025-01-15 05:46:36 +00:00
"code.30cm.net/digimon/app-cloudep-comment-server/pkg/domain/comment"
"code.30cm.net/digimon/app-cloudep-comment-server/pkg/domain/entity"
2025-01-15 05:17:30 +00:00
)
type CommentRepository interface {
CreateComment(ctx context.Context, comment *entity.Comments) error // 新增留言 // 根據 ID 獲取單條留言
DeleteCommentByID(ctx context.Context, id string) error // 根據 ID 刪除留言 // 刪除某留言的所有子留言
2025-03-06 11:16:09 +00:00
UpdateCommentMessage(ctx context.Context, id string, message string, isVisitable bool) error // 更新留言內容
2025-01-15 05:17:30 +00:00
ListComments(ctx context.Context, req ListCommentRequest) ([]*entity.Comments, int64, error) // 分頁列出留言
2025-05-01 15:06:52 +00:00
GetCommentByID(ctx context.Context, id string) (*entity.Comments, error)
2025-01-15 05:17:30 +00:00
}
type ListCommentRequest struct {
PageSize int64
PageIndex int64
ReferenceID *string
ParentID *string
Level comment.Level
2025-03-06 11:16:09 +00:00
IsVisitable *bool
2025-01-15 05:17:30 +00:00
}