public IActionResult AddOrder([FromBody] List <AddOrderRequest> request) { if (request.Count == 0) { throw new Exception("Sipariş bulunamadı."); } var response = serviceProcessor.Call(orderService.AddOrder, request, currentUser.Guid); return(Json(response)); }
public IActionResult GetRestaurantList([FromQuery] string search) { if (search == null) { search = ""; } var list = serviceProcessor.Call(restaurantService.GetRestaurantList, search, currentUser); return(Json(list)); }
public IActionResult Authenticate([FromBody] AuthenticationRequest request) { if (!ModelState.IsValid) { throw new Exception("Bad request"); } var serviceRepsonse = serviceProcessor.Call(userService.Authenticate, request.Username, request.Password); if (!serviceRepsonse.Succeeded) { return(Json(serviceRepsonse)); } serviceRepsonse.Content = mapper.Map <UserDto>(serviceRepsonse.Content); return(Json(serviceRepsonse)); }
public IActionResult GetMenuList([FromBody] GuidRequest request) { if (string.IsNullOrEmpty(request.Guid)) { throw new Exception("Restaurant Bulunamadı"); } var serviceResponse = serviceProcessor.Call(menuService.GetAllMenuByGuid, request); if (!serviceResponse.Succeeded) { throw new Exception("Restaurant Listesi bulunamadı"); } serviceResponse.Content = mapper.Map <List <MenuDto> >(serviceResponse.Content); return(Json(serviceResponse)); }
public IActionResult AddCarouselContent([FromBody] AddCarouselContentRequest request) { var response = serviceProcessor.Call(advertisementService.AddCarouselContent, request); return(Json(response)); }