MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / PresignUploadSession

Class PresignUploadSession

apps/base/models.py:68–84  ·  view source on GitHub ↗

预签名上传会话模型

Source from the content-addressed store, hash-verified

66
67
68class PresignUploadSession(models.Model):
69 """预签名上传会话模型"""
70
71 id = fields.IntField(pk=True)
72 upload_id = fields.CharField(max_length=36, unique=True, index=True)
73 file_name = fields.CharField(max_length=255)
74 file_size = fields.BigIntField()
75 save_path = fields.CharField(max_length=512)
76 mode = fields.CharField(max_length=10) # "direct" 或 "proxy"
77 expire_value = fields.IntField(default=1)
78 expire_style = fields.CharField(max_length=20, default="day")
79 created_at = fields.DatetimeField(auto_now_add=True)
80 expires_at = fields.DatetimeField() # 会话过期时间
81
82 async def is_expired(self):
83 """检查会话是否已过期"""
84 return self.expires_at < await get_now()
85
86
87file_codes_pydantic = pydantic_model_creator(FileCodes, name="FileCodes")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected