Skip to content

fix: metric datasource scoping and audit field overwrite autofill - #170

Merged
VLSMB merged 4 commits into
mainfrom
fix/bug
Sep 30, 2026
Merged

VLSMB merged 4 commits into
mainfrom
fix/bug

Conversation

@VLSMB

@VLSMB VLSMB commented Sep 30, 2026

Copy link
Copy Markdown
Member

close #169 related #155

  • Fix metric page 500 when no datasource is active: metric create/list now take an explicit validated datasourceId, and create checks the datasource exists
  • Pass the session datasource to getCaliberByHint instead of the unused active datasource; remove activeDatasourceId()
  • Add a datasource selector and an empty state to MetricManage.vue
  • Force-overwrite audit fields in AuditMetaObjectHandler so creator_id/updater_id/timestamps are always written
  • Migrate metric persistence to the layered PO/BO/VO/DTO model with MetricInfoMapper; remove the hand-written XML mapper
  • Update metric_info schema: add creator_id/updater_id, replace unique key with non-unique index

VLSMB added 4 commits October 1, 2026 00:30
… and layered model

- add creator_id/updater_id to metric_info; replace unique key uk_datasource_metric_key with non-unique idx_datasource_metric_key so a soft-deleted key can be recreated (soft-deleted rows are no longer restored, kept for audit)
- rewrite MetricInfoMapper as AuditableMapper<MetricInfoPo>; all single-table reads use LambdaQueryWrapper default methods (selectByKey/selectByDatasource/suggest) and delete the hand-written MetricInfoMapper.xml
- introduce model.po/bo/vo/dto and MetricConverter (toPoForInsert/toPoForUpdate); remove legacy entity.MetricInfo, dto.MetricRequest/MetricResponse and convertor.MetricConverter
- MetricService/Controller now work with BO/VO and BaseVo, list becomes IPage/BatchQueryVo pagination, dropping getByKey/listAll
- frontend metric API/view adapt to pagination and split create/update request types
- AGENTS.md: document Optional usage for internal nullable values; remove unused entity.UserSession
- Accept datasourceId from the client in create and page requests
- Add MetricQueryDto with required datasourceId validation
- Validate datasource existence on create
- Pass the session datasource to getCaliberByHint instead of the
  unused active-datasource lookup in GetMetricCaliberTool
- Remove activeDatasourceId() so the metric page no longer fails when
  no datasource is active
- Add a datasource selector to MetricManage.vue and render an empty
  state without calling the API when no datasource exists
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! We will review your request as soon as possible. Please review the code yourself using ponytail https://github.com/DietrichGebert/ponytail.

@VLSMB
VLSMB merged commit 06d0a2f into main Sep 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 在没有激活的数据源时点开指标口径页面报错

1 participant