Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

데이터 프로바이더 코드 짜기 #23

Merged
merged 8 commits into from
Jan 9, 2022
Next Next commit
✨feat: 데이터 프로바이더 구조 잡고 예시 작성하기
  • Loading branch information
SeojinSeojin committed Jan 8, 2022
commit d81c7e33bd614c1352b234bd9141f23bc70a1739
18 changes: 18 additions & 0 deletions src/infrastructure/mock/team.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { TeamService } from '../provider/team';

export function teamDataMock(): TeamService {
const getIssueInfo = async () => ({
createdAt: '2021-12-27',
title: '깃알못이라 iOS 프로젝트가 엉켜서 망가졌다',
category: '팀컬쳐',
team: {
teammates: [''],
thumbnail: '',
title: '',
},
issueList: [{ writer: '', target: '', body: '', createdAt: '12/20', keywordList: [''] }],
writer: '',
});

return { getIssueInfo };
}
5 changes: 5 additions & 0 deletions src/infrastructure/provider/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { TeamService } from './team';

export interface DataService {
teamRepository: TeamService;
}
26 changes: 26 additions & 0 deletions src/infrastructure/provider/team.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export interface TeamService {
getIssueInfo(teamID: string, issueID: string): Promise<IssueData>;
}

type IssueData = {
createdAt: string;
title: string;
category: string;
team: TeamData;
issueList: IssueDetail[];
writer: string;
};

type TeamData = {
teammates: string[];
thumbnail: string;
title: string;
};

type IssueDetail = {
writer: string;
target: string;
body: string;
createdAt: string;
keywordList: string[];
};