Пример #1
0
 def save_user_profile(self, profile_dto: ProfileDto):
     try:
         save_profile_result = self.firestore.update_document(
             usersCol, self.uid, asdict(profile_dto))
         return save_profile_result
     except:
         NotFound('profile')
Пример #2
0
 def find_user_status(self):
     try:
         user_info = self.firestore.read_document(usersCol,
                                                  self.uid).to_dict()
         return user_info[userStatusFiled]
     except:
         raise NotFound('user status.')
Пример #3
0
 def find_fund_issue_list_order_datetime(self, fund_name):
     try:
         issue_list = self.firestore.query_sub_document_data(
             fundCol, fund_name, issueHistoryCol, datetimeFiled)
         return issue_list
     except:
         raise NotFound("issue list with datetimeFiled")
Пример #4
0
 def find_report_list_order_datetime(self, fund_name):
     try:
         report_list = self.firestore.query_sub_document_data(
             fundCol, fund_name, reportHistoryCol, datetimeFiled)
         return report_list
     except:
         raise NotFound("report list with datetimeFiled")
Пример #5
0
 def find_funding_history(self, fund_name):
     try:
         funding_list = self.firestore.read_sub_collection(
             fundCol, fund_name, fundingHistoryCol)
         return funding_list
     except:
         raise NotFound('fund list.')
Пример #6
0
 def find_user_fund_history(self, uid, fund_name):
     try:
         user_funding_history = self.firestore.read_ordered_documents(
             f'{usersCol}/{uid}/{fund_name}', limit=1)
         return user_funding_history
     except:
         raise NotFound('user funding hitsory.')
Пример #7
0
 def find_otp(self):
     try:
         otp = self.firestore.read_document(otpCol,
                                            self.uid).to_dict()['otp']
     except:
         raise NotFound('OTP')
     return otp
Пример #8
0
 def find_fund_issue_history(self, fund_name):
     try:
         issue_list = self.firestore.read_sub_collection(
             fundCol, fund_name, issueHistoryCol)
         return issue_list
     except:
         raise NotFound('issue list.')
Пример #9
0
 def find_fund_data(self, fund_name):
     try:
         fund_data = self.firestore.read_document(fundCol,
                                                  fund_name).to_dict()
         print(fund_data)
         return fund_data
     except:
         raise NotFound('fund data')
Пример #10
0
 def find_network_commission(self, asset, network):
     try:
         network_doc        = self.firestore.read_document(policiesCol, withdrawalDoc)
         network_data       = network_doc.to_dict()
         network_commission = network_data[asset][network][withdrawalFeeFiled]
         return network_commission
     except:
         raise NotFound('withdrawal fee')
Пример #11
0
 def update_user_info(self, params):
     try:
         self.firestore.update_document(usersCol, self.uid, params)
         return 'success'
     except:
         raise NotFound('nick name')
Пример #12
0
 def find_user_profile_url(self, email):
     try:
         profile_url = self.firestore.get_auth_user(email).photo_url
         return profile_url
     except:
         NotFound('profile url')
Пример #13
0
 def find_user_display_name(self, email):
     try:
         display_name = self.firestore.get_auth_user(email).display_name
         return display_name
     except:
         NotFound('Nick name')
Пример #14
0
 def update_notice(self, uid, notice_params):
     try:
         firestore.update_document(noticeCol, uid, notice_params)
         return 'success'
     except:
         raise NotFound('notice')
Пример #15
0
 def find_otp_info(self):
     try:
         otp_info = self.firestore.read_document(otpCol, self.uid).to_dict()
         return otp_info['otp'], otp_info['count']
     except:
         raise NotFound('OTP')
Пример #16
0
 def save_otp(self, email_params):
     try:
         self.firestore.create_document(otpCol, self.uid, email_params)
     except:
         raise NotFound('otp')
     return