mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
24 lines
614 B
Go
24 lines
614 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/ShukeBta/MediaStationGo/internal/service"
|
|
)
|
|
|
|
const hideCommunityLinksSettingKey = "ui.hide_community_links_for_users"
|
|
|
|
func publicUIConfigHandler(svc *service.Container) gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
hide := false
|
|
if svc != nil && svc.Repo != nil && svc.Repo.Setting != nil {
|
|
if value, err := svc.Repo.Setting.Get(c.Request.Context(), hideCommunityLinksSettingKey); err == nil {
|
|
hide = value == "true" || value == "1"
|
|
}
|
|
}
|
|
c.JSON(http.StatusOK, gin.H{"hide_community_links_for_users": hide})
|
|
}
|
|
}
|