| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import {axios} from "@/requests/axios.config";
- const prefix = "/project";
- function findAllProjects() {
- return axios.get(`${prefix}/findAll`);
- }
- function findCourseProjects() {
- return axios.get(`${prefix}/findCourse`);
- }
- function findNonCourseProjects() {
- return axios.get(`${prefix}/findNonCourse`);
- }
- function findProjectById(id) {
- return axios.get(`${prefix}/findById`, {
- params: {
- id,
- }
- });
- }
- function findProjectsByCourse(courseId) {
- return axios.get(`${prefix}/findByCourse`, {
- params: {
- courseId,
- }
- });
- }
- function createProject(data) {
- return axios.post(`${prefix}`, data);
- }
- function findProjectMembers(id) {
- return axios.get(`${prefix}/findMembers`, {
- params: {
- id,
- }
- });
- }
- function updateCourseProjectState(id) {
- return axios.put(`${prefix}/updateState`, null, {
- params: {
- id,
- }
- });
- }
- function forkProject(projectId, name = null) {
- return axios.post(`${prefix}/fork`, null, {
- params: {
- projectId,
- name,
- }
- });
- }
- function findAllPublicProjectsGroupByCourse() {
- return axios.get(`${prefix}/findAllPublicGroupByCourse`);
- }
- const projectAPIs = {
- findAllProjects,
- findCourseProjects,
- findNonCourseProjects,
- findProjectById,
- findProjectMembers,
- findProjectsByCourse,
- createProject,
- updateCourseProjectState,
- forkProject,
- findAllPublicProjectsGroupByCourse,
- };
- export default projectAPIs;
|