Download OneApi/api/user_info.py from dragxd/oneapi: direct link, hf CLI and curl.
- Browser
- Download file 558 Bytes
-
https://huggingface.co/spaces/dragxd/oneapi/resolve/main/OneApi/api/user_info.py
- Command line
-
hf download hf://spaces/dragxd/oneapi/OneApi/api/user_info.py
-
curl -L -o user_info.py https://huggingface.co/spaces/dragxd/oneapi/resolve/main/OneApi/api/user_info.py
558 Bytes
| from ..database import * | |
| from quart import * | |
| from .. import * | |
| user = user() | |
| user_info_bp = Blueprint('user_info', __name__) | |
| async def user_info(): | |
| data = await request.get_json() | |
| if not data or not 'user_id' in data: return jsonify({'error': 'missing user_id'}), 400 | |
| user_id = int(data.get('user_id')) | |
| d = await user.user_info(user_id) | |
| if d == 'not exists': return jsonify({'message': "user not found"}), 404 | |
| elif 'error' in d: return jsonify({'error': d}), 400 | |
| return jsonify({'message': d}), 200 | |