Beispiel #1
0
        public QueryResultList <ArticleShowData> GetDailyNews([FromBody] string queryString)
        {
            var result = new QueryResultList <ArticleShowData>();


            var request = JsonHelper.Build <QueryRequest <ArticleQueryData> >(queryString);

            if (request.Body == null)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            if (request.PageInfo == null)
            {
                result.Message = "分页参数为NULL";
                return(result);
            }


            var verify = ValidaQueryString.ValidaDevice(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new ArticleBP().GetDailyNews(request);
            return(result);
        }
Beispiel #2
0
        public OperationResult <SearchResultData> Search([FromBody] string queryString)
        {
            var result = new OperationResult <SearchResultData>();


            var request = JsonHelper.Build <QueryRequest <string> >(queryString);

            if (request.Body == null)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            if (request.PageInfo == null)
            {
                result.Message = "分页参数为NULL";
                return(result);
            }


            var verify = ValidaQueryString.ValidaDevice(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new ArticleBP().GetSearchResult(request);
            return(result);
        }
Beispiel #3
0
        public OperationResult <ArticleData> GetDetail([FromBody] string queryString)
        {
            var result = new OperationResult <ArticleData>();

            var request = JsonHelper.Build <RequestOperation <int> >(queryString);

            if (request == null)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            var verify = ValidaQueryString.Valida(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new ArticleBP().GetDetail(request);
            return(result);
        }