Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ubialimv committed Jun 22, 2022
0 parents commit d4b745a
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 0 deletions.
Binary file added __pycache__/main.cpython-39.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions main.py
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}
11 changes: 11 additions & 0 deletions requirements.txt
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
40 changes: 40 additions & 0 deletions setup.md
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 added src/__init__.py
Empty file.
Binary file added src/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Empty file added src/domain/__init__.py
Empty file.
Binary file added src/domain/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Empty file added src/domain/user/__init__.py
Empty file.
Binary file added src/domain/user/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions src/domain/user/user_entity.py
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

0 comments on commit d4b745a

Please sign in to comment.