From 939806a946fbd5838628733634c618b87627928a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BA=BA=E7=BB=9D=E4=B8=8D=E4=B8=BA?= =?UTF-8?q?=E5=A5=B4?= Date: Thu, 21 Aug 2025 10:15:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BA=86=E8=80=81=E7=9A=84api=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/api.js | 464 -------------------------------------------- 1 file changed, 464 deletions(-) delete mode 100644 src/services/api.js diff --git a/src/services/api.js b/src/services/api.js deleted file mode 100644 index b248fd1..0000000 --- a/src/services/api.js +++ /dev/null @@ -1,464 +0,0 @@ -import request from "@/utils/request"; - -// Student API -export const studentAPI = { - // Get current logged-in student - getCurrentStudent: async () => - request({ - url: "/api/students/me", - method: "GET", - }), - - // Get student list - getList: async (params) => - request({ - url: "/api/students", - method: "GET", - params, - }), - - // Get student detail - getDetail: async (id) => - request({ - url: `/api/students/${id}`, - method: "GET", - }), - - // Create student - create: async (data) => - request({ - url: "/api/students", - method: "POST", - data, - }), - - // Update student - update: async (id, data) => - request({ - url: `/api/students/${id}`, - method: "PUT", - data, - }), - - // Get student progress - getProgress: async (id) => - request({ - url: `/api/students/${id}/progress`, - method: "GET", - }), -}; - -// Course API -export const courseAPI = { - // Get course list - getList: async (params) => - request({ - url: "/api/courses", - method: "GET", - params, - }), - - // Get course detail - getDetail: async (id) => - request({ - url: `/api/courses/${id}`, - method: "GET", - }), - - // Create course - create: async (data) => - request({ - url: "/api/courses", - method: "POST", - data, - }), - - // Update course - update: async (id, data) => - request({ - url: `/api/courses/${id}`, - method: "PUT", - data, - }), - - // Enroll student in course - enroll: async (courseId, studentId) => - request({ - url: `/api/courses/${courseId}/enroll`, - method: "POST", - data: { studentId }, - }), - - // Update enrollment progress - updateEnrollment: async (courseId, enrollmentId, data) => - request({ - url: `/api/courses/${courseId}/enrollment/${enrollmentId}`, - method: "PUT", - data, - }), - - // Get course students - getStudents: async (id) => - request({ - url: `/api/courses/${id}/students`, - method: "GET", - }), -}; - -// Job API -export const jobAPI = { - // Get job list - getList: async (params) => - request({ - url: "/api/jobs", - method: "GET", - params, - }), - - // Get job detail - getDetail: async (id) => - request({ - url: `/api/jobs/${id}`, - method: "GET", - }), - - // Create job - create: async (data) => - request({ - url: "/api/jobs", - method: "POST", - data, - }), - - // Update job - update: async (id, data) => - request({ - url: `/api/jobs/${id}`, - method: "PUT", - data, - }), - - // Get recommended jobs for student - getRecommended: async (studentId) => - request({ - url: `/api/jobs/recommend/${studentId}`, - method: "GET", - }), -}; - -// Company API -export const companyAPI = { - // Get company list - getList: async (params) => - request({ - url: "/api/companies", - method: "GET", - params, - }), - - // Get company detail - getDetail: async (id) => - request({ - url: `/api/companies/${id}`, - method: "GET", - }), - - // Create company - create: async (data) => - request({ - url: "/api/companies", - method: "POST", - data, - }), - - // Update company - update: async (id, data) => - request({ - url: `/api/companies/${id}`, - method: "PUT", - data, - }), - - // Get company jobs - getJobs: async (id) => - request({ - url: `/api/companies/${id}/jobs`, - method: "GET", - }), -}; - -// Resume API -export const resumeAPI = { - // Get resume list - getList: async (params) => - request({ - url: "/api/resumes", - method: "GET", - params, - }), - - // Get resume detail - getDetail: async (id) => - request({ - url: `/api/resumes/${id}`, - method: "GET", - }), - - // Create resume - create: async (data) => - request({ - url: "/api/resumes", - method: "POST", - data, - }), - - // Update resume - update: async (id, data) => - request({ - url: `/api/resumes/${id}`, - method: "PUT", - data, - }), - - // Delete resume - delete: async (id) => - request({ - url: `/api/resumes/${id}`, - method: "DELETE", - }), - - // Get student's active resume - getStudentActive: async (studentId) => - request({ - url: `/api/resumes/student/${studentId}/active`, - method: "GET", - }), -}; - -// Interview API -export const interviewAPI = { - // Get interview list - getList: async (params) => - request({ - url: "/api/interviews", - method: "GET", - params, - }), - - // Get interview detail - getDetail: async (id) => - request({ - url: `/api/interviews/${id}`, - method: "GET", - }), - - // Schedule interview - schedule: async (data) => - request({ - url: "/api/interviews", - method: "POST", - data, - }), - - // Update interview - update: async (id, data) => - request({ - url: `/api/interviews/${id}`, - method: "PUT", - data, - }), - - // Cancel interview - cancel: async (id, reason) => - request({ - url: `/api/interviews/${id}/cancel`, - method: "POST", - data: { reason }, - }), - - // Submit feedback - submitFeedback: async (id, data) => - request({ - url: `/api/interviews/${id}/feedback`, - method: "POST", - data, - }), - - // Get student interview history - getStudentHistory: async (studentId) => - request({ - url: `/api/interviews/student/${studentId}/history`, - method: "GET", - }), -}; - -// Class API -export const classAPI = { - // Get class list - getList: async (params) => - request({ - url: "/api/classes", - method: "GET", - params, - }), - - // Get class detail - getDetail: async (id) => - request({ - url: `/api/classes/${id}`, - method: "GET", - }), - - // Create class - create: async (data) => - request({ - url: "/api/classes", - method: "POST", - data, - }), - - // Update class - update: async (id, data) => - request({ - url: `/api/classes/${id}`, - method: "PUT", - data, - }), - - // Get class students - getStudents: async (id) => - request({ - url: `/api/classes/${id}/students`, - method: "GET", - }), - - // Add student to class - addStudent: async (classId, studentId) => - request({ - url: `/api/classes/${classId}/students`, - method: "POST", - data: { studentId }, - }), - - // Remove student from class - removeStudent: async (classId, studentId) => - request({ - url: `/api/classes/${classId}/students/${studentId}`, - method: "DELETE", - }), - - // Get class statistics - getStats: async (id) => - request({ - url: `/api/classes/${id}/stats`, - method: "GET", - }), -}; - -// Learning Stage API -export const stageAPI = { - // Get all stages - getList: async () => - request({ - url: "/api/stages", - method: "GET", - }), - - // Get stage detail - getDetail: async (id) => - request({ - url: `/api/stages/${id}`, - method: "GET", - }), - - // Create stage - create: async (data) => - request({ - url: "/api/stages", - method: "POST", - data, - }), - - // Update stage - update: async (id, data) => - request({ - url: `/api/stages/${id}`, - method: "PUT", - data, - }), - - // Delete stage - delete: async (id) => - request({ - url: `/api/stages/${id}`, - method: "DELETE", - }), - - // Get stage courses - getCourses: async (id) => - request({ - url: `/api/stages/${id}/courses`, - method: "GET", - }), - - // Get stage students - getStudents: async (id) => - request({ - url: `/api/stages/${id}/students`, - method: "GET", - }), - - // Advance student to next stage - advanceStudent: async (stageId, studentId) => - request({ - url: `/api/stages/${stageId}/advance/${studentId}`, - method: "POST", - }), -}; - -// Auth API -export const authAPI = { - // Login - login: async (data) => - request({ - url: "/api/auth/login", - method: "POST", - data, - }), - - // Register - register: async (data) => - request({ - url: "/api/auth/register", - method: "POST", - data, - }), - - // Logout - logout: async () => - request({ - url: "/api/auth/logout", - method: "POST", - }), - - // Get current user - getCurrentUser: async () => - request({ - url: "/api/auth/me", - method: "GET", - }), -}; - -// Health Check -export const healthAPI = { - check: async () => - request({ - url: "/health", - method: "GET", - }), - checkDB: async () => - request({ - url: "/health/db", - method: "GET", - }), -};