278 Commits
Author SHA1 Message Date
pnoker 2d255c18be feat: add yuce docs 2026-06-12 11:26:23 +08:00
pnoker 1811d4f8ff fix: support reactive wildcard permissions 2026-06-12 11:26:23 +08:00
pnoker f75003b030 docs(design): add Gateway MCP server design proposal
- Add mcp-server.md: full design for exposing OpenAPI interfaces as MCP
  tools through the gateway, covering architecture, database model,
  permission control (reusing dc3_resource/dc3_role_resource_bind),
  HTTP vs gRPC analysis, dynamic tool refresh, and observability
- Register MCP Service in VitePress sidebar config
- Add entry to design index page
2026-06-12 02:07:43 +08:00
pnoker b674385904 docs: update documentation and README
Refresh architecture, development, operations, and quickstart docs.
Update multi-language README files.
2026-06-11 00:31:34 +08:00
Vickey 69e5fbe0ac docs: restructure documentation and archive engineering notes
Separate the public docs (how to understand, deploy, and use IoT DC3) from
engineering material (design drafts, analyses, roadmaps, legacy operation
screenshots):

- add an internal archive area with its own nav, grouping design,
  analysis, strategy, backlog, and legacy-operation sections
- migrate design, operation (data/device/driver/template), analyses, and
  todo notes into the archive, preserving history
- refresh public docs: README (en/zh/ja/vi), operation guides
  (agentic/concepts/data-commands/device-onboarding), architecture,
  development, guide, quickstart, and modules
- promote the project overview to README.ai.md at the repo root
2026-06-09 18:15:04 +08:00
Vickey 8a2a87f96c docs(openapi): add API documentation guide, export tooling, and conventions
- Add docs/development/api-documentation.md describing the Swagger UI layout,
  per-center grouping, auth headers, and production exposure.
- Add a `make openapi` target + dc3/bin/export_openapi.sh to snapshot each
  center's OpenAPI JSON from a running stack.
- Update AGENTS.md: OpenAPI/Swagger conventions, and correct the enum-suffix
  examples (multi-valued sets use *TypeEnum, not *FlagEnum).
2026-06-09 15:52:46 +08:00
pnoker 55605d66a9 docs: update project documentation and guidance files 2026-06-05 22:41:02 +08:00
Vickey 27bcf1383b fix: address code review — security, thread safety, performance, and null safety
Security (CRITICAL):
- KeyUtil: read JWT signing key from DC3_SECURITY_KEY env/property
- UserPasswordServiceImpl: read default password from DC3_SECURITY_DEFAULT_PASSWORD env
- KeyLoader: read OPC-UA keystore password from OPCUA_KEYSTORE_PASSWORD env
- WebFilterConfig: return 401 on malformed X-Auth-User header
- AlgorithmConstant: document deprecated hardcoded constants

Thread safety (HIGH):
- Fix TOCTOU races in 4 driver connectors (computeIfAbsent)
- Fix PlcS7 lock leak, OpcUa connect timeout (5s)
- CoapClientManager: synchronize setURI to prevent URI race
- PointValueJob, MqttScheduleJob: add @DisallowConcurrentExecution
- SystemHealthServiceImpl: preserve interrupt flag
- WindowSampleBuffer: local AtomicInteger → int

Performance (MEDIUM):
- EntityStateExpiryScanner: batch alarm saves (saveBatch)
- ImportDeviceServiceImpl: batch config saves
- ResourceRegistrySyncServiceImpl: batch-load nodes, eliminate N+1 COUNTs
- DriverSenderServiceImpl: debug-gate hot-path logging
- PointServiceImpl: stream().count() → size()

Null safety (LOW):
- RegexUtil: null guards on isName/isPhone/isMail/isPassword/isHost
- HostUtil: null-check getNetworkInterfaces() return
- TimeUtil: log parse failures instead of silent null

