article.go
990 字节
package domain
import (
"context"
"time"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
)
type Article struct {
Id int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
AuthorId int64 // 发布人
Author UserSimple // 发布人
Title string // 文章标题
Images []Image // 图片
WhoRead []int64 // 谁可以看
WhoReview []int64 // 评论人
Location Location // 坐标
// ...more
}
type ArticleRepository interface {
Insert(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error)
Update(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error)
Delete(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*Article, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*Article, error)
}