Files
mayfly-go/server/internal/file/config/config.go

26 lines
450 B
Go
Raw Normal View History

package config
import (
2025-06-27 12:17:45 +08:00
"cmp"
sysapp "mayfly-go/internal/sys/application"
2025-06-27 12:17:45 +08:00
"github.com/spf13/cast"
)
const (
ConfigKeyFile string = "FileConfig" // 文件配置key
)
type FileConfig struct {
BasePath string // 文件基础路径
}
func GetFileConfig() *FileConfig {
c := sysapp.GetConfigApp().GetConfig(ConfigKeyFile)
jm := c.GetJsonMap()
fc := new(FileConfig)
2025-06-27 12:17:45 +08:00
fc.BasePath = cmp.Or(cast.ToString(jm["basePath"]), "./file")
return fc
}