def login(): user_id = request.json.get("user_id", "") password = request.json.get("password", "") terminal = request.json.get("terminal", "") u = user.User() code, message, token = u.login(user_id=user_id, password=password, terminal=terminal) return jsonify({"message": message, "token": token}), code
def change_password(): user_id = request.json.get("user_id", "") old_password = request.json.get("oldPassword", "") new_password = request.json.get("newPassword", "") u = user.User() code, message = u.change_password(user_id=user_id, old_password=old_password, new_password=new_password) return jsonify({"message": message}), code
def unregister(): user_id = request.json.get("user_id", "") password = request.json.get("password", "") u = user.User() code, message = u.unregister(user_id=user_id, password=password) return jsonify({"message": message}), code
def logout(): user_id: str = request.json.get("user_id") token: str = request.headers.get("token") u = user.User() code, message = u.logout(user_id=user_id, token=token) return jsonify({"message": message}), code