From b5fa99350587ba78668db7b3924ee6f40a2c3f6d Mon Sep 17 00:00:00 2001
From: iseki <admin@iseki.space>
Date: Mon, 20 Jun 2022 23:00:21 +0800
Subject: [PATCH] fix: ideascan field CompSecScore

---
 model/idea_output.go | 2 ++
 model/result.go      | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/model/idea_output.go b/model/idea_output.go
index 10f27689..3b79d3f8 100644
--- a/model/idea_output.go
+++ b/model/idea_output.go
@@ -48,6 +48,7 @@ type PluginComp struct {
 	IsDirectDependency bool                 `json:"is_direct_dependency"`
 	Language           string               `json:"language"`
 	FixType            string               `json:"fix_type"`
+	CompSecScore       int                  `json:"comp_sec_score"`
 }
 
 type PluginCompLicense struct {
@@ -120,6 +121,7 @@ func GenerateIdeaOutput(c context.Context) string {
 				Solutions:       []PluginCompSolution{},
 				Language:        mod.Language,
 				FixType:         comp.FixType,
+				CompSecScore:    comp.CompSecScore,
 			}
 			for _, it := range comp.MinFixedInfo {
 				p.DisposePlan = append(p.DisposePlan, PluginCompFix{
diff --git a/model/result.go b/model/result.go
index eccc63f1..4a2681ca 100644
--- a/model/result.go
+++ b/model/result.go
@@ -32,8 +32,9 @@ type TaskScanResponse struct {
 				Description   string `json:"description"`
 				Type          string `json:"type,omitempty"`
 			} `json:"solutions,omitempty"`
-			Vuls    []VoVulnInfo `json:"vuls"`
-			FixType string       `json:"fix_type"`
+			Vuls         []VoVulnInfo `json:"vuls"`
+			FixType      string       `json:"fix_type"`
+			CompSecScore int          `json:"comp_sec_score"`
 		} `json:"comps"`
 	} `json:"modules"`
 	TaskId           string `json:"task_id"`