Exemplo n.º 1
0
        public async Task <HttpResponseMessage> GetKeywords()
        {
            HttpResponseMessage response = null;

            try
            {
                List <KeywordResult> keywordList = await ResearchRepo.getKeywords();

                response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_001", "Success", keywordList));
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, new JHResponseMessage("JH_101", "Application Error", exception.Message));
            }
            return(response);
        }
Exemplo n.º 2
0
        public async Task <HttpResponseMessage> GetSentimentScoreChartDetails(DateTime From, DateTime To)
        {
            HttpResponseMessage response = null;

            try
            {
                if (From != null && To != null)
                {
                    var research = ResearchRepo.getSentimentScoreChartDetails(From, To);
                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_001", "Success", research));
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_104", "Invalid research Id", "Invalid research Id"));
                }
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, new JHResponseMessage("JH_101", "Application Error", exception.Message));
            }
            return(response);
        }
Exemplo n.º 3
0
        public async Task <HttpResponseMessage> GetAnalystPerformanceById(string isin, string name)
        {
            HttpResponseMessage response = null;

            try
            {
                if (isin != null && name != null)
                {
                    var research = ResearchRepo.getAnalystPerformanceById(isin, name);
                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_001", "Success", research));
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_104", "Invalid research Id", "Invalid research Id"));
                }
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, new JHResponseMessage("JH_101", "Application Error", exception.Message));
            }
            return(response);
        }
Exemplo n.º 4
0
        public async Task <HttpResponseMessage> GetActivityById(string id)
        {
            HttpResponseMessage response = null;

            try
            {
                if (id != null)
                {
                    Research research = await ResearchRepo.getResearchDocument(id);

                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_001", "Success", research));
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_104", "Invalid research Id", "Invalid research Id"));
                }
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, new JHResponseMessage("JH_101", "Application Error", exception.Message));
            }
            return(response);
        }
Exemplo n.º 5
0
        public async Task <HttpResponseMessage> GetCustomerPerformance()
        {
            HttpResponseMessage response = null;

            try
            {
                response = Request.CreateResponse(HttpStatusCode.OK, new JHResponseMessage("JH_001", "Success", ResearchRepo.getCustomerPerformance()));
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, new JHResponseMessage("JH_101", "Application Error", exception.Message));
            }
            return(response);
        }