fix: 完成商务迁移复核与接口优化并清理历史资料
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package config
|
||||
|
||||
import "strings"
|
||||
|
||||
// SwaggerEnabled exposes API documentation only in explicitly selected local/test environments.
|
||||
func SwaggerEnabled(admin *Admin) bool {
|
||||
if admin == nil || admin.App == nil {
|
||||
return false
|
||||
}
|
||||
switch strings.ToLower(strings.TrimSpace(admin.App.Env)) {
|
||||
case "development", "dev", "test", "local":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user