# Processor Refactoring for Unified Kafka Topic

## Context
The system receives all messages (Status, Fault, Control, ACK) from a single Kafka topic. The message key is unreliable (random). Therefore, the backend must rely on `cmd_word` and `direction` within the message payload to determine the processing logic and storage structure.

## Changes
1.  **Refactored `src/processor/index.js`**:
    *   Removed `udpParser.js` dependency (parsing is now upstream responsibility).
    *   Implemented `resolveActionType` to categorize messages into:
        *   `"36上报"` (Status/Fault)
        *   `"0F下发"` (Control)
        *   `"0FACK"` (ACK)
    *   Implemented `buildRowsFromPayload` with specific logic for each action type:
        *   **36上报**: Iterates over `device_list` and `fault_list` (provided by upstream JSON) to create multiple DB rows. Maps `dev_type`, `dev_addr`, `dev_loop`, `dev_data`, `error_type`, `error_data`.
        *   **0F下发**: Iterates over `control_list`. Maps `dev_type`, `dev_addr`, `loop`->`dev_loop`, `type_l`, `type_h`.
        *   **0FACK**: Creates a single DB row (fallback).
    *   Ensured `details` column stores the full lists (`device_list`, `fault_list`, `control_list`) for traceability.
    *   Ensured `extra` column stores the `raw_hex` (udp_raw).

## Impact
*   Backend is now fully compliant with the "Upstream Parsing" requirement.
*   Correctly handles one-to-many storage for Status, Fault, and Control messages.
*   No longer relies on Kafka Keys for dispatching.
