From 725ee7d9ad18c7c206a93283f1012a432b0766be Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sat, 22 Jun 2024 00:21:32 +0800 Subject: [PATCH] feat: updated git model --- core/models/models/git_v2.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/core/models/models/git_v2.go b/core/models/models/git_v2.go index 7e4347fd..6dc92f11 100644 --- a/core/models/models/git_v2.go +++ b/core/models/models/git_v2.go @@ -1,17 +1,24 @@ package models +import ( + "github.com/crawlab-team/crawlab/vcs" + "time" +) + type GitV2 struct { any `collection:"gits"` BaseModelV2[GitV2] `bson:",inline"` - Url string `json:"url" bson:"url"` - Name string `json:"name" bson:"name"` - AuthType string `json:"auth_type" bson:"auth_type"` - Username string `json:"username" bson:"username"` - Password string `json:"password" bson:"password"` - CurrentBranch string `json:"current_branch" bson:"current_branch"` - Status string `json:"status" bson:"status"` - Error string `json:"error" bson:"error"` - Spiders []SpiderV2 `json:"spiders,omitempty" bson:"-"` + Url string `json:"url" bson:"url"` + Name string `json:"name" bson:"name"` + AuthType string `json:"auth_type" bson:"auth_type"` + Username string `json:"username" bson:"username"` + Password string `json:"password" bson:"password"` + CurrentBranch string `json:"current_branch" bson:"current_branch"` + Status string `json:"status" bson:"status"` + Error string `json:"error" bson:"error"` + Spiders []SpiderV2 `json:"spiders,omitempty" bson:"-"` + Refs []vcs.GitRef `json:"refs" bson:"refs"` + RefsUpdatedAt time.Time `json:"refs_updated_at" bson:"refs_updated_at"` // settings AutoPull bool `json:"auto_pull" bson:"auto_pull"`