2022-09-27 17:59:05 +08:00
|
|
|
package revision
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-11-23 11:07:28 +08:00
|
|
|
|
2022-10-24 16:51:05 +08:00
|
|
|
"github.com/answerdev/answer/internal/entity"
|
2022-09-27 17:59:05 +08:00
|
|
|
"xorm.io/xorm"
|
|
|
|
)
|
|
|
|
|
|
|
|
// RevisionRepo revision repository
|
|
|
|
type RevisionRepo interface {
|
|
|
|
AddRevision(ctx context.Context, revision *entity.Revision, autoUpdateRevisionID bool) (err error)
|
2022-11-23 11:07:28 +08:00
|
|
|
GetRevisionByID(ctx context.Context, revisionID string) (revision *entity.Revision, exist bool, err error)
|
2022-09-27 17:59:05 +08:00
|
|
|
GetLastRevisionByObjectID(ctx context.Context, objectID string) (revision *entity.Revision, exist bool, err error)
|
|
|
|
GetRevisionList(ctx context.Context, revision *entity.Revision) (revisionList []entity.Revision, err error)
|
|
|
|
UpdateObjectRevisionId(ctx context.Context, revision *entity.Revision, session *xorm.Session) (err error)
|
2022-11-23 15:19:17 +08:00
|
|
|
ExistUnreviewedByObjectID(ctx context.Context, objectID string) (revision *entity.Revision, exist bool, err error)
|
2022-11-30 19:11:28 +08:00
|
|
|
GetUnreviewedRevisionPage(ctx context.Context, page, pageSize int, objectTypes []int) ([]*entity.Revision, int64, error)
|
2022-12-06 14:32:44 +08:00
|
|
|
UpdateStatus(ctx context.Context, id string, status int, reviewUserID string) (err error)
|
2022-09-27 17:59:05 +08:00
|
|
|
}
|