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

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

22
	async syncMyBlog() {
23
		return await axios.get('http://localhost:80/csdnArticleInfo/syncMyBlog')
24
	},
25
	async resetLikes() {
26
		return await axios.get('http://localhost:80/csdnArticleInfo/fixLikesStatus')
27 28
	},
	async allTriplet(articleIds) {
29
		return await axios.post('http://localhost:80/csdnArticleInfo/multiTriplet', articleIds)
30
	},
31
	async articleInfoDelete(id) {
32
		return await axios.get('http://localhost:80/csdnArticleInfo/delete', {
33 34 35 36 37
			params: {
				id: id,
			},
		})
	},
38 39 40

	//红包管理
	async dealViewCount(id) {
41
		return await axios.get('http://localhost:80/csdn/redPackage/getViewCountById?id=' + id)
42 43
	},
	async getTodayRedPackageDetailInfo() {
44
		return await axios.get('http://localhost:80/csdn/redPackage/detail/getTodayRedPackageDetailInfo')
45 46
	},
	async syncDetailInfo(id) {
47
		return await axios.get('http://localhost:80/csdn/redPackage/detail/syncDetailInfo?id=' + id)
48
	},
49
	async redPackagePage(currentPage, pageSize, formInline) {
50
		return await axios.post('http://localhost:80/csdn/redPackage/page', {
51 52 53 54 55 56
			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
			itemType: formInline.itemType == '全部' ? null : formInline.itemType,
			msg: formInline.msg == '全部' ? null : formInline.msg,
		})
	},
	async redPackageDetailList(currentPage, pageSize, orderNo, communityId, postId) {
63
		return await axios.post('http://localhost:80/csdn/redPackage/detail/page', {
64 65 66
			page: currentPage,
			pageSize: pageSize,
			orderNo: orderNo,
67 68
			communityId: communityId == 'null' || communityId == -1 ? '' : communityId,
			postId: postId == 'null' || postId == -1 ? '' : postId,
69 70
		})
	},
71 72 73

	//粉丝管理
	async fansInfoPage(currentPage, pageSize, relationType) {
74
		return await axios.post('http://localhost:80/csdn/followFans/page', {
75 76 77 78 79 80
			page: currentPage,
			pageSize: pageSize,
			relationType: relationType == '全部' ? '' : relationType,
		})
	},
	async syncFansInfo() {
81
		return await axios.get('http://localhost:80/csdn/followFans/saveFans')
82 83
	},
	async syncFollowInfo() {
84
		return await axios.get('http://localhost:80/csdn/followFans/saveFollow')
85 86
	},
	async cancleFollowInfo() {
87
		return await axios.get('http://localhost:80/csdn/followFans/deleteFollow')
88
	},
89 90
	//我的图片
	async queryPic(currentPage, pageSize, picType) {
91
		return await axios.get('http://localhost:80/picInfo/page', {
92 93 94 95 96 97 98
			params: {
				page: currentPage,
				pageSize: pageSize,
				picType: picType,
			},
		})
	},
99
	async editPicConfirm(currentRowId, type) {
100
		return await axios.post('http://localhost:80/picInfo/update', {
101 102 103 104
			id: currentRowId,
			type: type,
		})
	},
105
}
106
export default ApiService