|
|
@@ -15,10 +15,42 @@ function getCommunicationDetail(communicationId) {
|
|
|
return axios.get(`https://www.fastmock.site/mock/7626b3aeb545b939cbf526e8fcfda744/api/communications/${communicationId}`);
|
|
|
}
|
|
|
|
|
|
+function getUserPublishCommunication(userId,page,size){
|
|
|
+ return axios.get(`${prefix}/users/${userId}`,{params:{page,size}});
|
|
|
+}
|
|
|
+
|
|
|
+function starCommunication(userId,communicationId){
|
|
|
+ return axios.post(`${prefix}/${communicationId}/stars`,{params:{userId}});
|
|
|
+}
|
|
|
+
|
|
|
+function cancelStarCommunication(userId,communicationId){
|
|
|
+ return axios.delete(`${prefix}/${communicationId}/stars`,{params:{userId}});
|
|
|
+}
|
|
|
+
|
|
|
+function getStarredCommunication(userId,page,size){
|
|
|
+ return axios.get(`${prefix}/stars/users/${userId}`,{params:{page,size}});
|
|
|
+}
|
|
|
+
|
|
|
+function uploadFile(file){
|
|
|
+ let data = new FormData();
|
|
|
+ data.append("file", file);
|
|
|
+ return axios.post(`${prefix}/upload`, data);
|
|
|
+}
|
|
|
+
|
|
|
+function postCommunication(communication){
|
|
|
+ return axios.post(`${prefix}`,communication);
|
|
|
+}
|
|
|
+
|
|
|
const communicationsAPIs = {
|
|
|
getAllCommunications,
|
|
|
getCommunicationStarers,
|
|
|
getCommunicationDetail,
|
|
|
+ getUserPublishCommunication,
|
|
|
+ starCommunication,
|
|
|
+ cancelStarCommunication,
|
|
|
+ getStarredCommunication,
|
|
|
+ uploadFile,
|
|
|
+ postCommunication,
|
|
|
};
|
|
|
|
|
|
export default communicationsAPIs;
|