mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
refactor: combined system collections
This commit is contained in:
@@ -15,37 +15,7 @@ import (
|
||||
var (
|
||||
typeNameColNameMap = make(map[string]string)
|
||||
typeOneNameModelMap = make(map[string]any)
|
||||
typeOneInstances = []any{
|
||||
*new(models2.TestModelV2),
|
||||
*new(models2.DataCollectionV2),
|
||||
*new(models2.DatabaseV2),
|
||||
*new(models2.DatabaseMetricV2),
|
||||
*new(models2.DependencyV2),
|
||||
*new(models2.DependencyLogV2),
|
||||
*new(models2.DependencySettingV2),
|
||||
*new(models2.DependencyTaskV2),
|
||||
*new(models2.EnvironmentV2),
|
||||
*new(models2.GitV2),
|
||||
*new(models2.MetricV2),
|
||||
*new(models2.NodeV2),
|
||||
*new(models2.NotificationChannelV2),
|
||||
*new(models2.NotificationRequestV2),
|
||||
*new(models2.NotificationSettingV2),
|
||||
*new(models2.PermissionV2),
|
||||
*new(models2.ProjectV2),
|
||||
*new(models2.RolePermissionV2),
|
||||
*new(models2.RoleV2),
|
||||
*new(models2.ScheduleV2),
|
||||
*new(models2.SettingV2),
|
||||
*new(models2.SpiderV2),
|
||||
*new(models2.SpiderStatV2),
|
||||
*new(models2.TaskQueueItemV2),
|
||||
*new(models2.TaskStatV2),
|
||||
*new(models2.TaskV2),
|
||||
*new(models2.TokenV2),
|
||||
*new(models2.UserRoleV2),
|
||||
*new(models2.UserV2),
|
||||
}
|
||||
typeOneInstances = models2.GetModelInstances()
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -79,6 +79,7 @@ func GetModelInstances() []any {
|
||||
*new(GitV2),
|
||||
*new(MetricV2),
|
||||
*new(NodeV2),
|
||||
*new(NotificationAlertV2),
|
||||
*new(NotificationChannelV2),
|
||||
*new(NotificationRequestV2),
|
||||
*new(NotificationSettingV2),
|
||||
@@ -116,7 +117,6 @@ func GetCollectionNameByInstance(v any) string {
|
||||
return field.Tag.Get("collection")
|
||||
}
|
||||
|
||||
// Add this new function
|
||||
func GetSystemModelColNamesMap() map[string]bool {
|
||||
colNamesMap := make(map[string]bool)
|
||||
for _, instance := range GetModelInstances() {
|
||||
|
||||
Reference in New Issue
Block a user