/** * Copyright © 2020-present LiuDanYang. All rights Reserved. */ import { mGet, mPost } from "./request" const app = getApp() const urls = ['https://api-client-ztb-dev.qniao.cn', 'https://api-client-ztb-test.qniao.cn', 'https://api-client-ztb.qniao.cn'] const mconfig = { baseUrl: urls[app.evn] } // *******************************************************************账户业务*********************************************************** // /article/save/Article 发文章 const postMoment = (params) => mPost(`/information-center/article/save/Article`, params, mconfig) // /article/update/Article/{id} 编辑文章 const updateMoment = (id, params) => mPost(`/information-center/article/update/Article/${id}`, params, mconfig) // /article/get/Article-list/文章列表 const getPreferList = (params) => mGet(`/information-center/article/get/Article-list/`, params, mconfig) // /article/get/Article-view-list 浏览文章历史列表 const getViewedList = (params) => mGet(`/information-center/article/get/Article-view-list`, params, mconfig) // /article/delete/Article删除文章 const deleteMoment = (params) => mPost(`/information-center/article/delete/Article`, params, mconfig) // /article/get/my-Article-list 我的文章列表 const getMyList = (params) => mGet(`/information-center/article/get/my-Article-list`, params, mconfig) // /article/get/Article-detail/{id} 文章详情 const getMomentDetail = (id) => mGet(`/information-center/article/get/Article-detail/${id}`, null, mconfig) // /article-reply/get/my-reply-list 我的评论列表 const getReplyList = (params) => mGet(`/information-center/article-reply/get/my-reply-list`, params, mconfig) // /article-reply/get/reply-list/in/{articleId} 帖子评论列表 const getCommentList = (id, params) => mGet(`/information-center/article-reply/get/reply-list/in/${id}`, params, mconfig) // /article-reply/like-or-cancel/article 点赞文章 const likeMoment = (params) => mPost(`/information-center/article-reply/like-or-cancel/article`, params, mconfig) // /article-reply/like-or-cancel/reply 点赞评论 const likeComment = (params) => mPost(`/information-center/article-reply/like-or-cancel/reply`, params, mconfig) // /article-reply/reply 评论 const commentMoment = (params) => mPost(`/information-center/article-reply/reply`, params, mconfig) const getCategoryPrice = (params) => mGet(`/information-center/getPaperCategoryPrice/new`, params, mconfig) const getCategoryList = (params) => mGet(`/information-center/paper-index-category`, params, mconfig) const getCategoryType = (params) => mGet(`/ztb-market-information-service/get/scrap-paper-main-category`, params, mconfig) const getMomentList = (params) => mGet(`/ztb-market-information-service/get/price-compare-info/by-scrap-paper-main-category`, params, mconfig) export { mconfig, getPreferList, postMoment, updateMoment, getViewedList, deleteMoment, getMyList, getMomentDetail, getReplyList, getCommentList, likeMoment, likeComment, commentMoment, getCategoryPrice, getCategoryList, getCategoryType, getMomentList }