MCPcopy
hub / github.com/apache/answer / SetShortIDFlag

Method SetShortIDFlag

internal/base/middleware/short_id.go:39–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39func (sm *ShortIDMiddleware) SetShortIDFlag() gin.HandlerFunc {
40 return func(ctx *gin.Context) {
41 siteSeo, err := sm.siteInfoService.GetSiteSeo(ctx)
42 if err != nil {
43 log.Error(err)
44 return
45 }
46 ctx.Set(constant.ShortIDFlag, siteSeo.IsShortLink())
47 }
48}

Callers 1

NewHTTPServerFunction · 0.80

Calls 3

SetMethod · 0.80
IsShortLinkMethod · 0.80
GetSiteSeoMethod · 0.65

Tested by

no test coverage detected