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

Method Banners

controllers/api/CommonController.go:1008–1022  ·  view source on GitHub ↗

【OK】

()

Source from the content-addressed store, hash-verified

1006
1007// 【OK】
1008func (this *CommonController) Banners() {
1009 t := this.GetString("type", "wechat")
1010 banners, _ := models.NewBanner().Lists(t)
1011 bannerSize, _ := strconv.ParseFloat(models.GetOptionValue("MOBILE_BANNER_SIZE", "2.619"), 64)
1012 if bannerSize <= 0 {
1013 bannerSize = 2.619
1014 }
1015
1016 for idx, banner := range banners {
1017 banner.Image = this.completeLink(banner.Image)
1018 banners[idx] = banner
1019 }
1020
1021 this.Response(http.StatusOK, messageSuccess, map[string]interface{}{"banners": banners, "size": bannerSize})
1022}
1023
1024func (this *CommonController) Download() {
1025 identify := this.GetString("identify")

Callers

nothing calls this directly

Calls 5

NewBannerFunction · 0.92
GetOptionValueFunction · 0.92
completeLinkMethod · 0.80
ResponseMethod · 0.80
ListsMethod · 0.45

Tested by

no test coverage detected