pull/1/head
zacharyhampton 2023-07-06 18:44:38 -05:00
commit af0d1b634b
8 changed files with 80 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.idea

5
api/__init__.py Normal file
View File

@ -0,0 +1,5 @@
from fastapi import APIRouter
from .v1 import router as v1_router
router = APIRouter(prefix="/api", tags=["api"])
router.include_router(v1_router)

0
api/core/__init__.py Normal file
View File

55
api/core/jobs/__init__.py Normal file
View File

@ -0,0 +1,55 @@
from pydantic import BaseModel
from datetime import datetime
from enum import Enum
class JobType(Enum):
FULL_TIME = 'full_time'
PART_TIME = 'part_time'
CONTRACT = 'contract'
INTERNSHIP = 'internship'
class CompensationInterval(Enum):
ANNUAL = 'annual'
MONTHLY = 'monthly'
WEEKLY = 'weekly'
DAILY = 'daily'
HOURLY = 'hourly'
class Location(BaseModel):
country: str
city: str
state: str
postal_code: str = None
address: str = None
class Compensation(BaseModel):
interval: CompensationInterval
min_amount: int
max_amount: int
currency: str
class DeliveryEnum(Enum):
EMAIL = 'email'
URL = 'url'
class Delivery(BaseModel):
method: DeliveryEnum
value: str
class JobPost(BaseModel):
title: str
description: str
company_name: str
industry: str
location: Location
job_type: JobType
compensation: Compensation
date_posted: datetime
delivery: Delivery = None

View File

5
api/v1/__init__.py Normal file
View File

@ -0,0 +1,5 @@
from fastapi import APIRouter
from .jobs import router as jobs_router
router = APIRouter(prefix="/v1")
router.include_router(jobs_router)

3
api/v1/jobs/__init__.py Normal file
View File

@ -0,0 +1,3 @@
from fastapi import APIRouter
router = APIRouter(prefix="/jobs")

11
main.py Normal file
View File

@ -0,0 +1,11 @@
from fastapi import FastAPI
from api import router as api_router
app = FastAPI()
app.include_router(api_router)
@app.get("/")
async def root():
return {"message": "Hello World"}