MCPcopy Index your code
hub / github.com/TruthHun/BookStack / ToBookResult

Method ToBookResult

models/book.go:590–632  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

588}
589
590func (book *Book) ToBookResult() (m *BookResult) {
591 m = &BookResult{}
592 m.BookId = book.BookId
593 m.BookName = book.BookName
594 m.Identify = book.Identify
595 m.OrderIndex = book.OrderIndex
596 m.Description = strings.Replace(book.Description, "\r\n", "<br/>", -1)
597 m.PrivatelyOwned = book.PrivatelyOwned
598 m.PrivateToken = book.PrivateToken
599 m.DocCount = book.DocCount
600 m.CommentStatus = book.CommentStatus
601 m.CommentCount = book.CommentCount
602 m.CreateTime = book.CreateTime
603 m.ModifyTime = book.ModifyTime
604 m.Cover = strings.ReplaceAll(book.Cover, "\\", "/")
605 m.MemberId = book.MemberId
606 m.Label = book.Label
607 m.Status = book.Status
608 m.Editor = book.Editor
609 m.Theme = book.Theme
610 m.Vcnt = book.Vcnt
611 m.Star = book.Star
612 m.Score = book.Score
613 m.ScoreFloat = utils.ScoreFloat(book.Score)
614 m.CntScore = book.CntScore
615 m.CntComment = book.CntComment
616 m.Author = book.Author
617 m.AuthorURL = book.AuthorURL
618 m.AdTitle = book.AdTitle
619 m.AdLink = book.AdLink
620 m.Lang = book.Lang
621
622 json.Unmarshal([]byte(book.NavJSON), &m.Navs)
623
624 if book.Theme == "" {
625 m.Theme = "default"
626 }
627
628 if book.Editor == "" {
629 m.Editor = "markdown"
630 }
631 return m
632}
633
634//重置文档数量
635func (m *Book) ResetDocumentNumber(bookId int) {

Callers 3

FindByIdentifyMethod · 0.95
isReadableFunction · 0.80
EditMethod · 0.80

Calls 2

ScoreFloatFunction · 0.92
ReplaceMethod · 0.45

Tested by

no test coverage detected