Infrastructure:
- Add spring-boot-starter-cache + @EnableCaching CacheConfig
- Replace embedded modbus4j/plc-s7 jars with external Maven dependencies
- Add dc3-driver-modbus-rtu module
2026-05-26 08:40:25 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
Vickey d5b6ea6f79 feat: format & style 2026-05-25 21:53:50 +08:00
Vickey dedb03fe74 feat: add command/event attribute configuration system
Introduce CommandAttribute/EventAttribute with config variants:
- REST controllers, MyBatis mappers, services, and DAL managers
- gRPC client/server builders and proto message definitions
- DTOs, BOs, DOs, VOs for type-safe data transfer layer

fix: add explicit ::text casts in json_build_object parameters

PostgreSQL cannot infer parameter types inside json_build_object()
calls. Add ::text casts to #{stateExtType} and #{stateDescription}
to resolve "could not determine data type of parameter $10" errors.

refactor: restructure driver gRPC client and metadata layer

- Rename GrpcStubConfig to DriverClientStubConfig with dedicated DTOs
- Extract attribute builders from inline gRPC conversion logic
- Consolidate driver metadata, register service, and command handling
- Update device state heartbeat and command result event handling

docs: add multilingual architecture diagram and sync READMEs

- Translate architecture SVG into zh, ja, vi variants
- Update README architecture image references per language
- Add missing service-level shortcut sections to ja/vi READMEs
2026-05-25 00:00:00 +08:00
Vickey fd3af64634 feat: add layered architecture diagram and reposition project narrative
- Add IoT DC3 layered architecture diagram (SVG + HTML viewer)
  with Application / Management / Data / Driver layers,
  Security & Load and Platform & System sidebars,
  Data→Driver connection flows, and color-coded sections
- Reposition README descriptions across all languages (en, zh, ja, vi)
  and pom.xml to AI-ready narrative: "Connects devices, collects
  data organized for AI, and orchestrates the closed loop"
- Add README.ai.md with Chinese multi-paragraph AI narrative
  and closed-loop flowchart
- Optimize package.json metadata (name, license, scripts)
2026-05-24 13:35:57 +08:00
Vickey b5ab016cab chore: format MyBatis XML headers, SQL indentation and docs tables 2026-05-24 01:35:12 +08:00
pnoker f0d0c7913c feat: add event alarm trigger, E2E contract tests, and docs
Add EVENT target type to AlarmTargetTypeFlagEnum, wire event report
into the alarm rule pipeline, add RabbitMQ contract E2E tests for
command call and event report, and create design documentation.
2026-05-23 19:16:01 +08:00
Vickey e8b2eb908b docs: mark Phase 1 device-profile single-ownership tasks as done 2026-05-23 17:16:16 +08:00
Vickey 84a33daef4 docs: mark Phase 1 (Device↔Profile 1:1) as done 2026-05-23 15:12:52 +08:00
Vickey cf2ffb0194 docs: update thing-model design with Phase 1 implementation plan 2026-05-23 08:20:48 +08:00
Vickey c6b70c1665 docs: update point-command.md status to reflect P0-P3 implementation
Correct stale [TODO] markers in §0, §1.3, §3, §4.1, §4.5, §4.7
to [DONE] matching the actual code delivered.
2026-05-22 23:49:10 +08:00
Vickey c556c6a0b8 feat: complete point command P0-P2 rebuild — DTO, lock, validation, API
P0: Replace content JSON-string with sealed PointCommandPayload + record DTOs.
P0: Accept write() boolean return, suppress echo on failure.
P1: Return commandId from POST endpoints, add RESTful GET /{commandId}.
P1: Add driver-online check via EntityStateMapper, PointCommandValidator.
P2: Add DeviceLockManager for per-device serialized command execution.
P3: Add POST /list API with pagination, commandId idempotency support.
2026-05-22 23:36:38 +08:00
Vickey 47760888bd feat: unify DeviceStatusEnum and DriverStatusEnum into EntityStatusEnum
- Replace two duplicate enums with single EntityStatusEnum (same index/code)
- Rename DB columns: state_flag→entity_state_flag, state_ext→entity_state_ext
- Add stateDescription field to DeviceStateDTO/DriverStateDTO for diagnostics
- Add description field to DeviceHealthState/DriverHealthState
- UPSERT SQL now writes stateDescription into entity_state_ext on heartbeat
- Remove EntityStateStatus interface (no longer needed with single enum)
- Update MQ layer, heartbeat services, status queries, gRPC, and all tests
2026-05-22 22:35:02 +08:00
pnoker 436b3b01bb feat: refine device and driver health state handling 2026-05-22 18:29:24 +08:00
pnoker 0471bd904e feat: add device health timeout state handling 2026-05-22 16:44:58 +08:00
pnoker 2e75061c70 style: clean up RabbitConstant, fix imports and update docs formatting 2026-05-22 09:16:27 +08:00
pnoker 9007cbc22c style: apply consistent code formatting across all modules and docs 2026-05-22 00:24:22 +08:00
Vickey 04d0d5342f feat(data): add persistent state lease table for driver/device status
Replace local Caffeine cache as the source of truth for driver and
device online status with dc3_entity_state, a persistent state lease
table backed by PostgreSQL.

