From 1bb4364d0e5ab3e30d78acbe0f2a5a83b66befb2 Mon Sep 17 00:00:00 2001 From: Lynwee Date: Wed, 21 Feb 2024 17:56:09 +0800 Subject: [PATCH] fix(zentao): update the type of `PriOrder` (#6986) --- backend/plugins/zentao/models/story.go | 108 +++++++++--------- backend/plugins/zentao/models/task.go | 12 +- .../plugins/zentao/tasks/story_extractor.go | 2 +- .../plugins/zentao/tasks/task_extractor.go | 2 +- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/backend/plugins/zentao/models/story.go b/backend/plugins/zentao/models/story.go index 661a62603bd..42956b7fad9 100644 --- a/backend/plugins/zentao/models/story.go +++ b/backend/plugins/zentao/models/story.go @@ -22,60 +22,60 @@ import ( ) type ZentaoStoryRes struct { - ID int64 `json:"id"` - Vision string `json:"vision"` - Parent int64 `json:"parent"` - Product int64 `json:"product"` - Branch int `json:"branch"` - Module int `json:"module"` - Plan string `json:"plan"` - Source string `json:"source"` - SourceNote string `json:"sourceNote"` - FromBug int `json:"fromBug"` - Feedback int `json:"feedback"` - Title string `json:"title"` - Keywords string `json:"keywords"` - Type string `json:"type"` - Category string `json:"category"` - Pri int `json:"pri"` - Estimate float64 `json:"estimate"` - Status string `json:"status"` - SubStatus string `json:"subStatus"` - Color string `json:"color"` - Stage string `json:"stage"` - Mailto []interface{} `json:"mailto"` - Lib int `json:"lib"` - FromStory int64 `json:"fromStory"` - FromVersion int `json:"fromVersion"` - OpenedBy *ApiAccount `json:"openedBy"` - OpenedDate *common.Iso8601Time `json:"openedDate"` - AssignedTo *ApiAccount `json:"assignedTo"` - AssignedDate *common.Iso8601Time `json:"assignedDate"` - ApprovedDate *common.Iso8601Time `json:"approvedDate"` - LastEditedBy *ApiAccount `json:"lastEditedBy"` - LastEditedDate *common.Iso8601Time `json:"lastEditedDate"` - ChangedBy string `json:"changedBy"` - ChangedDate *common.Iso8601Time `json:"changedDate"` - ReviewedBy *ApiAccount `json:"reviewedBy"` - ReviewedDate *common.Iso8601Time `json:"reviewedDate"` - ClosedBy *ApiAccount `json:"closedBy"` - ClosedDate *common.Iso8601Time `json:"closedDate"` - ClosedReason string `json:"closedReason"` - ActivatedDate *common.Iso8601Time `json:"activatedDate"` - ToBug int `json:"toBug"` - ChildStories string `json:"childStories"` - LinkStories string `json:"linkStories"` - LinkRequirements string `json:"linkRequirements"` - DuplicateStory int64 `json:"duplicateStory"` - Version int `json:"version"` - StoryChanged string `json:"storyChanged"` - FeedbackBy string `json:"feedbackBy"` - NotifyEmail string `json:"notifyEmail"` - URChanged string `json:"URChanged"` - Deleted bool `json:"deleted"` - PriOrder string `json:"priOrder"` - PlanTitle string `json:"planTitle"` - ProductStatus string `json:"productStatus"` + ID int64 `json:"id"` + Vision string `json:"vision"` + Parent int64 `json:"parent"` + Product int64 `json:"product"` + Branch int `json:"branch"` + Module int `json:"module"` + Plan string `json:"plan"` + Source string `json:"source"` + SourceNote string `json:"sourceNote"` + FromBug int `json:"fromBug"` + Feedback int `json:"feedback"` + Title string `json:"title"` + Keywords string `json:"keywords"` + Type string `json:"type"` + Category string `json:"category"` + Pri int `json:"pri"` + Estimate float64 `json:"estimate"` + Status string `json:"status"` + SubStatus string `json:"subStatus"` + Color string `json:"color"` + Stage string `json:"stage"` + Mailto []interface{} `json:"mailto"` + Lib int `json:"lib"` + FromStory int64 `json:"fromStory"` + FromVersion int `json:"fromVersion"` + OpenedBy *ApiAccount `json:"openedBy"` + OpenedDate *common.Iso8601Time `json:"openedDate"` + AssignedTo *ApiAccount `json:"assignedTo"` + AssignedDate *common.Iso8601Time `json:"assignedDate"` + ApprovedDate *common.Iso8601Time `json:"approvedDate"` + LastEditedBy *ApiAccount `json:"lastEditedBy"` + LastEditedDate *common.Iso8601Time `json:"lastEditedDate"` + ChangedBy string `json:"changedBy"` + ChangedDate *common.Iso8601Time `json:"changedDate"` + ReviewedBy *ApiAccount `json:"reviewedBy"` + ReviewedDate *common.Iso8601Time `json:"reviewedDate"` + ClosedBy *ApiAccount `json:"closedBy"` + ClosedDate *common.Iso8601Time `json:"closedDate"` + ClosedReason string `json:"closedReason"` + ActivatedDate *common.Iso8601Time `json:"activatedDate"` + ToBug int `json:"toBug"` + ChildStories string `json:"childStories"` + LinkStories string `json:"linkStories"` + LinkRequirements string `json:"linkRequirements"` + DuplicateStory int64 `json:"duplicateStory"` + Version int `json:"version"` + StoryChanged string `json:"storyChanged"` + FeedbackBy string `json:"feedbackBy"` + NotifyEmail string `json:"notifyEmail"` + URChanged string `json:"URChanged"` + Deleted bool `json:"deleted"` + PriOrder *common.StringFloat64 `json:"priOrder"` + PlanTitle string `json:"planTitle"` + ProductStatus string `json:"productStatus"` } type ZentaoStory struct { diff --git a/backend/plugins/zentao/models/task.go b/backend/plugins/zentao/models/task.go index 8bbc5fe3883..494d64aa910 100644 --- a/backend/plugins/zentao/models/task.go +++ b/backend/plugins/zentao/models/task.go @@ -83,12 +83,12 @@ type ZentaoTaskRes struct { } `json:"latestStoryVersion"` StoryStatus interface { } `json:"storyStatus"` - AssignedToRealName string `json:"assignedToRealName"` - PriOrder string `json:"priOrder"` - Children []*ZentaoTaskRes `json:"children"` - Delay int `json:"delay"` - NeedConfirm bool `json:"needConfirm"` - Progress float64 `json:"progress"` + AssignedToRealName string `json:"assignedToRealName"` + PriOrder *common.StringFloat64 `json:"priOrder"` + Children []*ZentaoTaskRes `json:"children"` + Delay int `json:"delay"` + NeedConfirm bool `json:"needConfirm"` + Progress float64 `json:"progress"` } func (zentaoTaskRes ZentaoTaskRes) ToJsonRawMessage() (json.RawMessage, error) { diff --git a/backend/plugins/zentao/tasks/story_extractor.go b/backend/plugins/zentao/tasks/story_extractor.go index 7f94c4f0724..1d00dcf9e8c 100644 --- a/backend/plugins/zentao/tasks/story_extractor.go +++ b/backend/plugins/zentao/tasks/story_extractor.go @@ -120,7 +120,7 @@ func ExtractStory(taskCtx plugin.SubTaskContext) errors.Error { NotifyEmail: res.NotifyEmail, URChanged: res.URChanged, Deleted: res.Deleted, - PriOrder: res.PriOrder, + PriOrder: res.PriOrder.String(), PlanTitle: res.PlanTitle, Url: row.Url, } diff --git a/backend/plugins/zentao/tasks/task_extractor.go b/backend/plugins/zentao/tasks/task_extractor.go index d18701c299c..422e5eead93 100644 --- a/backend/plugins/zentao/tasks/task_extractor.go +++ b/backend/plugins/zentao/tasks/task_extractor.go @@ -146,7 +146,7 @@ func (c *taskExtractor) toZentaoTasks(accountCache *AccountCache, res *models.Ze StoryTitle: res.StoryTitle, LatestStoryVersion: 0, AssignedToRealName: res.AssignedToRealName, - PriOrder: res.PriOrder, + PriOrder: res.PriOrder.String(), NeedConfirm: res.NeedConfirm, Progress: res.Progress, Url: url,