-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d4b745a
Showing
12 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from fastapi import FastAPI | ||
|
||
from src.domain.user.user_entity import User, UserDTO | ||
|
||
app = FastAPI() | ||
|
||
|
||
@app.post("/") | ||
async def users(user_props: UserDTO): | ||
user = User(user_props) | ||
return {"user": user} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
anyio==3.6.1 | ||
asgiref==3.5.2 | ||
click==8.1.3 | ||
fastapi==0.78.0 | ||
h11==0.13.0 | ||
idna==3.3 | ||
pydantic==1.9.1 | ||
sniffio==1.2.0 | ||
starlette==0.19.1 | ||
typing_extensions==4.2.0 | ||
uvicorn==0.17.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
https://www.newline.co/courses/create-a-serverless-slackbot-with-aws-lambda-and-python/installing-python-3-and-pyenv-on-macos-windows-and-linux#pyenv-on-ubuntu-linux-1804 | ||
|
||
curl https://pyenv.run | bash | ||
|
||
sudo apt update | ||
|
||
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | ||
|
||
pyenv install 3.9.13 | ||
|
||
pyenv versions | ||
|
||
python --version | ||
|
||
pip --version | ||
|
||
pyenv virtualenv 3.9.13 insurance-api | ||
|
||
pyenv activate insurance-api | ||
|
||
touch requirements.txt | ||
|
||
pip install -r requirements.txt | ||
|
||
vi requirements.txt | ||
|
||
fastapi==0.78.0 | ||
|
||
pip install -r requirements.txt | ||
|
||
pip freeze | ||
|
||
vi requirements.txt | ||
|
||
colocar as depedencias da dependecia no requirements | ||
|
||
pip install -r requirements.txt | ||
|
||
|
||
|
Empty file.
Binary file not shown.
Empty file.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from pydantic import BaseModel | ||
|
||
class UserDTO (BaseModel): | ||
age: int | ||
|
||
class User (): | ||
age: int | ||
|
||
def __init__(self, user_props: UserDTO): | ||
self.age = user_props.age |