Files
be.ems/src/modules/common/service/commont.impl.go
2023-12-21 20:42:50 +08:00

63 lines
2.2 KiB
Go

package service
import (
"ems.agt/lib/global"
systemService "ems.agt/src/modules/system/service"
)
// 实例化服务层 CommontImpl 结构体
var NewCommontImpl = &CommontImpl{
sysUserService: systemService.NewSysUserImpl,
sysConfigService: systemService.NewSysConfigImpl,
}
// 通用请求 服务层处理
type CommontImpl struct {
// 用户信息服务
sysUserService systemService.ISysUser
// 参数配置服务
sysConfigService systemService.ISysConfig
}
// SystemConfigInfo 系统配置信息
func (s *CommontImpl) SystemConfigInfo() map[string]string {
infoMap := map[string]string{}
// 获取打包注入的全局变量信息
infoMap["version"] = global.Version
infoMap["buildTime"] = global.BuildTime
infoMap["goVer"] = global.GoVer
// 获取LOGO类型
logoType := s.sysConfigService.SelectConfigValueByKey("sys.logo.type")
infoMap["logoType"] = logoType
// 获取LOGO文件
filePathIcon := s.sysConfigService.SelectConfigValueByKey("sys.logo.filePathIcon")
infoMap["filePathIcon"] = filePathIcon
filePathBrand := s.sysConfigService.SelectConfigValueByKey("sys.logo.filePathBrand")
infoMap["filePathBrand"] = filePathBrand
// 获取系统名称
title := s.sysConfigService.SelectConfigValueByKey("sys.title")
infoMap["title"] = title
// 获取版权声明
copyright := s.sysConfigService.SelectConfigValueByKey("sys.copyright")
infoMap["copyright"] = copyright
// 获取是否开启用户注册功能
registerUser := s.sysConfigService.SelectConfigValueByKey("sys.account.registerUser")
infoMap["registerUser"] = registerUser
// 获取登录界面背景
loginBackground := s.sysConfigService.SelectConfigValueByKey("sys.loginBackground")
infoMap["loginBackground"] = loginBackground
// 系统设置-官网网址
officialUrl := s.sysConfigService.SelectConfigValueByKey("sys.officialUrl")
infoMap["officialUrl"] = officialUrl
// 系统设置-系统使用文档
helpDoc := s.sysConfigService.SelectConfigValueByKey("sys.helpDoc")
infoMap["helpDoc"] = helpDoc
// 国际化切换
i18nOpen := s.sysConfigService.SelectConfigValueByKey("sys.i18n.open")
infoMap["i18nOpen"] = i18nOpen
// 国际化默认语言
i18nDefault := s.sysConfigService.SelectConfigValueByKey("sys.i18n.default")
infoMap["i18nDefault"] = i18nDefault
return infoMap
}