def validate_parameter(self, st, et, t, cids, n, s):
     """
     check param ok or not
     :param d: date string like 20180101
     :param t: time string int(time.time()), len is 10
     :param n:nonce not empty
     :param s:sign string not empty
     :return:
     """
     if not n or not s:
         return False
     if not SUtils.is_time_str(t):
         return False
     if st:
         if not SUtils.is_date_str(st):
             return False
     if et:
         if not SUtils.is_date_str(et):
             return False
     if cids:
         try:
             tl = eval(cids)
             if not isinstance(tl, list):
                 return False
         except Exception as e:
             return False
     return True
 def validate_parameter(self, st, et, t, cids, n, s):
     """
     :param st: start date
     :param et: end date
     :param t:  time len is 10
     :param cids: [123,12] list string
     :param n: nonce
     :param s: signed string
     :return: True or False
     """
     if not n or not s:
         return False
     if not SUtils.is_time_str(t):
         return False
     if st:
         if not SUtils.is_date_str(st):
             return False
     if et:
         if not SUtils.is_date_str(et):
             return False
     if cids:
         try:
             tl = eval(cids)
             if not isinstance(tl, list):
                 return False
         except Exception as e:
             return False
     return True
 def validate_parameter(self, d, t, n, s):
     '''
     :return: check input paramter ok or not
     d:date ,string
     t: time ,used to calculate signed string
     m: nonce not ''
     s; sign string not ''
     '''
     if not s or not n:
         return False
     if SUtils.is_date_str(d) and SUtils.is_time_str(t):
         return True
     else:
         return False
예제 #4
0
 def validate_parameter(self, d, t, n, s):
     """
     check param ok or not
     :param d: date string like 20180101
     :param t: time string int(time.time()), len is 10
     :param n:nonce not empty
     :param s:sign string not empty
     :return:
     """
     if not n or not s:
         return False
     if SUtils.is_time_str(t) and SUtils.is_date_str(d):
         return True
     else:
         return False