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

View File

@@ -0,0 +1,31 @@
package service
import (
"gin-vue-admin/config"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/utils"
)
// @title GetSystemConfig
// @description 读取配置文件
// @auth 2020/04/05 20:22
// @return err error
// @return conf Server
func 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 SetSystemConfig(s model.System) (err error) {
cs := utils.StructToMap(s.Config)
for k, v := range cs {
global.GVA_VP.Set(k, v)
}
err = global.GVA_VP.WriteConfig()
return err
}