mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 12:16:24 +08:00
20 lines
464 B
Go
20 lines
464 B
Go
package middlewares
|
|
|
|
import (
|
|
"github.com/OpenListTeam/OpenList/v4/internal/conf"
|
|
"github.com/OpenListTeam/OpenList/v4/internal/errs"
|
|
"github.com/OpenListTeam/OpenList/v4/internal/setting"
|
|
"github.com/OpenListTeam/OpenList/v4/server/common"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func SearchIndex(c *gin.Context) {
|
|
mode := setting.GetStr(conf.SearchIndex)
|
|
if mode == "none" {
|
|
common.ErrorResp(c, errs.SearchNotAvailable, 500)
|
|
c.Abort()
|
|
} else {
|
|
c.Next()
|
|
}
|
|
}
|