diff --git a/tenant-platform/src/api/bugcollect.ts b/tenant-platform/src/api/bugcollect.ts index f06a6b5..5fa562f 100644 --- a/tenant-platform/src/api/bugcollect.ts +++ b/tenant-platform/src/api/bugcollect.ts @@ -11,53 +11,65 @@ export interface BugCollectOverview { topIssues: { id: string; title: string; type: string; count: number }[] } +// Matches backend IssueResponse export interface BugCollectIssue { - id: string - title: string + id: number + appKey: string + fingerprint?: string type: string - platform: string - count: number - affectedUsers: number - lastSeenAt: string + title: string firstSeenAt: string - status: string + lastSeenAt: string + count: number + isResolved: boolean + platform: string + appVersion?: string } +// Matches backend IssueResponse (with events embedded) export interface BugCollectIssueDetail { - id: string - title: string + id: number + appKey: string + fingerprint?: string type: string - platform: string - appVersion: string - osVersion: string - deviceModel: string - count: number - affectedUsers: number + title: string firstSeenAt: string lastSeenAt: string - status: string - stackTrace: string - sourceContext?: { line: number; content: string; highlight: boolean }[] - recentEvents: BugCollectEventItem[] + count: number + isResolved: boolean + platform: string + appVersion?: string + events?: BugCollectEventItem[] } +// Matches backend IssueEventResponse export interface BugCollectEventItem { - id: string - eventName: string - userId: string - timestamp: string - properties: Record + id: number + issueId?: number + appKey?: string + userId?: string + sessionId?: string + message?: string + stack?: string + stackSymbolicated?: string + metadata?: string + platform?: string + appVersion?: string + createdAt: string } +// Matches backend IssueResponse used for rankings export interface BugCollectIssueRanking { - id: string + id: number title: string type: string platform: string count: number - affectedUsers: number - riskScore?: number + isResolved: boolean + firstSeenAt: string lastSeenAt: string + appVersion?: string + riskScore?: number } export interface BugCollectFunnelStep { @@ -76,12 +88,12 @@ export interface BugCollectWebhook { updatedAt: string } +// Matches backend PageResult (items/total, not content/totalElements) export interface BugCollectPageResult { - content: T[] + items: T[] page: number size: number - totalElements: number - totalPages: number + total: number } // ── API ───────────────────────────────────────────────────────────────────── @@ -91,7 +103,7 @@ export const bugCollectApi = { overview: (appKey: string) => client.get<{ data: BugCollectOverview }>('/bugcollect/v1/overview', { params: { appKey } }), - // Issues + // Issues — page is 1-based (backend convention); startDate/endDate mapped to from/to issues(appKey: string, params: { type?: string platform?: string @@ -100,7 +112,10 @@ export const bugCollectApi = { page?: number size?: number }) { - return client.get<{ data: BugCollectPageResult }>('/bugcollect/v1/issues', { params: { appKey, ...params } }) + const { startDate, endDate, page, ...rest } = params + return client.get<{ data: BugCollectPageResult }>('/bugcollect/v1/issues', { + params: { appKey, ...rest, from: startDate, to: endDate, page: (page ?? 0) + 1 }, + }) }, issueDetail(id: string) { @@ -116,7 +131,7 @@ export const bugCollectApi = { return client.get<{ data: BugCollectIssueRanking[] }>('/bugcollect/v1/issues/rankings/risk', { params: { appKey } }) }, - // Events + // Events — eventName→name, startDate/endDate→from/to, page is 0-based from caller → +1 for backend events(appKey: string, params: { eventName?: string userId?: string @@ -125,7 +140,10 @@ export const bugCollectApi = { page?: number size?: number }) { - return client.get<{ data: BugCollectPageResult }>('/bugcollect/v1/events', { params: { appKey, ...params } }) + const { eventName, startDate, endDate, page, ...rest } = params + return client.get<{ data: BugCollectPageResult }>('/bugcollect/v1/events', { + params: { appKey, ...rest, name: eventName, from: startDate, to: endDate, page: (page ?? 0) + 1 }, + }) }, // Funnel diff --git a/tenant-platform/src/views/bug-collect/BugCollectEvents.vue b/tenant-platform/src/views/bug-collect/BugCollectEvents.vue index 670a1d9..90d2cc6 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectEvents.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectEvents.vue @@ -58,20 +58,22 @@
- - - + + + + + - + @@ -137,8 +139,8 @@ async function loadData() { size: pageSize.value, }) const data = res.data.data - events.value = data.content ?? [] - total.value = data.totalElements ?? 0 + events.value = data.items ?? [] + total.value = data.total ?? 0 } catch { } finally { loading.value = false diff --git a/tenant-platform/src/views/bug-collect/BugCollectIssues.vue b/tenant-platform/src/views/bug-collect/BugCollectIssues.vue index b580d25..ece1f80 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectIssues.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectIssues.vue @@ -67,7 +67,7 @@ - +