Merge pull request 'fix: 항적 조회 500 에러 + 리플레이 쿼리 무반응 수정' (#64) from develop into main
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 3m35s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 3m35s
This commit is contained in:
커밋
9ae56f5517
@ -51,7 +51,7 @@ export const gisApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getVesselTracks(mmsiList: string[], startTime: string, endTime: string): Promise<VesselTrackResult[]> {
|
getVesselTracks(mmsiList: string[], startTime: string, endTime: string): Promise<VesselTrackResult[]> {
|
||||||
return postJson('/api/v2/tracks/vessels', { mmsiList, startTime, endTime })
|
return postJson('/api/v2/tracks/vessels', { vessels: mmsiList, startTime, endTime })
|
||||||
},
|
},
|
||||||
|
|
||||||
getRecentPositions(minutes = 10): Promise<RecentPosition[]> {
|
getRecentPositions(minutes = 10): Promise<RecentPosition[]> {
|
||||||
|
|||||||
@ -40,9 +40,10 @@ export default function ReplaySetupPanel({ map }: ReplaySetupPanelProps) {
|
|||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
if (!map) return
|
if (!map) return
|
||||||
const bounds = getViewportBounds(map)
|
const bounds = getViewportBounds(map)
|
||||||
const zoom = map.getZoom()
|
const zoom = Math.round(map.getZoom())
|
||||||
const startISO = startTime.replace('T', ' ') + ':00'
|
// 백엔드 @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") 형식 유지
|
||||||
const endISO = endTime.replace('T', ' ') + ':00'
|
const startISO = startTime + ':00'
|
||||||
|
const endISO = endTime + ':00'
|
||||||
replayWebSocket.executeQuery(startISO, endISO, bounds, zoom)
|
replayWebSocket.executeQuery(startISO, endISO, bounds, zoom)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -94,12 +94,16 @@ class ReplayWebSocketService {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onStompError: (frame) => {
|
onStompError: (frame) => {
|
||||||
console.error('[ReplayWS] STOMP error:', frame.headers.message)
|
console.error('[ReplayWS] STOMP error:', frame.headers.message, frame.body)
|
||||||
|
if (replayStore.querying) {
|
||||||
|
replayStore.completeQuery()
|
||||||
|
}
|
||||||
replayStore.setConnectionState('error')
|
replayStore.setConnectionState('error')
|
||||||
reject(new Error(frame.headers.message))
|
reject(new Error(frame.headers.message))
|
||||||
},
|
},
|
||||||
|
|
||||||
onWebSocketError: () => {
|
onWebSocketError: (evt) => {
|
||||||
|
console.error('[ReplayWS] WebSocket error:', evt)
|
||||||
replayStore.setConnectionState('error')
|
replayStore.setConnectionState('error')
|
||||||
reject(new Error('WebSocket connection failed'))
|
reject(new Error('WebSocket connection failed'))
|
||||||
},
|
},
|
||||||
@ -158,6 +162,7 @@ class ReplayWebSocketService {
|
|||||||
zoomLevel,
|
zoomLevel,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('[ReplayWS] Sending query:', request.startTime, '~', request.endTime, 'zoom:', request.zoomLevel)
|
||||||
this.client.publish({
|
this.client.publish({
|
||||||
destination: '/app/tracks/query',
|
destination: '/app/tracks/query',
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
@ -196,9 +201,15 @@ class ReplayWebSocketService {
|
|||||||
this.client.subscribe('/user/queue/tracks/response', (msg: IMessage) => {
|
this.client.subscribe('/user/queue/tracks/response', (msg: IMessage) => {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(msg.body)
|
const data = JSON.parse(msg.body)
|
||||||
|
console.log('[ReplayWS] Response:', data.status, data.queryId)
|
||||||
if (data.queryId) {
|
if (data.queryId) {
|
||||||
this.currentQueryId = data.queryId
|
this.currentQueryId = data.queryId
|
||||||
}
|
}
|
||||||
|
if (data.status === 'ERROR') {
|
||||||
|
console.error('[ReplayWS] Query error:', data.message)
|
||||||
|
this.clearQueryTimeout()
|
||||||
|
useReplayStore.getState().completeQuery()
|
||||||
|
}
|
||||||
} catch { /* ignore */ }
|
} catch { /* ignore */ }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user