import type { IStarOriginSource } from '@/components/StarBtn/types'; import { starRepo, unstarRepo } from '@/api/repo'; export function starInterface(repoId: string): IStarOriginSource { return { async unStar() { return unstarRepo({ repoId }).then(res => res.data); }, async star() { return starRepo({ repoId }).then(res => res.data); } } }