ApiService.js 3.4 KB
Newer Older
1 2 3
import axios from 'axios'
// 创建一个名为 ApiService 的对象,包含您的异步方法
const ApiService = {
4 5 6 7 8 9 10 11 12 13 14 15 16 17
	// 三连日管理
	async tripletDayInfoPage(currentPage, pageSize, tripletDate) {
		return await axios.post('http://43.139.90.182:8888/dayInfo/page', {
			page: currentPage,
			pageSize: pageSize,
			startDate: tripletDate != null ? tripletDate[0] : '',
			endDate: tripletDate != null ? tripletDate[1] : '',
		})
	},

	async tripletDayReset() {
		return await axios.get('http://43.139.90.182:8888/dayInfo/add')
	},
	// 文章管理
18
	async triplet(articleId) {
19
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/triplet?articleId=' + articleId)
20
	},
21

22
	async syncMyBlog() {
23
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/syncMyBlog')
24
	},
25
	async resetLikes() {
26
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/fixLikesStatus')
27 28
	},
	async allTriplet(articleIds) {
29
		return await axios.post('http://43.139.90.182:8888/csdnArticleInfo/multiTriplet', articleIds)
30
	},
31
	async articleInfoDelete(id) {
32
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/delete', {
33 34 35 36 37
			params: {
				id: id,
			},
		})
	},
38 39 40 41 42 43 44 45 46 47 48

	//红包管理
	async dealViewCount(id) {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/getViewCountById?id=' + id)
	},
	async getTodayRedPackageDetailInfo() {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/detail/getTodayRedPackageDetailInfo')
	},
	async syncDetailInfo(id) {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/detail/syncDetailInfo?id=' + id)
	},
49 50 51 52 53 54 55 56
	async redPackagePage(currentPage, pageSize, formInline) {
		return await axios.post('http://43.139.90.182:8888/csdn/redPackage/page', {
			page: currentPage,
			pageSize: pageSize,
			nickName: formInline.nickName,
			myAmountStart: formInline.myAmountStart,
			myAmountEnd: formInline.myAmountEnd,
			startDate: formInline.startDate,
57
			orderNo: formInline.orderNo,
58 59 60 61 62 63 64 65 66 67 68 69 70
			itemType: formInline.itemType == '全部' ? null : formInline.itemType,
			msg: formInline.msg == '全部' ? null : formInline.msg,
		})
	},
	async redPackageDetailList(currentPage, pageSize, orderNo, communityId, postId) {
		return await axios.post('http://43.139.90.182:8888/csdn/redPackage/detail/page', {
			page: currentPage,
			pageSize: pageSize,
			orderNo: orderNo,
			communityId: communityId,
			postId: postId,
		})
	},
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

	//粉丝管理
	async fansInfoPage(currentPage, pageSize, relationType) {
		return await axios.post('http://43.139.90.182:8888/csdn/followFans/page', {
			page: currentPage,
			pageSize: pageSize,
			relationType: relationType == '全部' ? '' : relationType,
		})
	},
	async syncFansInfo() {
		return await axios.get('http://43.139.90.182:8888/csdn/followFans/saveFans')
	},
	async syncFollowInfo() {
		return await axios.get('http://43.139.90.182:8888/csdn/followFans/saveFollow')
	},
	async cancleFollowInfo() {
		return await axios.get('http://43.139.90.182:8888/csdn/followFans/deleteFollow')
	},
89 90 91 92 93 94 95 96 97 98
	//我的图片
	async queryPic(currentPage, pageSize, picType) {
		return await axios.get('http://43.139.90.182:8888/picInfo/page', {
			params: {
				page: currentPage,
				pageSize: pageSize,
				picType: picType,
			},
		})
	},
99 100 101 102 103 104
	async editPicConfirm(currentRowId, type) {
		return await axios.post('http://43.139.90.182:8888/picInfo/update', {
			id: currentRowId,
			type: type,
		})
	},
105
}
106
export default ApiService