Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f33e165bd | |||
| 83a939506c | |||
| befb9d2334 | |||
| 78266f1c9d | |||
| 9ff57141d1 | |||
| a7bb4ef2b5 | |||
| 5dbf931e58 | |||
| c042a4c8e1 | |||
| 27cc9728e0 |
@@ -0,0 +1,14 @@
|
|||||||
|
from flask import Flask, jsonify
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/api/health')
|
||||||
|
def health():
|
||||||
|
return jsonify({'status': 'ok', 'module': 'api'})
|
||||||
|
|
||||||
|
@app.route('/api/version')
|
||||||
|
def version():
|
||||||
|
return jsonify({'version': '1.0.0'})
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(host='0.0.0.0', port=5000)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
flask>=3.0
|
||||||
|
gunicorn>=21.2
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
from flask import jsonify
|
||||||
|
|
||||||
|
def register_routes(app):
|
||||||
|
@app.route('/api/users')
|
||||||
|
def list_users():
|
||||||
|
return jsonify({'users': []})
|
||||||
|
|
||||||
|
@app.route('/api/users/<int:user_id>')
|
||||||
|
def get_user(user_id):
|
||||||
|
return jsonify({'id': user_id, 'name': 'Alice'})
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# Agent Collaboration Test
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import sqlite3
|
||||||
|
import os
|
||||||
|
|
||||||
|
DB_PATH = 'app.db'
|
||||||
|
|
||||||
|
def migrate():
|
||||||
|
conn = sqlite3.connect(DB_PATH)
|
||||||
|
cursor = conn.cursor()
|
||||||
|
|
||||||
|
with open('schema.sql', 'r') as f:
|
||||||
|
cursor.executescript(f.read())
|
||||||
|
|
||||||
|
with open('seed.sql', 'r') as f:
|
||||||
|
cursor.executescript(f.read())
|
||||||
|
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
print(f"Database migrated: {DB_PATH}")
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
migrate()
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
email TEXT UNIQUE,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS sessions (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
user_id INTEGER REFERENCES users(id),
|
||||||
|
token TEXT NOT NULL,
|
||||||
|
expires_at TIMESTAMP NOT NULL
|
||||||
|
);
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
|
||||||
|
INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com');
|
||||||
|
INSERT INTO users (name, email) VALUES ('Charlie', 'charlie@example.com');
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# Agent Collaboration Test
|
||||||
Reference in New Issue
Block a user