Skip to content

Commit

Permalink
✨feat: 데이터 프로바이더 구조 잡고 예시 작성하기
Browse files Browse the repository at this point in the history
  • Loading branch information
SeojinSeojin committed Jan 8, 2022
1 parent a561aab commit d81c7e3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
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[];
};

0 comments on commit d81c7e3

Please sign in to comment.