|
@@ -0,0 +1,180 @@
|
|
|
+import { requestByGet, requestByPost } from "@dage/service";
|
|
|
+
|
|
|
+// 推荐列表
|
|
|
+export const getRecommendListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/rank/getList", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-阅读排行
|
|
|
+export const getReadListApi = () => {
|
|
|
+ return requestByGet("/api/show/book/getVisit");
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-总数
|
|
|
+export const getBookCountApi = () => {
|
|
|
+ return requestByGet("/api/show/book/count");
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-详情 需要登录
|
|
|
+export const getBookDetail2Api = (bookId) => {
|
|
|
+ return requestByGet(`/api/wx/book/detail/${bookId}`, undefined, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+// 图书-详情
|
|
|
+export const getBookDetailApi = (id) => {
|
|
|
+ return requestByGet(`/api/show/book/detail/${id}`, undefined, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 图书列表-分页
|
|
|
+export const getBookListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/book/pageList", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 字典列表
|
|
|
+export const getDictListApi = () => {
|
|
|
+ return requestByGet("/api/show/dict/getList");
|
|
|
+};
|
|
|
+
|
|
|
+// 公告列表-分页
|
|
|
+export const getNoticeListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/notice/pageList", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 公告-保存访问量
|
|
|
+export const addNoticeVisitApi = (noticeId) => {
|
|
|
+ return requestByGet(`/api/show/notice/addVisit/${noticeId}`);
|
|
|
+};
|
|
|
+
|
|
|
+// 书籍分类
|
|
|
+export const getStorageTreeApi = () => {
|
|
|
+ return requestByGet("/api/show/storage/getTree", undefined, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 藏品分类
|
|
|
+export const getExhibitTypeListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/exhibitType/getList", params, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 微信-登录
|
|
|
+export const wxLoginApi = (code) => {
|
|
|
+ return requestByGet(`/api/show/wx/mpLogin`, {
|
|
|
+ code,
|
|
|
+ });
|
|
|
+};
|
|
|
+export const fakeLoginApi = (id) => {
|
|
|
+ return requestByGet(`/api/show/test/login/${id}`, undefined, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ loadingText: "登录中",
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-文件-上传
|
|
|
+export const uploadApi = (params) => {
|
|
|
+ return requestByPost("/api/wx/book/upload", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-我的书架
|
|
|
+export const getMyBookListApi = () => {
|
|
|
+ return requestByGet("/api/wx/book/getCollect");
|
|
|
+};
|
|
|
+
|
|
|
+// 编辑用户信息
|
|
|
+export const updateUserInfoApi = (params) => {
|
|
|
+ return requestByPost("/api/wx/updateWxUser", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 用户信息
|
|
|
+export const getUserInfoApi = () => {
|
|
|
+ return requestByGet("/api/wx/userInfo", undefined, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ loadingText: "登录中",
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-我的收藏总数
|
|
|
+export const getUserCollectedBookCountApi = () => {
|
|
|
+ return requestByGet("/api/wx/book/count");
|
|
|
+};
|
|
|
+
|
|
|
+// 保存收藏图书&保存浏览节点
|
|
|
+export const updateBookCollectApi = (bootId, query) => {
|
|
|
+ return requestByGet(`/api/wx/book/collect/${bootId}`, query);
|
|
|
+};
|
|
|
+
|
|
|
+// 退出登录
|
|
|
+export const logoutApi = () => {
|
|
|
+ return requestByGet("/api/wx/logout");
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-上传记录
|
|
|
+export const getUploadBookListApi = () => {
|
|
|
+ return requestByGet("/api/wx/book/auditList");
|
|
|
+};
|
|
|
+
|
|
|
+// 编辑用户信息
|
|
|
+export const saveBookApi = (params) => {
|
|
|
+ return requestByPost("/api/wx/book/save", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 图书-删除
|
|
|
+export const deleteBookApi = (id) => {
|
|
|
+ return requestByGet(`/api/wx/book/remove/${id}`);
|
|
|
+};
|
|
|
+
|
|
|
+// 书签|笔记-保存
|
|
|
+export const saveLabelApi = (params) => {
|
|
|
+ return requestByPost("/api/wx/label/save", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 书签|笔记-列表
|
|
|
+export const getLabelListApi = (bookId, type) => {
|
|
|
+ return requestByGet(`/api/wx/label/getList/${bookId}/${type}`);
|
|
|
+};
|
|
|
+
|
|
|
+// 书签|笔记-列表
|
|
|
+export const deleteLabelApi = (id) => {
|
|
|
+ return requestByGet(`/api/wx/label/del/${id}`);
|
|
|
+};
|
|
|
+
|
|
|
+// 留言-我的列表
|
|
|
+export const getMessageListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/message/pageList", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 留言-保存
|
|
|
+export const saveMessageApi = (params) => {
|
|
|
+ return requestByPost("/api/wx/message/save", params);
|
|
|
+};
|
|
|
+
|
|
|
+// 留言-删除
|
|
|
+export const deleteMessageApi = (id) => {
|
|
|
+ return requestByGet(`/api/wx/message/remove/${id}`);
|
|
|
+};
|
|
|
+
|
|
|
+// 影印&视频-列表-分页
|
|
|
+export const getMediaListApi = (params) => {
|
|
|
+ return requestByPost("/api/show/video/pageList", params, {
|
|
|
+ meta: {
|
|
|
+ showMobileLoading: true,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|