diff --git a/api/create_task.go b/api/create_task.go index ccc96988..0972e84c 100644 --- a/api/create_task.go +++ b/api/create_task.go @@ -33,6 +33,7 @@ type CreateTaskResponse struct { TaskInfo string `json:"task_info"` TotalContributors int `json:"total_contributors"` ProjectId string `json:"project_id"` + Username string `json:"username"` } func CreateTask(req *CreateTaskRequest) (*CreateTaskResponse, error) { diff --git a/inspector/task_api.go b/inspector/task_api.go index c6eae6f3..391e973e 100644 --- a/inspector/task_api.go +++ b/inspector/task_api.go @@ -48,6 +48,7 @@ func createTask(ctx context.Context) error { c.TaskId = res.TaskInfo c.TotalContributors = res.TotalContributors c.ProjectId = res.ProjectId + c.Username = res.Username logger.Info.Println("task created, id:", res.TaskInfo) return nil } else { diff --git a/model/idea_output.go b/model/idea_output.go index 3b79d3f8..196dc92b 100644 --- a/model/idea_output.go +++ b/model/idea_output.go @@ -18,6 +18,7 @@ func GenerateIdeaErrorOutput(e error) string { type PluginOutput struct { ProjectName string `json:"project_name"` + Username string `json:"username"` ErrCode IdeaErrCode `json:"err_code"` IssuesCount int `json:"issues_count,omitempty"` Comps []PluginComp `json:"comps,omitempty"` @@ -93,6 +94,7 @@ func GenerateIdeaOutput(c context.Context) string { } p := &PluginOutput{ ProjectName: ctx.ProjectName, + Username: ctx.Username, ErrCode: IdeaSucceed, IssuesCount: i.IssuesCompsCount, Comps: []PluginComp{}, diff --git a/model/scan_task.go b/model/scan_task.go index 392fa3db..7712c82d 100644 --- a/model/scan_task.go +++ b/model/scan_task.go @@ -45,6 +45,7 @@ type ScanTask struct { Kind TaskKind ProjectType ProjectType ProjectId string + Username string StartTime time.Time GitInfo *GitInfo TaskType TaskType