Coverage for bc/kwai-bc-club/src/kwai_bc_club/domain/file_upload.py: 100%
13 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module that defines a file upload entity."""
3from dataclasses import dataclass, field
4from typing import ClassVar, Type
6from kwai_core.domain.entity import DataclassEntity
7from kwai_core.domain.value_objects.identifier import IntIdentifier
8from kwai_core.domain.value_objects.owner import Owner
9from kwai_core.domain.value_objects.unique_id import UniqueId
12class FileUploadIdentifier(IntIdentifier):
13 """Identifier for a file upload."""
16@dataclass(kw_only=True, eq=False, slots=True, frozen=True)
17class FileUploadEntity(DataclassEntity):
18 """An FileUploadEntity keeps information about a file upload.
20 Attributes:
21 uuid: The unique id of the upload.
22 filename: The name of the file.
23 owner: The user who uploaded the file.
24 remark: A remark about the upload.
25 preview: Whether the upload is a preview.
26 """
28 ID: ClassVar[Type] = FileUploadIdentifier
30 uuid: UniqueId = field(default_factory=UniqueId.generate)
31 filename: str
32 owner: Owner
33 remark: str = ""
34 preview: bool = False