package service import ( "pure-admin/config" "pure-admin/global" "pure-admin/model" "pure-admin/utils" ) // @function: GetSystemConfig // @description: 读取配置文件 // @return: err error, conf config.Server func GetSystemConfig() (err error, conf config.Server) { return nil, global.MG_CONFIG } // @description set system config, // @function: SetSystemConfig // @description: 设置配置文件 // @param: system model.System // @return: err error func SetSystemConfig(system model.System) (err error) { cs := utils.StructToMap(system.Config) for k, v := range cs { global.MG_VP.Set(k, v) } err = global.MG_VP.WriteConfig() return err }