article-api-map.js 1.19 KB
module.exports = {
  // 社区首页获取文章列表
  '/api/grass/article/list': {
    ufo: false,
    auth: true,
    api: 'app.grass.xyRecArticleList', // app.grass.columnArticleList
    params: {
      page: {type: Number},
      limit: {type: Number}
    }
  },

  // 刷新时获取有多少条新内容
  '/api/grass/article/list/unread': {
    ufo: false,
    auth: true,
    api: 'app.grass.getTotalInboxUnread',
    params: {}
  },

  // 文章详情
  '/api/grass/columnArticleDetail': {
    api: 'app.grass.columnArticleDetail',
    auth: true,
    params: {
      uid: {type: Number},
      articleId: {type: Number, require: true},
      singleDetail: {type: String, require: true}, // default value: Y
      fromXianyu: {type: String, require: true}, // default value: Y
    }
  },

  // 推荐文章
  '/api/grass/xianyuOtherArticles': {
    api: 'app.grass.xianyuOtherArticles',
    params: {
      articleId: {type: Number, require: true}
    }
  },

  // 点赞
  '/api/grass/updateArticlePraise': {
    api: 'app.grass.updateArticlePraise',
    auth: true,
    params: {
      articleId: {type: Number, require: true},
      status: {type: Number, require: true}, // 0 未点赞 1点赞
    }
  },
};