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

Method Replace

controllers/BookController.go:42–62  ·  view source on GitHub ↗

替换字符串

()

Source from the content-addressed store, hash-verified

40
41// 替换字符串
42func (this *BookController) Replace() {
43 identify := this.GetString(":key")
44 src := this.GetString("src")
45 dst := this.GetString("dst")
46
47 if this.Member.MemberId == 0 {
48 this.JsonResult(1, "请先登录")
49 }
50
51 book, err := models.NewBookResult().FindByIdentify(identify, this.Member.MemberId)
52 if err != nil {
53 if err == orm.ErrNoRows {
54 this.JsonResult(1, "内容不存在")
55 }
56 this.JsonResult(1, err.Error())
57 }
58
59 models.NewBook().Replace(book.BookId, src, dst)
60
61 this.JsonResult(0, "替换成功")
62}
63
64func (this *BookController) Index() {
65 this.Data["SettingBook"] = true

Callers 8

ContentMethod · 0.45
GetSeoByPageMethod · 0.45
sortBySummaryMethod · 0.45
UploadMethod · 0.45
UploadCoverMethod · 0.45
unzipToDataMethod · 0.45
loadByFolderMethod · 0.45
fixFileLinksMethod · 0.45

Calls 4

NewBookResultFunction · 0.92
NewBookFunction · 0.92
JsonResultMethod · 0.80
FindByIdentifyMethod · 0.45

Tested by

no test coverage detected