ApiService.js 6.4 KB
Newer Older
1
import axios from 'axios'
2

3
const BASE_URL = 'http://localhost:80'
4 5
// 创建一个名为 ApiService 的对象,包含您的异步方法
const ApiService = {
6
	// 三连日管理
7 8 9 10 11 12 13 14 15 16 17
	async tripletDayInfoPage(currentPage, pageSize, formInline) {
		return await axios.post(BASE_URL + '/dayInfo/page', {
			page: currentPage,
			pageSize: pageSize,
			startDate: formInline.tripletDate != null ? formInline.tripletDate[0] : '',
			endDate: formInline.tripletDate != null ? formInline.tripletDate[1] : '',
			weekInfo: formInline.weekInfo != null ? formInline.weekInfo : '',
		})
	},
	async dayRedPackageInfoPage(currentPage, pageSize, tripletDate) {
		return await axios.post(BASE_URL + '/csdn/csdnDayInfoRedPackage/page', {
18 19 20 21 22 23 24 25
			page: currentPage,
			pageSize: pageSize,
			startDate: tripletDate != null ? tripletDate[0] : '',
			endDate: tripletDate != null ? tripletDate[1] : '',
		})
	},

	async tripletDayReset() {
26 27 28 29
		return await axios.get(BASE_URL + '/dayInfo/add')
	},
	async sevenDay() {
		return await axios.get(BASE_URL + '/dayInfo/sevenDayOverview')
30 31
	},
	// 文章管理
32
	async triplet(articleId) {
33
		return await axios.get(BASE_URL + '/csdnArticleInfo/triplet?articleId=' + articleId)
34
	},
35

36
	async syncMyBlog() {
37
		return await axios.get(BASE_URL + '/csdnArticleInfo/syncMyBlog')
38
	},
39
	async resetLikes() {
40
		return await axios.get(BASE_URL + '/csdnArticleInfo/fixLikesStatus')
41 42
	},
	async allTriplet(articleIds) {
43
		return await axios.post(BASE_URL + '/csdnArticleInfo/multiTriplet', articleIds)
44
	},
45
	async articleInfoDelete(id) {
46
		return await axios.get(BASE_URL + '/csdnArticleInfo/delete', {
47 48 49 50 51
			params: {
				id: id,
			},
		})
	},
52 53 54

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

	//粉丝管理
90 91
	async fansInfoPage(currentPage, pageSize, formInline) {
		return await axios.post(BASE_URL + '/csdn/followFans/page', {
92 93
			page: currentPage,
			pageSize: pageSize,
94 95
			relationType: formInline.relationType,
			userName: formInline.userName,
96 97 98
		})
	},
	async syncFansInfo() {
99 100 101 102
		return await axios.get(BASE_URL + '/csdn/followFans/saveFans')
	},
	async cancleFansNoArticle() {
		return await axios.get(BASE_URL + '/csdn/followFans/deleteNoArticle')
103 104
	},
	async syncFollowInfo() {
105
		return await axios.get(BASE_URL + '/csdn/followFans/saveFollow')
106 107
	},
	async cancleFollowInfo() {
108
		return await axios.get(BASE_URL + '/csdn/followFans/deleteFollow')
109
	},
110
	//我的图片
111 112 113 114 115 116
	async queryPic(currentPage, pageSize, formInline) {
		return await axios.post(BASE_URL + '/picInfo/page', {
			page: currentPage,
			pageSize: pageSize,
			type: formInline.type == '全部' ? '' : formInline.type,
			picName: formInline.picName,
117 118
		})
	},
119
	async editPicConfirm(currentRowId, type, picName) {
120
		return await axios.post(BASE_URL + '/picInfo/update', {
121 122
			id: currentRowId,
			type: type,
123 124 125 126 127 128 129 130
			picName: picName,
		})
	},

	async batchUpdatePic(ids, type) {
		return await axios.post(BASE_URL + '/picInfo/batchUpdatePic', {
			ids: ids,
			type: type,
131 132
		})
	},
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
	//余额管理
	async accountManagementPage(currentPage, pageSize, formInline) {
		return await axios.post(BASE_URL + '/csdnAccountManagement/page', {
			page: currentPage,
			pageSize: pageSize,
			startDate: formInline.accountDate != null ? formInline.accountDate[0] : '',
			endDate: formInline.accountDate != null ? formInline.accountDate[1] : '',
			operateType: formInline.operateType != -1 ? formInline.operateType : null,
			productName: formInline.productName != '全部' ? formInline.productName : null,
			code: formInline.code,
		})
	},
	async addAccountInfo() {
		return await axios.get(BASE_URL + '/csdnAccountManagement/addAccountInfo')
	},
	async add5AccountInfo() {
		return await axios.get(BASE_URL + '/csdnAccountManagement/add5AccountInfo')
	},
	//累计红包管理
	async totalIncomePage(currentPage, pageSize, formInline) {
		return await axios.post(BASE_URL + '/csdn/totalIncome/page', {
			page: currentPage,
			pageSize: pageSize,
			startDate: formInline.accountDate != null ? formInline.accountDate[0] : '',
			endDate: formInline.accountDate != null ? formInline.accountDate[1] : '',
		})
	},
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
	//用户管理
	async multiTriplet(userNames) {
		return await axios.post(BASE_URL + '/csdn/multiTriplet', userNames)
	},
	async autoReply() {
		return await axios.get(BASE_URL + '/csdn/autoReply')
	},
	async singleTriplet(userName) {
		return await axios.get(BASE_URL + '/csdn/singleTriplet?username=' + userName)
	},

	//私信管理
	async dealMessageOne(userName) {
		return await axios.get(BASE_URL + '/csdn/message/dealMessageOne?userName=' + userName)
	},
	async dealMessage() {
		return await axios.get(BASE_URL + '/csdn/message/dealMessage')
	},
	async dealLikeCollect() {
		return await axios.get(BASE_URL + '/csdn/likeCollect/dealLikeCollect')
	},
	async acquireMessage() {
		return await axios.get(BASE_URL + '/csdn/message/acquireMessage')
	},
	async messagePage(currentPage, pageSize, formInline) {
		return await axios.post('http://localhost:80/csdn/message/page', {
			page: currentPage,
			pageSize: pageSize,
			userName: formInline.userName,
			nickName: formInline.nickName,
			hasReplied: formInline.hasRepliedInfo == -1 ? null : formInline.hasRepliedInfo,
		})
	},
193
}
194
export default ApiService