
    i                         d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ  e       Zej                  d      d        Zej                  d ee      g      defd	       Zy
)    )	APIRouterRequestDependsJSONResponse)verify_turnstile)response_errorresponse_successstore_uploaded_file_contentz/uploadc                  $   K   t        dd      S w)NOK   )contentstatus_coder        D/var/www/pod-logistic/pod-api/controller/upload_public_controller.pyupload_optionsr      s     #66s   )dependenciesrequestc                   K   | j                          d {   }t        |j                  dd            j                         }|dk7  rt	        d      S |j                  d      }|st	        d      S g }|D ]Q  }|j                  s|j                          d {   }t        |j                  |dd	      }|j                  |       S t        |      S 7 7 =w)
Ntype imgu   Chỉ hỗ trợ upload ảnh.filesu   Không tìm thấy file ảnh.
upload_imgT)sub_diris_img)formstrgetlowerr	   getlistfilenamereadr   appendr
   )r   	form_datareq_typer   savedfile_objr   
saved_infos           r   upload_user_imager,      s     lln$I9==,-335H5>??g&E>??E !   '0 	

 	Z ! E""1 % (s"   CCBCC<CCN)fastapir   r   r   fastapi.responsesr   utils.turnstile_helperr   utils.upload_helperr	   r
   r   routeroptionsr   postr,   r   r   r   <module>r4      sq    / / * 3  
	7 7 Yg.>&?%@A#W # B#r   