def get(self): parser = reqparse.RequestParser() parser.add_argument('ContentId', type=int, required=True, help='투어 아이디') args = parser.parse_args(strict=True) body = get_detail_image(args['ContentId']) return body, 201
def get(self): parser = reqparse.RequestParser() parser.add_argument("restaurant", type=str, help="식당") args = parser.parse_args(strict=True) restaurant = args["restaurant"] if not hasattr(Restaurants, restaurant): return None, 400 if not restaurant in cache or _is_corrupted(cache["time"]): _refresh(restaurant) return cache[restaurant]
def post(self): parser = reqparse.RequestParser() parser.add_argument('desc', type=str, required=True, help='브루어리 이름') parser.add_argument('available_day', type=str, required=False, help='투어가 가능한 날') parser.add_argument('price', type=int, required=False, help='브루어리 투어 가격') parser.add_argument('region', type=str, required=False, help='브루어리 지역') parser.add_argument('url_apply', type=str, required=False, help='브루어리 신청') parser.add_argument('url_logo', type=str, required=False, help='브루어리 로고') parser.add_argument('url_img', type=str, required=False, help='') parser.add_argument('home_page', type=str, required=False, help='브루어리 사이트') parser.add_argument('location_mapX', type=float, required=False, help='브루어리 좌표 - longitude') parser.add_argument('location_mapY', type=float, required=False, help='브루어리 좌표 - latitude') parser.add_argument('available', type=bool, required=False, help='투어 가능 여부') parser.add_argument('name', type=str, required=False, help='투어 이름') args = parser.parse_args(strict=True) location = [args['location_mapX'], args['location_mapY']] args.pop('location_mapX') args.pop('location_mapY') args['location'] = location logger.debug(str(args)) b = Brewery(**args) db.collection('brewery').document().set(b.to_dict()) return 201
def post(self): parser = reqparse.RequestParser() parser.add_argument('answer', type=str, help='answer') parser.add_argument('question', type=str, help='question') args = parser.parse_args(strict=True) question = args.question answer = args.answer ret = add_qna(question=question, answer=answer) if ret: return 201 else: return 401
def post(self): parser = reqparse.RequestParser() parser.add_argument("answer", type=str, help="answer") parser.add_argument("question", type=str, help="question") args = parser.parse_args(strict=True) question = args.question answer = args.answer ret = add_qa(question=question, answer=answer) if ret: return 201 else: return 401
def get(self): parser = reqparse.RequestParser() parser.add_argument('ContentId', type=int, required=True, help='투어 아이디') parser.add_argument('ContentTypeId', required=True, help='[관광, 문화시설, 행사, 숙박, 쇼핑, 맛집]') args = parser.parse_args(strict=True) ContentTypeId = args['ContentTypeId'] print(ContentTypeId) body = get_detail_info(args['ContentId'], args['ContentTypeId']) return body, 201
def get(self): parser = reqparse.RequestParser() parser.add_argument('weekend', type=str, required=False) parser.add_argument('season', type=str, required=False) parser.add_argument('hours', type=int, required=False) parser.add_argument('minutes', type=int, required=False) parser.add_argument('seconds', type=int, required=False) parser.add_argument('now', type=fields.boolean, required=False, default=True) args = parser.parse_args(strict=True) if args['now']: return shuttle_bus.response() else: return shuttle_bus.custom_response(args['weekend'], args['season'], args['hours'], args['minutes'], args['seconds'])
def get(self): parser = reqparse.RequestParser() parser.add_argument('BreweryName', type=str, required=True, help='브루어리 이름') args = parser.parse_args(strict=True) # BreweryName으로 브루어리 검색 brewery = db.collection('brewery').where('name', '==', args['BreweryName']).stream() try: brewery = Brewery.from_dict(next(iter(brewery)).to_dict()) except StopIteration: return f'Developing | NameNotFound' body = {} body['brewery'] = brewery.to_dict() return body, 201
def get(self): parser = reqparse.RequestParser() parser.add_argument("weekend", type=str, required=False) parser.add_argument("season", type=str, required=False) parser.add_argument("hours", type=int, required=False) parser.add_argument("minutes", type=int, required=False) parser.add_argument("seconds", type=int, required=False) parser.add_argument("now", type=fields.boolean, required=False, default=True) args = parser.parse_args(strict=True) if args["now"]: return shuttle_bus.get_current() return shuttle_bus.get( args["season"], args["weekend"], hours=args["hours"], minutes=args["minutes"], seconds=args["seconds"], )
def get(self): parser = reqparse.RequestParser() parser.add_argument('region', type=str, required=True, help='브루어리 지역') args = parser.parse_args(strict=True) ret = get_main_page(args['region']) return ret