- Add EntityStateDO/Mapper/Manager persistence stack.
- Add EntityStateExpiryScanner that scans expire_time every 15 seconds
  with lease_version recheck to avoid stale alarm writes.
- Dual-write heartbeat path: DriverStateServiceImpl and
  DeviceStateServiceImpl now write dc3_entity_state first, then local
  cache.
- All status queries (controllers, gRPC server, local facade,
  SystemHealthServiceImpl) read from dc3_entity_state. Rows missing or
  past expire_time return offline.
- OfflineExpiryListener gains a DB dedup check to skip expiry events
  already handled by the scanner.
- Add @EnableScheduling to DataApplication.
- Add design doc docs/design/entity-state.md with full DDL.

This resolves restart state loss, multi-instance inconsistency, and
races between expiry checks and fresh heartbeats.
2026-05-21 23:57:45 +08:00
Vickey a0b392c3aa feat: rule alarm optimization 2026-05-21 21:39:13 +08:00
pnoker cc75f8ad00 docs(todo): update javadoc-cleanup plan with completion status 2026-05-21 01:06:57 +08:00
pnoker c69b453af6 refactor: rename notify record to history 2026-05-20 21:20:52 +08:00
pnoker 4367f03603 refactor: remove Redis dependency, update docs and workspace config 2026-05-20 20:46:00 +08:00
Vickey 14faabedc7 style: apply consistent formatting across GitHub workflows, docs and common modules 2026-05-19 00:15:07 +08:00
Vickey 48f5d2f0e9 docs(site): import legacy operation manual from dc3-docs
The dc3-docs VuePress 1.x source repository has the original
Markdown for the operation manual. Migrate four pages whose
content survives unchanged in the current product flow:
driver / template / device / data, plus a hand-written
operation/index.md as the section landing page. Add the
corresponding Web UI screenshots under docs/public/images/legacy/
(the full assets/images tree from the old site, ~169 files).

- Replace the Ant Design Vue <a-alert> component in data.md with
  a VitePress ::: tip container.
- Rewrite /assets/images/ to /images/legacy/ so paths resolve
  under VitePress's public/ static-asset convention with the
  /iot-dc3/ base.
- Add a "操作手册" entry to the top nav and a per-section sidebar
  in .vitepress/config.mts.

Skipped from dc3-docs:
- operation/0-index.md - "待开发中" placeholder.
- function/{api,driver}.md - "🚧施工中🚧" placeholders.
- function/0-directory.md - obsolete (refers to dc3-common as a
  separate repo and lists mongo/redis/mysql common modules that
  no longer exist).
- function/storage.md - lists mongodb/influxdb/opentsdb as
  supported storage; the project ships PostgreSQL only.

Verification: pnpm docs:build passes (5.26s). The five operation
pages render; image src attributes resolve to
/iot-dc3/images/legacy/operation/<page>/<uuid>.png and the files
exist in dist/.
2026-05-18 20:50:56 +08:00
Vickey 9e9c1dc2e8 docs(site): switch documentation framework from MkDocs Material to VitePress
The MkDocs Material site felt visually dated. Switch to VitePress to
get a fresher default theme (the same one Vue, Vite, Pinia and
Element Plus use) and align the docs toolchain with the project's
Node ecosystem.

