forked from sgd122/busan_food
-
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
Showing
5 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
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
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
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 django.urls import path | ||
# from ..view import common_views as views | ||
from . import views | ||
|
||
app_name = "foods" | ||
|
||
urlpatterns = [ | ||
path("list/", views.foods_list), | ||
] | ||
|
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 |
---|---|---|
@@ -1,3 +1,25 @@ | ||
from django.shortcuts import render | ||
from rest_framework.decorators import api_view | ||
from rest_framework.response import Response | ||
from django.http import HttpResponse,Http404, HttpResponseNotFound | ||
|
||
# Create your views here. | ||
@api_view(['GET', 'POST']) | ||
def foods_list(request): | ||
''' | ||
음식점 리스트를 조회한다. | ||
''' | ||
foods_list = [ | ||
{ 'id': 1, 'title': '강가네손만두', 'content': '칼국수/만두' }, | ||
{ 'id': 2, 'title': '마봉자김밥', 'content': '분식(라면/김밥/오므라이스...)' }, | ||
{ 'id': 3, 'title': '맥도날드', 'content': '햄버거' }, | ||
{ 'id': 4, 'title': '갈비탕', 'content': '갈비탕' }, | ||
{ 'id': 5, 'title': '유가네닭갈비', 'content': '볶음밥' }, | ||
{ 'id': 6, 'title': '하늘한우', 'content': '점심특선(고기/된장찌개)' }, | ||
{ 'id': 7, 'title': '맘스터치', 'content': '햄버거' }, | ||
{ 'id': 8, 'title': '천운숯불갈비', 'content': '점심특선(고기/된장찌개)' }, | ||
{ 'id': 9, 'title': '철호국밥', 'content': '국밥' }, | ||
{ 'id': 10, 'title': '더도이종가집', 'content': '국밥' }, | ||
{ 'id': 11, 'title': '오쇼김밥', 'content': '분식(라면/김밥/오므라이스...)' }, | ||
] | ||
return Response(foods_list) |
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