Skip to content

Commit e208d23

Browse files
committed
Remove implementation and create student tasks
1 parent 7ce2b5e commit e208d23

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

src/backend/main.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,30 @@ def shorten_url(request: UrlRequest, http_request: Request):
4242
# 1. Generate short code for long url
4343
# 2. Store the mapping of short code to long url
4444
# 3. Optional: store click_stats using the class ClickStatsData for the short_code with initial values
45-
short_code = ""
46-
return {short_code}
45+
46+
# short_code = ""
47+
# return {short_code}
48+
49+
raise HTTPException(
50+
status_code=501,
51+
detail="This feature is not yet implemented"
52+
)
53+
4754

4855
@app.get("/get-long-url/{short_code}")
4956
def get_long_url(short_code: str):
5057
# TODO: implement this function
5158
# 1. Fetch the long URL from the url_store using the short_code
5259
# 2. Return HTTP 404 (not found) if the short_code is not found
5360
# 3. (Optional) Update the click statistics in click_stats for the short_code
54-
long_url = ""
55-
return {long_url}
61+
62+
# long_url = ""
63+
# return {long_url}
64+
65+
raise HTTPException(
66+
status_code=501,
67+
detail="This feature is not yet implemented"
68+
)
5669

5770
@app.get("/get-qr-code/{url}")
5871
def get_qr_code(url: str):
@@ -61,8 +74,14 @@ def get_qr_code(url: str):
6174
# 2. Return the QR code image as a base64-encoded string
6275
# Hint: You can use the qrcode library to generate QR codes.
6376
# Take a look at the documentation here: https://pypi.org/project/qrcode/
64-
encoded_string = ""
77+
78+
# encoded_string = ""
6579
# return {"image_base64": f"data:image/png;base64,{encoded_string}"}
80+
81+
raise HTTPException(
82+
status_code=501,
83+
detail="This feature is not yet implemented"
84+
)
6685

6786
# Click Statistics Endpoints
6887
@app.get("/stats", response_model=List[ClickStats])

0 commit comments

Comments
 (0)