api added

This commit is contained in:
2025-03-19 16:49:10 +02:00
parent fe165305fc
commit 8f7639640d
7 changed files with 66 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
from app import db
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt()
class Content(db.Model):
id = db.Column(db.Integer, primary_key=True)
@@ -7,4 +10,14 @@ class Content(db.Model):
player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=True)
group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True)
class Player(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
hostname = db.Column(db.String(120), unique=True, nullable=False)
password = db.Column(db.String(120), nullable=False)
quickconnect_password = db.Column(db.String(120), nullable=False)
def verify_quickconnect_code(self, code):
return bcrypt.check_password_hash(self.quickconnect_password, code)
# other models...