- Replace mkdocs.yml/requirements-docs.txt with package.json
  (pnpm scripts), pinned vitepress 1.5+, and pnpm-lock.yaml.
- Add docs/.vitepress/config.mts: zh-CN, /iot-dc3/ base, cleanUrls,
  per-section sidebars, local search with Chinese UI strings, edit
  link, light/dark theme labels in Chinese.
- Rewrite docs/index.md as layout: home with hero, six feature
  cards, and platform/architecture/license blocks underneath.
- docs/assets/ -> docs/public/ rename (VitePress static-asset
  convention). This rename was already absorbed by an unrelated
  upstream commit; only the architecture page reference is updated
  to /images/architecture-cn.png.
- Convert MkDocs snippets to VitePress <!--@include:-->:
  - community/{contributing,code-of-conduct,security} pull repo-root
    governance files,
  - development/changelog and guide/usage pull the docker-ci-
    referenced dc3/doc/{CHANGE,USAGE}.md.
- Wrap R<T> in inline code in architecture/modules.md so the Vue
  parser does not treat it as an unclosed HTML tag.
- Rewrite .github/workflows/docs.yml: pnpm/action-setup@v4 +
  setup-node@v4 (pnpm cache) + pnpm install --frozen-lockfile +
  pnpm docs:build + upload-pages-artifact (docs/.vitepress/dist)
  + deploy-pages. Trigger paths include docs/, package.json,
  pnpm-lock.yaml, governance files, and the two dc3/doc/ files
  referenced via include.
- Update .gitignore: drop /site/ and the Python-only venv entries,
  add docs/.vitepress/{cache,dist}/ and a Node/pnpm section.
- Adjust dc3/doc/README.md wording to mention VitePress include
  syntax instead of MkDocs snippets.

Verification: pnpm install + pnpm docs:build pass locally (5.44s);
the include-based pages (community/contributing, development/
changelog, guide/usage) render content from their source files; all
per-section sidebars resolve.
2026-05-18 19:53:58 +08:00
Vickey 476799e513 refactor(api): rename gRPC SelectBy* RPCs to GetBy*/ListBy*
Apply the new naming convention to .proto contracts so the verb on
each RPC reflects the cardinality of its result:

  - get*  for single-record returns (RPCs returning a single DTO)
  - list* for multi-record returns (RPCs returning a Page or List DTO)

23 RPCs renamed across 9 .proto files. Returns-single -> Get*:
  user.proto                 SelectById        -> GetById
  user_login.proto           SelectByName      -> GetByName
  tenant.proto               SelectByCode      -> GetByCode
  driver_device.proto        SelectById        -> GetById
  driver_point.proto         SelectById        -> GetById
  manager_point.proto        SelectById        -> GetById
  manager_device.proto       SelectByDeviceId  -> GetByDeviceId
  manager_driver.proto       SelectByDriverId  -> GetByDriverId
  manager_driver.proto       SelectByDeviceId  -> GetByDeviceId
  manager_profile.proto      SelectByProfileId -> GetByProfileId

Returns-multi -> List*:
  driver_device.proto        SelectByPage         -> ListByPage
  driver_point.proto         SelectByPage         -> ListByPage
  manager_device.proto       SelectByPage         -> ListByPage
  manager_device.proto       SelectByDriverId     -> ListByDriverId
  manager_device.proto       SelectByProfileId    -> ListByProfileId
  manager_device.proto       SelectByDeviceIds    -> ListByDeviceIds
  manager_driver.proto       SelectByPage         -> ListByPage
  manager_driver.proto       SelectByDriverIds    -> ListByDriverIds
  manager_point.proto        SelectByPage         -> ListByPage
  manager_point.proto        SelectByIds          -> ListByIds
  manager_profile.proto      SelectByPage         -> ListByPage
  manager_profile.proto      SelectByProfileIds   -> ListByProfileIds
  manager_profile.proto      SelectByDeviceId     -> ListByDeviceId

