Пример #1
0
        /// <summary>
        /// 获取作品内容
        /// </summary>
        ///  <param name="uid"></param>
        /// <param name="article_id"></param>
        /// <returns></returns>
        public ApiResult GetArticleInfo(int uid, int article_id)
        {
            ApiPageResult apiResult   = new ApiPageResult();
            var           checkResult = Util.CheckParameters(
                new Parameter {
                Value = uid.ToString(), Msg = "uid 不能为空值"
            },
                new Parameter {
                Value = uid.ToString(), Msg = "uid 必须是数字类型", 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.GetArticleInfo(uid, article_id));
        }