重新提交
Change-Id: I41d894c30f6945402022f7309d52d9dfc0ff4c79
diff --git a/src/api/recommend.js b/src/api/recommend.js
new file mode 100644
index 0000000..13c9f94
--- /dev/null
+++ b/src/api/recommend.js
@@ -0,0 +1,30 @@
+// src/api/recommend.js
+import { api } from './auth';
+
+export const getRecommendations = async (limit = 5) => {
+ try {
+ const response = await api.get('/recommend/for-user', {
+ params: { limit }
+ });
+ return response.data;
+ } catch (error) {
+ console.error('获取推荐失败:', error);
+ throw error;
+ }
+};
+
+export const markRecommendationShown = async (torrentId) => {
+ try {
+ await api.post(`/recommend/mark-shown/${torrentId}`);
+ } catch (error) {
+ console.error('标记推荐为已显示失败:', error);
+ }
+};
+
+export const markRecommendationClicked = async (torrentId) => {
+ try {
+ await api.post(`/recommend/mark-clicked/${torrentId}`);
+ } catch (error) {
+ console.error('标记推荐为已点击失败:', error);
+ }
+};
\ No newline at end of file