This is a wire-level breaking change: gRPC clients and servers must
upgrade in lockstep. Server impls, facade clients, and Java callers
are aligned in subsequent commits.
2026-05-18 19:19:40 +08:00
pnoker bca6d7aedc docs(site): scaffold MkDocs Material documentation site with GitHub Pages CI
Set up an end-to-end documentation site so contributors and users have
a unified, searchable, and publishable entry point for project docs.

- Add mkdocs.yml: Chinese-first language, light/dark palette, tabbed
  navigation, indexed sections, glightbox for diagrams, and
  pymdownx.snippets so community pages can pull from root governance
  files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md) without
  duplicating content.
- Add requirements-docs.txt pinning mkdocs-material and
  mkdocs-glightbox.
- Build the docs/ skeleton: index, quickstart, guide, architecture,
  development, modules, community. Migrate the seven generic manuals
  from dc3/doc/ (QUICKSTART, ENVIRONMENT, LOGGING, TROUBLESHOOTING,
  MODULES, DRIVER-AUTHORING, TESTING) and rewire their cross-doc
  links. CHANGE.md, TITLE.md, and USAGE.md stay in dc3/doc/ because
  docker-ci.yml depends on them; the docs site references them via
  mkdocs snippets to keep a single source of truth.
- Add .github/workflows/docs.yml that builds with --strict on push to
  release and deploys via actions/deploy-pages.
- Rewrite dc3/doc/README.md as a migration pointer to the new site
  and to the three retained release-flow files.

Verification: mkdocs build --strict passes locally; snippets render
correctly; GitHub Pages already enabled in workflow mode via gh api.
2026-05-18 18:36:00 +08:00
pnoker 2770eeebca docs: consolidate project documentation under dc3 2026-05-09 18:49:52 +08:00
pnoker 8c10fd6f24 docs: add driver-authoring guide
Captures the steps for adding a new dc3-driver-* module — module
layout, the dc3-common-driver base classes to extend, gRPC registration
with Manager, RabbitMQ routing-key conventions tied to the driver
service name, and the application.yml conventions the rest of the
platform expects.
2026-05-09 13:00:35 +08:00
pnoker e47299a327 chore: remove format and format-check targets from Makefile 2026-05-07 23:55:32 +08:00
pnoker 36d7a82de5 docs: add module overview, quickstart, and troubleshooting guides
- docs/MODULES.md: full module dependency map and runtime flow
- docs/QUICKSTART.md: one-stop local development setup
- docs/TROUBLESHOOTING.md: common build/runtime issues and fixes
- Add docs links to README.md, README.zh.md, README.ja.md, README.vi.md
2026-05-07 13:11:04 +08:00
pnoker 81a35a0213 refactor(manager): migrate driver service and auth service impls to DO layer 2023-04-14 02:45:14 +08:00
pnoker 5cc5e210bd feat: Optimize delete service function 2023-04-14 02:11:41 +08:00
pnoker 6985af7aaa chore(docs): update CNAME domain 2023-04-14 01:34:00 +08:00
pnoker fa65aeba18 feat: add CNAME:doc.dc3.site 2023-04-14 01:32:40 +08:00
pnoker 09c268760e feat: add CNAME:doc.dc3.site 2023-04-14 01:15:03 +08:00
pnoker 1f2860927a feat: add CNAME:doc.dc3.site 2023-04-14 01:00:21 +08:00
pnoker a69bf2e007 feat: add CNAME:doc.dc3.site 2023-04-14 01:00:08 +08:00
pnoker 39cef91aa6 feat: add CNAME:doc.dc3.site 2023-04-14 00:42:27 +08:00
pnoker 0b4972b709 feat: new docs 2023-04-14 00:38:49 +08:00
pnoker c2a15d73e9 chore: reorganize api files into idea/ subdirectory and remove obsolete bin scripts 2023-03-09 02:03:31 +08:00
pnoker 9c063dd263 docs: add architecture diagrams and logo image to docs/images 2023-03-06 17:19:06 +08:00
pnoker 587606842a docs: remove legacy docsify documentation files and images 2023-03-06 17:14:31 +08:00