public bool ProcessPendingRequests(int requestId) { var service = new RequestService(); var requestist = service.GetClaimRequest(requestId); try { EventHelper.ProcessPendingEvents(requestist); } catch (Exception) { return false; } try { WeatherHelper.ProcessLocation(requestist); } catch (Exception) { return false; } try { LocationHelper.ProcessPendingLocation(requestist); } catch (Exception) { return false; } return true; }
public IList<TweetModel> GetLocationTweet(int id) { string[] highlightList = new string[]{"Hello", "good", "trending"}; RequestService service = new RequestService(); var result = service.GetLocationTweet(id); foreach (var item in result) { foreach (var highlight in highlightList) { if (item.Text.Contains(highlight)) { item.IsHighlight = true; break; } } } if (id == 32 || id == 33) { return result.OrderBy(x=>x.Score).ToList(); } return result; }
public static void ProcessPendingLocation(IList<CliqueClaimRequestModel> requestList) { var service = new RequestService(); foreach (var item in requestList) { if (!service.IsLocationTweetExist(item)) { TweetHelper.ExtractLocationTweets(item); } } }
public void AddRequest(RequestModel model) { RequestService service = new RequestService(); var UserProfilerModel = service.AddRequest(model); var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureWebJobsStorage"].ToString()); CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); CloudQueue thumbnailRequestQueue = queueClient.GetQueueReference("addrequest"); thumbnailRequestQueue.CreateIfNotExists(); var queueMessage = new CloudQueueMessage(JsonConvert.SerializeObject(new NewRequest { RequestId = UserProfilerModel.Id })); thumbnailRequestQueue.AddMessage(queueMessage); }
public static void ExtractLocationTweets(CliqueClaimRequestModel model) { var modelList = ExtractTweetsByLocationName(model); var response = SemantriaHelper.AddScore(modelList); response.AddRange(SemantriaHelper.AddScore(ExtractTweetsByGeoCode(model))); var service = new RequestService(); service.AddTweetAndLocation(modelList); modelList = SemantriaHelper.AddScore(modelList); service.UpdateTweetScore(modelList); }
public static void ProcessQueueMessage([QueueTrigger("addrequest")] NewRequest twitterInfo) { RequestService service = new RequestService(); service.UpdateRequestStatus((int)RequestStatus.Queue, twitterInfo.RequestId); ProcessHelper helper = new ProcessHelper(); var response = helper.ProcessPendingRequests(twitterInfo.RequestId); if (response) service.UpdateRequestStatus((int)RequestStatus.Processed, twitterInfo.RequestId); else service.UpdateRequestStatus((int)RequestStatus.Error, twitterInfo.RequestId); }
public static bool ProcessLocation(IList<CliqueClaimRequestModel> requestList) { var service = new RequestService(); foreach (var item in requestList) { if (!service.IsLocationWeatherExist(item)) { IList<WeatherModel> result = ExtractLocationWeather(item); service.AddLocationWeather(result, item.Id); } } return true; }
public IList<HomeAwayPropertyModel> GetPropertyList() { RequestService service = new RequestService(); return service.GetProperty(); }
public HomeAwayPropertyModel GetProperty(int id) { RequestService service = new RequestService(); return service.GetProperty(id).FirstOrDefault(); }
public void AddProperty(HomeAwayPropertyModel model) { RequestService service = new RequestService(); service.AddProperty(model); }
public void AddFeedback(UserFeedbackModel model) { RequestService service = new RequestService(); service.AddUserFeedback(model); }
public IList<RequestModel> GetRequest() { RequestService service = new RequestService(); return service.GetRequest(RequestStatus.All); }
public int GetUser(string id) { RequestService service = new RequestService(); return service.GetUser(id); }
public IList<WeatherModel> GetLocationWeather(int id) { RequestService service = new RequestService(); return service.GetLocationWeather(id); }
public static void ProcessPendingEvents(IList<CliqueClaimRequestModel> requestList) { var service = new RequestService(); foreach (var item in requestList) { if (!service.IsEventExist(item)) { var eventList = ExtractEventsFromAPI(item.City); service.AddEvent(MapEventModel(eventList, item)); } } }
public int GetLocation(string id) { RequestService service = new RequestService(); return service.GetLocation(id); }
public IList<EventModel> GetEvent(int id) { RequestService service = new RequestService(); return service.GetEvent(id); }
public IList<CliqueClaimRequestModel> GetClaimRequest() { RequestService service = new RequestService(); return service.GetClaimRequest(); }
public IList<UserFeedbackModel> GetUserFeedback(int id) { RequestService service = new RequestService(); return service.GetUserFeedback(id); }
public IList<TweetModel> GetUserTweet(int id) { RequestService service = new RequestService(); return service.GetUserTweet(id); }