コード例 #1
0
 internal GetMessagesController(GetAllMessagesApi getAllMessagesApi,
                                GetAllMessagesForEndpointApi getAllMessagesForEndpointApi,
                                GetBodyByIdApi getBodyByIdApi,
                                SearchApi searchApi,
                                SearchEndpointApi searchEndpointApi)
 {
     this.getAllMessagesApi            = getAllMessagesApi;
     this.getAllMessagesForEndpointApi = getAllMessagesForEndpointApi;
     this.getBodyByIdApi    = getBodyByIdApi;
     this.searchEndpointApi = searchEndpointApi;
     this.searchApi         = searchApi;
 }
コード例 #2
0
        public GetMessagesByQuery()
        {
            Get["/messages/search", true] = (_, token) =>
            {
                string keyword = Request.Query.q;

                return(SearchApi.Execute(this, keyword));
            };

            Get["/messages/search/{keyword*}", true] = (parameters, token) =>
            {
                string keyword = parameters.keyword;
                keyword = keyword?.Replace("/", @"\");

                return(SearchApi.Execute(this, keyword));
            };

            Get["/endpoints/{name}/messages/search", true] = (parameters, token) =>
            {
                var input = new SearchEndpointApi.Input
                {
                    Endpoint = parameters.name,
                    Keyword  = Request.Query.q
                };

                return(SearchEndpointApi.Execute(this, input));
            };

            Get["/endpoints/{name}/messages/search/{keyword}", true] = (parameters, token) =>
            {
                var input = new SearchEndpointApi.Input
                {
                    Endpoint = parameters.name,
                    Keyword  = parameters.keyword
                };

                return(SearchEndpointApi.Execute(this, input));
            };
        }
コード例 #3
0
 internal GetMessagesByQueryController(SearchApi searchApi, SearchEndpointApi searchEndpointApi)
 {
     this.searchEndpointApi = searchEndpointApi;
     this.searchApi         = searchApi;
 }