style: 系统信息any类型声明

This commit is contained in:
TsMask
2023-10-25 17:06:48 +08:00
parent f566dd0170
commit 840b754d37
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ type ISystemInfo interface {
SystemInfo() map[string]any
// TimeInfo 系统时间信息
TimeInfo() map[string]any
TimeInfo() map[string]string
// MemoryInfo 内存信息
MemoryInfo() map[string]any

View File

@@ -49,7 +49,7 @@ func (s *SystemInfoImpl) SystemInfo() map[string]any {
}
// TimeInfo 系统时间信息
func (s *SystemInfoImpl) TimeInfo() map[string]any {
func (s *SystemInfoImpl) TimeInfo() map[string]string {
now := time.Now()
// 获取当前时间
current := now.Format("2006-01-02 15:04:05")
@@ -58,7 +58,7 @@ func (s *SystemInfoImpl) TimeInfo() map[string]any {
// 获取时区名称
timezoneName := now.Format("MST")
return map[string]any{
return map[string]string{
"current": current,
"timezone": timezone,
"timezoneName": timezoneName,