feat: add desktop bug report collection
This commit is contained in:
@@ -414,6 +414,8 @@ func isMultipartRoute(route gin.RouteInfo) bool {
|
||||
}
|
||||
path := route.Path
|
||||
return path == "/api/tenant/images" ||
|
||||
path == "/api/desktop/bug-reports" ||
|
||||
path == "/api/desktop/clients/bug-reports" ||
|
||||
path == "/api/ops/site-domain-mappings/import" ||
|
||||
path == "/api/ops/object-storage/objects/upload" ||
|
||||
path == "/api/ops/desktop-client/releases/upload" ||
|
||||
@@ -431,6 +433,23 @@ func multipartRequestBody(path string) map[string]any {
|
||||
}
|
||||
required := []string{"file"}
|
||||
|
||||
if path == "/api/desktop/bug-reports" || path == "/api/desktop/clients/bug-reports" {
|
||||
properties = map[string]any{
|
||||
"upload_file_minidump": map[string]any{
|
||||
"type": "string",
|
||||
"format": "binary",
|
||||
"description": "Electron crashReporter 默认上传的 minidump 字段;手动反馈也可用 dump 或 file 字段。",
|
||||
},
|
||||
"report_type": map[string]any{"type": "string", "enum": []string{"crash", "bug"}},
|
||||
"severity": map[string]any{"type": "string", "enum": []string{"low", "medium", "high", "critical"}},
|
||||
"title": map[string]any{"type": "string"},
|
||||
"description": map[string]any{"type": "string"},
|
||||
"runtime_snapshot": map[string]any{"type": "string"},
|
||||
"app_log_tail": map[string]any{"type": "string"},
|
||||
}
|
||||
required = nil
|
||||
}
|
||||
|
||||
if path == "/api/tenant/images" {
|
||||
properties["folder_id"] = map[string]any{"type": "string"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user