Пример #1
0
        /// <summary>
        /// 获取作品内容并获取上一篇,下一篇的id
        /// </summary>
        /// <param name="state">2初赛,3半决赛,4决赛</param>
        /// <param name="article_id"></param>
        /// <returns></returns>
        public ApiResult GetArticleInfoByAdmin(int state, int article_id)
        {
            ApiPageResult apiResult   = new ApiPageResult();
            var           checkResult = Util.CheckParameters(
                new Parameter {
                Value = state.ToString(), Msg = "state 不能为空值"
            },
                new Parameter {
                Value = state.ToString(), Msg = "state 必须是数字类型", Regex = @"^[1-9]\d*$"
            },
                new Parameter {
                Value = article_id.ToString(), Msg = "article_id 不能为空值"
            },
                new Parameter {
                Value = article_id.ToString(), Msg = "article_id 必须是数字类型", Regex = @"^[1-9]\d*$"
            }
                );

            if (!checkResult.OK)
            {
                apiResult.success = false;
                apiResult.status  = ApiStatusCode.InvalidParam;
                apiResult.message = checkResult.Msg;
                return(apiResult);
            }
            ArticleBLL bll = new ArticleBLL();

            return(bll.GetArticleInfoByAdmin(state, article_id));
        }