mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
feat: 新增统一文件模块,统一文件操作
This commit is contained in:
24
server/internal/file/config/config.go
Normal file
24
server/internal/file/config/config.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
sysapp "mayfly-go/internal/sys/application"
|
||||
|
||||
"github.com/may-fly/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)
|
||||
fc.BasePath = cast.ToStringD(jm["basePath"], "./file")
|
||||
return fc
|
||||
}
|
||||
Reference in New Issue
Block a user