File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
backend/balanceteshaters/routers Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ from datetime import datetime
2+
3+ from pydantic import BaseModel
4+
5+
6+ class Author (BaseModel ):
7+ name : str
8+ accountHref : str
9+
10+
11+ class Comment (BaseModel ):
12+ textContent : str
13+ publishedAt : datetime
14+ scrapedAt : datetime
15+ screenshotData : str
16+ nbLikes : int
17+ replies : list ["Comment" ]
18+
19+
20+ class Post (BaseModel ):
21+ url : str
22+ publishedAt : datetime
23+ scrapedAt : datetime
24+ textContent : str
25+ postId : str
26+ socialNetwork : str
27+ author : Author
28+ comments : list [Comment ]
Original file line number Diff line number Diff line change 1+ from balanceteshaters .routers .ml_model import Post
12from fastapi import APIRouter
23
34router = APIRouter ()
45
56
67@router .post ("/post" )
7- def ml_post (publication : str ):
8+ def ml_post (publication : Post ):
89 results = []
910 print (results )
1011 return {"result" : results }
You can’t perform that action at this time.
0 commit comments