[twitter] Add model and webapi stub for twitter
This commit is contained in:
parent
fbf3a911bd
commit
e84ac9d6bb
0
kibicara/platforms/twitter/__init__.py
Normal file
0
kibicara/platforms/twitter/__init__.py
Normal file
18
kibicara/platforms/twitter/model.py
Normal file
18
kibicara/platforms/twitter/model.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
|
||||
#
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
from kibicara.model import Hood, Mapping
|
||||
from ormantic import Integer, ForeignKey, Model, Text
|
||||
|
||||
|
||||
class Twitter(Model):
|
||||
id: Integer(primary_key=True) = None
|
||||
hood: ForeignKey(Hood)
|
||||
dms_since_id: Integer()
|
||||
mentions_since_id: Integer()
|
||||
access_token: Text()
|
||||
access_token_secret: Text()
|
||||
|
||||
class Mapping(Mapping):
|
||||
table_name = 'twitterbots'
|
10
kibicara/platforms/twitter/webapi.py
Normal file
10
kibicara/platforms/twitter/webapi.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
|
||||
#
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
from fastapi import APIRouter
|
||||
from kibicara.platforms.twitter.bot import spawner
|
||||
from kibicara.platforms.twitter.model import Twitter
|
||||
|
||||
|
||||
router = APIRouter()
|
Loading…
Reference in a new issue