Migrate all methods in the model package to the service package

This commit is contained in:
Granty1
2020-04-08 11:07:27 +08:00
parent 2c35adaffc
commit 5d222585dd
49 changed files with 1348 additions and 1261 deletions
+1 -25
View File
@@ -2,33 +2,9 @@ package model
import (
"gin-vue-admin/config"
"gin-vue-admin/global"
"gin-vue-admin/utils"
)
//配置文件结构体
type System struct {
Config config.Server
}
// @title GetSystemConfig
// @description 读取配置文件
// @auth (2020/04/05 20:22 )
// @return err error
// @return conf Server
func (s *System) GetSystemConfig() (err error, conf config.Server) {
return nil, global.GVA_CONFIG
}
// @title SetSystemConfig
// @description set system config, 设置配置文件
// @auth (2020/04/05 20:22 )
// @return err error
func (s *System) SetSystemConfig() (err error) {
confs := utils.StructToMap(s.Config)
for k, v := range confs {
global.GVA_VP.Set(k, v)
}
err = global.GVA_VP.WriteConfig()
return err
}
}