Create /upload_token endpoint

This commit is contained in:
IgorVolochay
2026-01-03 17:37:37 +03:00
parent 325a9d9ff1
commit ecd3d79f2b
5 changed files with 57 additions and 18 deletions
+3 -1
View File
@@ -17,15 +17,17 @@ class RedisWorker:
)
self.files_ttl = int(os.getenv('FILES_TTL'))
def create_record(self, user_ip: str, file_name: str, file_uuid: str, file_type: str, add_date):
def create_record(self, user_ip: str, file_name: str, file_uuid: str, file_type: str, add_date:str, file_size:int):
self.client.hset(file_uuid, mapping={
"file_name": file_name,
"file_size": file_size,
"user_ip": user_ip,
"file_type": file_type,
"add_date": add_date
})
self.client.expire(file_uuid, self.files_ttl)
def get_record(self, file_uuid:str):
return self.client.hgetall(file_uuid)