Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        public static void ProcessPendingLocation(IList<CliqueClaimRequestModel> requestList)
        {
            var service = new RequestService();
            foreach (var item in requestList)
            {
                if (!service.IsLocationTweetExist(item))
                {
                    TweetHelper.ExtractLocationTweets(item);

                }
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
 public IList<HomeAwayPropertyModel> GetPropertyList()
 {
     RequestService service = new RequestService();
     return service.GetProperty();
 }
Exemplo n.º 9
0
 public HomeAwayPropertyModel GetProperty(int id)
 {
     RequestService service = new RequestService();
     return service.GetProperty(id).FirstOrDefault();
 }
Exemplo n.º 10
0
 public void AddProperty(HomeAwayPropertyModel model)
 {
     RequestService service = new RequestService();
     service.AddProperty(model);
 }
Exemplo n.º 11
0
 public void AddFeedback(UserFeedbackModel model)
 {
     RequestService service = new RequestService();
     service.AddUserFeedback(model);
 }
Exemplo n.º 12
0
 public IList<RequestModel> GetRequest()
 {
     RequestService service = new RequestService();
     return service.GetRequest(RequestStatus.All);
 }
Exemplo n.º 13
0
 public int GetUser(string id)
 {
     RequestService service = new RequestService();
     return service.GetUser(id);
 }
Exemplo n.º 14
0
 public IList<WeatherModel> GetLocationWeather(int id)
 {
     RequestService service = new RequestService();
      return service.GetLocationWeather(id);
 }
Exemplo n.º 15
0
        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));
                }

            }
        }
Exemplo n.º 16
0
 public int GetLocation(string id)
 {
     RequestService service = new RequestService();
     return service.GetLocation(id);
 }
Exemplo n.º 17
0
 public IList<EventModel> GetEvent(int id)
 {
     RequestService service = new RequestService();
     return service.GetEvent(id);
 }
Exemplo n.º 18
0
 public IList<CliqueClaimRequestModel> GetClaimRequest()
 {
     RequestService service = new RequestService();
     return service.GetClaimRequest();
 }
Exemplo n.º 19
0
 public IList<UserFeedbackModel> GetUserFeedback(int id)
 {
     RequestService service = new RequestService();
     return service.GetUserFeedback(id);
 }
Exemplo n.º 20
0
 public IList<TweetModel> GetUserTweet(int id)
 {
     RequestService service = new RequestService();
     return service.GetUserTweet(id);
 }