def deal_sign_out(account_id, current_date, sign_time, manual_flag=False): content = get_status_by_user(account_id, current_date) process = None if content is not None: status = content[0] process = content[1] if status == "out_done": return invalid_message() if process is None or process != "sign_in_done": return invalid_message() return deal_sign_out_message(sign_time, manual_flag)
def manual_sign_out_content(account_id, current_date): yield asyncio.sleep(1) content = get_status_by_user(account_id, current_date) if content is None or content[1] is None or content[1] != "sign_in_done": return [invalid_message()] set_status_by_user_date(account_id, current_date, "wait_out") return manual_sign_out_message()
def manual_sign_in_content(account_id, current_date): yield asyncio.sleep(1) content = get_status_by_user(account_id, current_date) if content is not None and content[1] is not None: return [invalid_message()] insert_replace_status_by_user_date(account_id, current_date, "wait_in") return manual_sign_in_message()
def manual_sign_out_content(account_id, current_date): """ Update user status and generate manual check-out message. :param account_id: user account id :param current_date: current date by local time. :return: message content list """ yield asyncio.sleep(1) content = get_status_by_user(account_id, current_date) if content is None or content[1] is None or content[1] != "sign_in_done": return [invalid_message()] set_status_by_user_date(account_id, current_date, "wait_out") return manual_sign_out_message()
def manual_sign_in_content(account_id, current_date): """ Update user status and generate manual check-in message. :param account_id: user account id :param current_date: current date by local time. :return: message content list """ yield asyncio.sleep(1) content = get_status_by_user(account_id, current_date) if content is not None and content[1] is not None: return [invalid_message()] insert_replace_status_by_user_date(account_id, current_date, "wait_in") return manual_sign_in_message()