feat: 新增统一文件模块,统一文件操作

This commit is contained in:
meilin.huang
2024-10-21 22:27:42 +08:00
parent 6343173cf8
commit ea3c70a8a8
71 changed files with 1642 additions and 1216 deletions

View 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
}