Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get /resume/experience/{#} #26

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 51 additions & 41 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,80 +1,90 @@
'''
"""
Flask Application
Pradyuman7 marked this conversation as resolved.
Show resolved Hide resolved
'''
"""

from flask import Flask, jsonify, request
from models import Experience, Education, Skill

from models import Education, Experience, Skill

app = Flask(__name__)

data = {
"experience": [
Experience("Software Developer",
"A Cool Company",
"October 2022",
"Present",
"Writing Python Code",
"example-logo.png")
Experience(
"Software Developer",
"A Cool Company",
"October 2022",
"Present",
"Writing Python Code",
"example-logo.png",
)
],
"education": [
Education("Computer Science",
"University of Tech",
"September 2019",
"July 2022",
"80%",
"example-logo.png")
Education(
"Computer Science",
"University of Tech",
"September 2019",
"July 2022",
"80%",
"example-logo.png",
)
],
"skill": [
Skill("Python",
"1-2 Years",
"example-logo.png")
]
"skill": [Skill("Python", "1-2 Years", "example-logo.png")],
}


@app.route('/test')
@app.route("/test")
def hello_world():
'''
"""
Returns a JSON test message
'''
"""
return jsonify({"message": "Hello, World!"})


@app.route('/resume/experience', methods=['GET', 'POST'])
def experience():
'''
@app.route("/resume/experience", methods=["GET", "POST"])
@app.route("/resume/experience/<int:index>", methods=["GET"])
def experience(index=None):
"""
Handle experience requests
'''
if request.method == 'GET':
return jsonify()
GET: Returns all experiences or a specific experience by index
POST: Creates a new experience
"""
if request.method == "GET":
if index is not None:
try:
return jsonify(data["experience"][index])
except IndexError:
return jsonify({"error": "Experience not found"}), 404

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})
return jsonify()


@app.route('/resume/education', methods=['GET', 'POST'])
@app.route("/resume/education", methods=["GET", "POST"])
def education():
'''
"""
Handles education requests
'''
if request.method == 'GET':
"""
if request.method == "GET":
return jsonify({})

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})


@app.route('/resume/skill', methods=['GET', 'POST'])
@app.route("/resume/skill", methods=["GET", "POST"])
def skill():
'''
"""
Handles Skill requests
'''
if request.method == 'GET':
"""
if request.method == "GET":
return jsonify({})

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})
Loading