konlue opened a new pull request, #7742:
URL: https://github.com/apache/shenyu/pull/7742
Fixes #7731.
## Summary
`InstanceInfoVO` has no `id` property and
`InstanceInfoServiceImpl#buildInstanceInfoVO` copies all persisted fields
except the primary key. Both the instance list and detail endpoints use that
conversion, so the dashboard's `item.key = item.id` receives an undefined value
and table row selection has no stable key.
## Modifications
- Add the `id` field (with getter/setter) to `InstanceInfoVO`.
- Copy the DO id in the shared DO-to-VO conversion, which covers list,
detail and paging responses.
- Add regression coverage for the response contract.
## Verifying this change
- [x] New `InstanceInfoServiceImplTest`: `findById` propagates the record
id; `listByPage` exposes distinct non-empty ids for two records.
- [x] `InstanceControllerTest`: asserts `dataList[0].id` / `dataList[1].id`
in the list JSON and `data.id` in the detail JSON.
- [x] Red-green: removing the conversion line makes the service tests fail
with a null id; restoring it passes (service 2/2, controller 4/4).
- [x] Targeted tests pass:
```bash
./mvnw -B -ntp -pl shenyu-admin test
-Dtest=InstanceInfoServiceImplTest,InstanceControllerTest
```
6/6 green.
- [x] Checkstyle passes:
```bash
./mvnw -B -ntp -pl shenyu-admin checkstyle:check
```
clean.
## Notes
The dashboard already keys instance rows by `item.id`, so this backend
change is sufficient; no dashboard change is included. Live heartbeat-map
overlays in the controller only replace heartbeat time/state/update time,
leaving the persisted id intact.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]