前端简单界面
Change-Id: I7df9774daf4df8d92b13e659effe426ab0b6180b
diff --git a/pt--frontend/src/api/friends.js b/pt--frontend/src/api/friends.js
new file mode 100644
index 0000000..f139cc2
--- /dev/null
+++ b/pt--frontend/src/api/friends.js
@@ -0,0 +1,20 @@
+import axios from 'axios';
+
+const BASE_URL = 'http://localhost:8080/friends';
+
+// 添加好友
+export const addFriend = (friendData) => {
+ return axios.post(`${BASE_URL}/add`, friendData);
+};
+
+// ✅ 删除好友(通过 friend1 和 friend2 双向删除)
+export const deleteFriend = (friend1, friend2) => {
+ return axios.delete(`${BASE_URL}/delete`, {
+ params: { friend1, friend2 }
+ });
+};
+
+// 查询某个用户的所有好友(friend1 或 friend2)
+export const getFriendsByUserId = (userid) => {
+ return axios.get(`${BASE_URL}/list/${userid}`);
+};