issues

package
v1.16.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 7 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasIssueContentHistory

func HasIssueContentHistory(dbCtx context.Context, issueID, commentID int64) (bool, error)

HasIssueContentHistory check if a ContentHistory entry exists

func QueryIssueContentHistoryEditedCountMap

func QueryIssueContentHistoryEditedCountMap(dbCtx context.Context, issueID int64) (map[int64]int, error)

QueryIssueContentHistoryEditedCountMap query related history count of each comment (comment_id = 0 means the main issue) only return the count map for "edited" (history revision count > 1) issues or comments.

func SaveIssueContentHistory

func SaveIssueContentHistory(e db.Engine, posterID, issueID, commentID int64, editTime timeutil.TimeStamp, contentText string, isFirstCreated bool) error

SaveIssueContentHistory save history

func SoftDeleteIssueContentHistory

func SoftDeleteIssueContentHistory(dbCtx context.Context, historyID int64) error

SoftDeleteIssueContentHistory soft delete

Types

type ContentHistory

type ContentHistory struct {
	ID             int64 `xorm:"pk autoincr"`
	PosterID       int64
	IssueID        int64              `xorm:"INDEX"`
	CommentID      int64              `xorm:"INDEX"`
	EditedUnix     timeutil.TimeStamp `xorm:"INDEX"`
	ContentText    string             `xorm:"LONGTEXT"`
	IsFirstCreated bool
	IsDeleted      bool
}

ContentHistory save issue/comment content history revisions.

func GetIssueContentHistoryAndPrev

func GetIssueContentHistoryAndPrev(dbCtx context.Context, id int64) (history, prevHistory *ContentHistory, err error)

GetIssueContentHistoryAndPrev get a history and the previous non-deleted history (to compare)

func GetIssueContentHistoryByID

func GetIssueContentHistoryByID(dbCtx context.Context, id int64) (*ContentHistory, error)

GetIssueContentHistoryByID get issue content history

func (*ContentHistory) TableName

func (m *ContentHistory) TableName() string

TableName provides the real table name

type ErrIssueContentHistoryNotExist

type ErrIssueContentHistoryNotExist struct {
	ID int64
}

ErrIssueContentHistoryNotExist not exist error

func (ErrIssueContentHistoryNotExist) Error

Error error string

type IssueContentListItem

type IssueContentListItem struct {
	UserID         int64
	UserName       string
	UserAvatarLink string

	HistoryID      int64
	EditedUnix     timeutil.TimeStamp
	IsFirstCreated bool
	IsDeleted      bool
}

IssueContentListItem the list for web ui

func FetchIssueContentHistoryList

func FetchIssueContentHistoryList(dbCtx context.Context, issueID, commentID int64) ([]*IssueContentListItem, error)

FetchIssueContentHistoryList fetch list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL