user_read_article.go
1.3 KB
package domain
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
)
// 人员查看文章详情后,标记一个记录
// 浏览记录
type UserReadArticle struct {
Id int64 `json:"id"`
UserId int64 `json:"userId"`
ArticleId int64 `json:"articleId"`
Title string `json:"title"`
Author UserSimple `json:"author"` // 发布人
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
DeletedAt int64 `json:"deletedAt,omitempty"`
Version int `json:"version,omitempty"`
}
type UserReadArticleRepository interface {
Insert(ctx context.Context, conn transaction.Conn, dm *UserReadArticle) (*UserReadArticle, error)
Update(ctx context.Context, conn transaction.Conn, dm *UserReadArticle) (*UserReadArticle, error)
UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *UserReadArticle) (*UserReadArticle, error)
Delete(ctx context.Context, conn transaction.Conn, dm *UserReadArticle) (*UserReadArticle, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*UserReadArticle, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*UserReadArticle, error)
}