import { methodV } from "@/gitlab/request" ; interface IProjectList { pageSize ? : number ; pageNum ? : number ; access_token : string ; userId ? : string ; id ? : string ; } description param { IProjectList } param1 return { * } const getProjectList = async ( { pageSize , pageNum , access_token } ) => { const { data : projectList } = await methodV ( { url : "/projects" , method : "GET" , query : { per_page : pageSize , page : pageNum , access_token } , } ) ; return { projectList } ; } ; description param { IProjectList } param1 return { * } const getProjectByUser = async ( { pageSize , pageNum , access_token , userId } ) => { const { data : projectList } = await methodV ( { url : `/users/${ userId }/projects` , method : "GET" , query : { per_page : pageSize , page : pageNum , access_token } , } ) ; return { projectList } ; } ; description param { IProjectList } param1 return { * } const getProject = async ( { id , access_token } ) => { const { data : project } = await methodV ( { url : `/projects/${ id }` , method : "GET" , query : { access_token } } ) ; return project ; } ; description param { any } param1 return { * } const createProjects = async ( { gitParams } ) => { const { data } = await methodV ( { url : "/projects" , method : "POST" , params : { ... gitParams , } , } ) ; return data ; } ; description param { number } projectId return { * } const deleteProtectedBranches = async ( projectId ) => { const url = `/projects/${ projectId }/protected_branches/master` ; const { data } = await methodV ( { url , method : "DELETE" , } ) ; return data ; } ; description param { number } projectId return { * } const protectedBranches = async ( projectId ) => { const url = `/projects/${ projectId }/protected_branches` ; const { data } = await methodV ( { url , method : "POST" , params : { name : "master" , push_access_level : 0 , merge_access_level : 40 , } , } ) ; return data ; } ; export { getProjectList , getProject , getProjectByUser , createProjects , deleteProtectedBranches , protectedBranches , } ;