import { methodV } from "@/gitlab/request" ; interface IBranchList { pageSize ? : number ; pageNum ? : number ; access_token : string ; userId ? : string ; id ? : string ; projectId : string ; branch ? : string ; ref ? : string ; } description param { * } return { * } const getBranchList = async ( { pageSize , pageNum , projectId , access_token , } ) => { try { const { data , code } = await methodV ( { url : `/projects/${ projectId }/repository/branches` , method : "GET" , query : { per_page : pageSize , page : pageNum , access_token , } , } ) ; switch ( code ) { case 200 : { return data ; } default : { return { msg : data } ; } } } catch ( e ) { return { msg : e } ; } } ; description param { IBranchList } param1 return { * } const getBranch = async ( { projectId , branch } ) => { const { code , data } = await methodV ( { url : `/projects/${ projectId }/repository/branches/${ branch }` , method : "GET" , } ) ; return data ; } ; description param { IBranchList } param1 return { * } const createBranch = async ( { ref , projectId , branch , access_token } ) => { const { code , data } = await methodV ( { url : `/projects/${ projectId }/repository/branches` , params : { ref , branch , } , query : { access_token } , method : "POST" , } ) ; return data ; } ; description param { IBranchList } param1 return { * } const delBranch = async ( { projectId , branch = '' } ) => { const { code , data } = await methodV ( { url : `/projects/${ projectId }/repository/branches/${ encodeURIComponent ( branch ) }` , method : "DELETE" , } ) ; return data ; } ; export { getBranchList , createBranch , getBranch , delBranch , } ;