Skip to content

Commit

Permalink
feat: 加字段
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki-working committed Jan 24, 2024
1 parent e32ad4c commit e943226
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions model/idea_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type PluginComp struct {
PackageManager string `json:"package_manager"`
DirectDependency []ComponentFixPlanList `json:"direct_dependency"`
FixPreviews fix.Response `json:"fix_previews"`
IsTriggers bool `json:"is_triggers"`
}

type ComponentFixPlanList struct {
Expand Down Expand Up @@ -117,6 +118,7 @@ func GetIDEAOutput(task *ScanTask) PluginOutput {
Solutions: utils.NoNilSlice(effect.Solutions),
SuggestLevel: info.FixSuggestionLevel,
Title: info.Title,
VulnType: info.VulnType,
}
if time.Time(info.PublishedDate).IsZero() {
d.PublishTime = 0
Expand Down Expand Up @@ -175,6 +177,7 @@ func GetIDEAOutput(task *ScanTask) PluginOutput {
PackageManager: pmMap[comp.Component],
DirectDependency: utils.NoNilSlice(directDependencyFixPlan),
FixPreviews: codeFragments[comp.Component],
IsTriggers: comp.IsTriggers,
}

// workaround: IDE侧要求我一定加进去,后续他不要求了,就删掉
Expand Down Expand Up @@ -210,4 +213,5 @@ type PluginVulnDetailInfo struct {
Solutions []Solution `json:"solutions"`
SuggestLevel string `json:"suggest_level"`
Title string `json:"title"`
VulnType string `json:"vuln_type"`
}
1 change: 1 addition & 0 deletions model/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ScanResultCompInfo struct {
FixPlans FixPlanList `json:"fix_plans"`
SuggestLevel int `json:"suggest_level"` // 对应到IDEA的show_level,具体计算规则不明
DirectDependency []Component `json:"direct_dependency"`
IsTriggers bool `json:"is_triggers"`
}

type ScanResultCompEffect struct {
Expand Down

0 comments on commit e943226

Please sign in to comment.