using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using COMCMS.Common;
using COMCMS.Core;
using COMCMS.Core.Models;
using XCode;
using System.Web;
using COMCMS.Web.Filter;
using NewLife.Log;
using static COMCMS.Web.Models.APIModels;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Senparc.Weixin.WxOpen;
namespace COMCMS.Web.Controllers.api
{
public class ArticleController : APIBaseController
{
#region 获取文章列表
///
/// 获取文章列表
///
///
///
///
///
[HttpGet]
[CheckFilter]
public object GetArticleList(int kid, int pagesize = 10, int page = 1, string random = "", string timeStamp = "", string signature = "")
{
var where = Article._.IsHide != 1;
if (kid > 0)
where &= Article._.KId == kid;
if (page <= 0) page = 1;
//计算分页
int numPerPage, currentPage, startRowIndex;
numPerPage = pagesize;
currentPage = page;
startRowIndex = (currentPage - 1) * numPerPage;
IList list = Article.FindAll(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
long totalCount = Article.FindCount(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
List