Skip to content

FileDownloadRecordEntity Schema

FileDownloadRecordEntity is a database schema used in the plt-basic project to manage the lifecycle of asynchronous report generation and downloads^[001-todo.md]. It tracks the status of file requests from creation through to data retrieval and final storage^[001-todo.md].

Schema Fields

The entity records metadata associated with each download task^[001-todo.md]:

  • id: Unique identifier for the record^[001-todo.md].
  • 报表来源 (Report Source): Origin of the report^[001-todo.md].
  • 报表枚举 (Report Enumeration): Enumerated type defining the specific report format or category^[001-todo.md].
  • 数据检索条件key值 (Data Retrieval Condition Key Value): A key (often an MD5 hash of the query conditions) used to reproduce or identify the specific data query^[001-todo.md].
  • 文件地址 (File Address): The URL or path to the generated file, typically stored in GCP Cloud Storage^[001-todo.md].
  • 部门Id (Department ID): Identifier for the department associated with the request^[001-todo.md].
  • 管理员id (Administrator ID): Identifier for the user or admin requesting the download^[001-todo.md].
  • status: Current state of the download process^[001-todo.md].
  • 创建时间 (Creation Time): Timestamp when the record was created^[001-todo.md].
  • 完成時間 (Completion Time): Timestamp when the file generation process finished^[001-todo.md].

Operational Context

In the report generation workflow, the status field of the FileDownloadRecordEntity is updated to reflect the outcome of asynchronous processing^[001-todo.md]. For instance, if a message processing task fails repeatedly (e.g., exceeding the default requeue limit of 6 times), the system updates the entity's status to indicate failure^[001-todo.md]. The entity's id is frequently passed as a payload in message queues (e.g., msg(FileDownloadRecordEntity id : 1111)) to coordinate data retrieval and Redis caching tasks^[001-todo.md].

  • [[Asynchronous API]]
  • [[GCP Cloud Storage]]
  • [[Redis Hash]]

Sources

  • 001-todo.md