重构数据引擎和报表引擎

This commit is contained in:
2026-06-11 13:06:54 +08:00
parent 285a0fc632
commit 419473f266
53 changed files with 8434 additions and 375 deletions

View File

@@ -7,6 +7,8 @@ import (
dto "dataengine/model/dto/dict"
entity "dataengine/model/entity/dict"
"errors"
"github.com/gogf/gf/v2/os/gtime"
)
type apiInterfaceService struct{}
@@ -85,8 +87,8 @@ func (s *apiInterfaceService) List(ctx context.Context, req *dto.ListApiInterfac
Method: item.Method,
Status: item.Status,
StatusName: s.getStatusName(item.Status),
CreatedAt: item.CreatedAt.Unix(),
UpdatedAt: item.UpdatedAt.Unix(),
CreatedAt: safeUnix(item.CreatedAt),
UpdatedAt: safeUnix(item.UpdatedAt),
})
}
@@ -181,3 +183,11 @@ func (s *apiInterfaceService) getStatusName(status consts.PlatformStatus) string
}
return string(status)
}
// safeUnix 安全地从 *gtime.Time 获取 Unix 时间戳nil 返回 0
func safeUnix(t *gtime.Time) int64 {
if t == nil {
return 0
}
return t.Unix()
}