ref: 重构网元状态,提升加载网元列表带状态速度

Refactor network element state management

- Removed the NE state endpoint and related service logic from the network_data module.
- Introduced a new NEStateController to handle network element state records.
- Implemented NEState service and repository for managing state records in the database.
- Updated NEInfo and NeLicense controllers to utilize the new NEState service for fetching and saving state information.
- Enhanced state handling in the websocket processor to reflect the latest state of network elements.
- Added caching logic for network element states using Redis.
- Improved error handling and response formatting for state queries.
This commit is contained in:
TsMask
2025-10-27 15:15:27 +08:00
parent 667d0fdad8
commit e7ae390f6e
18 changed files with 428 additions and 343 deletions

View File

@@ -6,16 +6,20 @@ CREATE TABLE "ne_state" (
"id" integer NOT NULL,
"ne_type" text(16),
"ne_id" text(32),
"version" text(16),
"capability" integer,
"ne_version" text(16),
"standby" integer,
"nb_number" integer,
"ue_number" integer,
"serial_num" text(16),
"expiry_date" text(10),
"hostname" text(32),
"os" text(196),
"sys_cpu_usage" integer,
"sys_mem_usage" integer,
"sys_disk_usage" integer,
"nf_cpu_usage" integer,
"nf_mem_used" integer,
"create_time" integer,
"refresh_time" integer,
PRIMARY KEY ("id")
);
@@ -26,7 +30,7 @@ CREATE INDEX "idx_type_id_time"
ON "ne_state" (
"ne_type" ASC,
"ne_id" ASC,
"create_time" ASC
"refresh_time" ASC
);
-- ----------------------------