article_draft.go 1.5 KB
package domain

import (
	"context"

	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
)

// 填写文章时保存的草稿

type ArticleDraft struct {
	Id        int64    `json:"id"`
	CompanyId int64    `json:"companyId"`
	CreatedAt int64    `json:"createdAt,omitempty"`
	UpdatedAt int64    `json:"updatedAt,omitempty"`
	DeletedAt int64    `json:"deletedAt,omitempty"`
	Version   int      `json:"version,omitempty"`
	Template  int      `json:"template"`  // 填写内容时用的样板0、无 1、演绎式 2、归纳式
	Content   []string `json:"content"`   // 文章内容
	AuthorId  int64    `json:"authorId"`  // 发布人
	Title     string   `json:"title"`     // 文章标题
	Images    []Image  `json:"images"`    // 图片
	WhoRead   []int64  `json:"whoRead"`   // 谁可以看
	WhoReview []int64  `json:"whoReview"` // 评论人
	Location  Location `json:"location"`  // 坐标
}
type ArticleDraftRepository interface {
	Insert(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error)
	Update(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error)
	UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error)
	Delete(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error)
	FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleDraft, error)
	Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ArticleDraft, error)
}