From d81c7e33bd614c1352b234bd9141f23bc70a1739 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sat, 8 Jan 2022 23:25:00 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9C=A8feat:=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=94=84=EB=A1=9C=EB=B0=94=EC=9D=B4=EB=8D=94=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EC=9E=A1=EA=B3=A0=20=EC=98=88=EC=8B=9C=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/mock/team.ts | 18 ++++++++++++++++++ src/infrastructure/provider/base.ts | 5 +++++ src/infrastructure/provider/team.ts | 26 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/infrastructure/mock/team.ts create mode 100644 src/infrastructure/provider/base.ts create mode 100644 src/infrastructure/provider/team.ts diff --git a/src/infrastructure/mock/team.ts b/src/infrastructure/mock/team.ts new file mode 100644 index 00000000..a0467b4e --- /dev/null +++ b/src/infrastructure/mock/team.ts @@ -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 }; +} diff --git a/src/infrastructure/provider/base.ts b/src/infrastructure/provider/base.ts new file mode 100644 index 00000000..045d87e7 --- /dev/null +++ b/src/infrastructure/provider/base.ts @@ -0,0 +1,5 @@ +import { TeamService } from './team'; + +export interface DataService { + teamRepository: TeamService; +} diff --git a/src/infrastructure/provider/team.ts b/src/infrastructure/provider/team.ts new file mode 100644 index 00000000..e5897570 --- /dev/null +++ b/src/infrastructure/provider/team.ts @@ -0,0 +1,26 @@ +export interface TeamService { + getIssueInfo(teamID: string, issueID: string): Promise; +} + +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[]; +}; From f2373a527082faf7cddd8b31d64f9715ce24112d Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 00:32:01 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=9Dchore:=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=A0=95=EB=B3=B4=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EB=AA=A9=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/mock/team.ts | 54 +++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/src/infrastructure/mock/team.ts b/src/infrastructure/mock/team.ts index a0467b4e..7417d494 100644 --- a/src/infrastructure/mock/team.ts +++ b/src/infrastructure/mock/team.ts @@ -1,18 +1,48 @@ 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: '', - }); + const getIssueInfo = async () => { + await wait(2000); + return { + createdAt: '2021-12-27', + title: '깃알못이라 iOS 프로젝트가 엉켜서 망가졌다', + category: '팀컬쳐', + team: { + teammates: [ + 'https://ww.namu.la/s/34abe06e2ac92dc187a850f51930231b0b933b71ef9372e4ad0c4c2084b231c772ff46ccdbed58e1967cfc9415be646acb7cd18fb95d96bf16052c1634e221ea01c72f96f97a4588c0ed1a9c2f53c741723b5794cecea4f8107ad062cc84e0d4', + 'https://ww.namu.la/s/0e30b51afeaedaccb096046b25d42d73599c54d16e44e0ea6ffd88a96f81d724e9d38cc3703b7c11ba2a70a4d136b02c68d7a2559a3da2e2dbdb1066424f5728449bc216de079e38f19434a086f7081437e4f833a8aabde3674cd34188c8c839', + ], + thumbnail: 'https://m.media-amazon.com/images/I/61EeKaRVyUL._AC_SL1100_.jpg', + title: '포켓몬주식회사', + }, + issueList: [ + { + writer: '주영주영', + target: '서진서진', + body: '서진아고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + { + writer: '효인효인', + target: '서진서진', + body: '서진아\n고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + { + writer: '지연지연', + target: '서진서진', + body: '서진아\n\n고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + ], + writer: '주영주영', + }; + }; return { getIssueInfo }; } + +const wait = (milliSeconds: number) => new Promise((resolve) => setTimeout(resolve, milliSeconds)); From 5264d9519d515b091079b3279864d5ac7bca01b8 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 00:34:24 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=90=9Bfix:=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20thu?= =?UTF-8?q?mbnail=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/provider/team.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/infrastructure/provider/team.ts b/src/infrastructure/provider/team.ts index e5897570..1e043e39 100644 --- a/src/infrastructure/provider/team.ts +++ b/src/infrastructure/provider/team.ts @@ -9,6 +9,7 @@ type IssueData = { team: TeamData; issueList: IssueDetail[]; writer: string; + thumbnail?: string; }; type TeamData = { From dc477b178898797fff116ce8addea12a036e5c15 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 00:35:00 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=92=85style:=20provider=EC=9D=98=20ba?= =?UTF-8?q?se.ts=EB=A5=BC=20index.ts=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/provider/base.ts | 5 ----- src/infrastructure/provider/index.ts | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) delete mode 100644 src/infrastructure/provider/base.ts create mode 100644 src/infrastructure/provider/index.ts diff --git a/src/infrastructure/provider/base.ts b/src/infrastructure/provider/base.ts deleted file mode 100644 index 045d87e7..00000000 --- a/src/infrastructure/provider/base.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { TeamService } from './team'; - -export interface DataService { - teamRepository: TeamService; -} diff --git a/src/infrastructure/provider/index.ts b/src/infrastructure/provider/index.ts new file mode 100644 index 00000000..0102d4ec --- /dev/null +++ b/src/infrastructure/provider/index.ts @@ -0,0 +1,18 @@ +import { teamDataMock } from '../mock/team'; +import { TeamService } from './team'; + +export const api: APIService = getAPIMethod(); + +function getAPIMethod(): APIService { + return provideMockAPIService(); +} + +function provideMockAPIService(): APIService { + const teamService = teamDataMock(); + + return { teamService }; +} + +export interface APIService { + teamService: TeamService; +} From 43c752a31bb4af210be86cd4e1a9bacce7ad3f04 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 03:13:20 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=A8feat:=20TeamIssue=20=EC=B0=BD?= =?UTF-8?q?=EC=97=90=EC=84=9C=20dataprovider=EC=9D=84=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=97=AC=20api=EB=A5=BC=20=ED=98=B8=EC=B6=9C=ED=95=B4?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/provider/team.ts | 26 ++------------------ src/infrastructure/provider/types/team.ts | 23 ++++++++++++++++++ src/presentation/pages/Team/Issue/index.tsx | 27 ++++++++++++++++++--- tsconfig.paths.json | 3 ++- 4 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 src/infrastructure/provider/types/team.ts diff --git a/src/infrastructure/provider/team.ts b/src/infrastructure/provider/team.ts index 1e043e39..90543470 100644 --- a/src/infrastructure/provider/team.ts +++ b/src/infrastructure/provider/team.ts @@ -1,27 +1,5 @@ +import { IssueData } from './types/team'; + export interface TeamService { getIssueInfo(teamID: string, issueID: string): Promise; } - -type IssueData = { - createdAt: string; - title: string; - category: string; - team: TeamData; - issueList: IssueDetail[]; - writer: string; - thumbnail?: string; -}; - -type TeamData = { - teammates: string[]; - thumbnail: string; - title: string; -}; - -type IssueDetail = { - writer: string; - target: string; - body: string; - createdAt: string; - keywordList: string[]; -}; diff --git a/src/infrastructure/provider/types/team.ts b/src/infrastructure/provider/types/team.ts new file mode 100644 index 00000000..ed59db20 --- /dev/null +++ b/src/infrastructure/provider/types/team.ts @@ -0,0 +1,23 @@ +export type IssueData = { + createdAt: string; + title: string; + category: string; + team: TeamData; + issueList: IssueDetail[]; + writer: string; + thumbnail?: string; +}; + +type TeamData = { + teammates: string[]; + thumbnail: string; + title: string; +}; + +type IssueDetail = { + writer: string; + target: string; + body: string; + createdAt: string; + keywordList: string[]; +}; diff --git a/src/presentation/pages/Team/Issue/index.tsx b/src/presentation/pages/Team/Issue/index.tsx index 86a7ae5d..335cfd4e 100644 --- a/src/presentation/pages/Team/Issue/index.tsx +++ b/src/presentation/pages/Team/Issue/index.tsx @@ -1,9 +1,30 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; +import { api } from '@provider/index'; +import { IssueData } from '@provider/types/team'; function TeamIssue() { - const { issueID } = useParams(); - return
팀원소개서 상세, 이슈 번호는 {issueID}
; + const { teamID, issueID } = useParams(); + const [issue, setIssue] = useState(null); + const [isValidating, setIsValidating] = useState(false); + + useEffect(() => { + if (!teamID || !issueID) return; + (async () => { + setIsValidating(true); + const data = await api.teamService.getIssueInfo(teamID, issueID); + setIssue(data); + setIsValidating(false); + })(); + }, [teamID, issueID]); + + return ( + <> +
팀원소개서 상세, 이슈 번호는 {issueID}
+ {isValidating &&
로딩중
} +
{issue && issue.title}
+ + ); } export default TeamIssue; diff --git a/tsconfig.paths.json b/tsconfig.paths.json index e871e20f..dc1d3e51 100644 --- a/tsconfig.paths.json +++ b/tsconfig.paths.json @@ -10,7 +10,8 @@ "@models/*": ["src/application/models/*"], "@stores/*": ["src/application/stores/*"], "@hooks/*": ["src/application/hooks/*"], - "@api/*": ["src/infrastructure/api/*"] + "@api/*": ["src/infrastructure/api/*"], + "@provider/*": ["src/infrastructure/provider/*"] } } } From 7e118b944db525bf0a3c5a28ff6411f3833bc1f8 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 03:19:06 +0900 Subject: [PATCH 6/7] =?UTF-8?q?:nail=5Fcare:style:=20=EB=8D=94=EB=AF=B8?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=ED=8C=8C=EC=9D=BC=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/mock/team.data.ts | 39 ++++++++++++++++++++++++++++ src/infrastructure/mock/team.ts | 39 ++-------------------------- 2 files changed, 41 insertions(+), 37 deletions(-) create mode 100644 src/infrastructure/mock/team.data.ts diff --git a/src/infrastructure/mock/team.data.ts b/src/infrastructure/mock/team.data.ts new file mode 100644 index 00000000..4b6a78ce --- /dev/null +++ b/src/infrastructure/mock/team.data.ts @@ -0,0 +1,39 @@ +export const TEAM_DATA = { + ISSUE_INFO: { + createdAt: '2021-12-27', + title: '깃알못이라 iOS 프로젝트가 엉켜서 망가졌다', + category: '팀컬쳐', + team: { + teammates: [ + 'https://ww.namu.la/s/34abe06e2ac92dc187a850f51930231b0b933b71ef9372e4ad0c4c2084b231c772ff46ccdbed58e1967cfc9415be646acb7cd18fb95d96bf16052c1634e221ea01c72f96f97a4588c0ed1a9c2f53c741723b5794cecea4f8107ad062cc84e0d4', + 'https://ww.namu.la/s/0e30b51afeaedaccb096046b25d42d73599c54d16e44e0ea6ffd88a96f81d724e9d38cc3703b7c11ba2a70a4d136b02c68d7a2559a3da2e2dbdb1066424f5728449bc216de079e38f19434a086f7081437e4f833a8aabde3674cd34188c8c839', + ], + thumbnail: 'https://m.media-amazon.com/images/I/61EeKaRVyUL._AC_SL1100_.jpg', + title: '포켓몬주식회사', + }, + issueList: [ + { + writer: '주영주영', + target: '서진서진', + body: '서진아고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + { + writer: '효인효인', + target: '서진서진', + body: '서진아\n고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + { + writer: '지연지연', + target: '서진서진', + body: '서진아\n\n고맙다', + createdAt: '12/20', + keywordList: ['고마워'], + }, + ], + writer: '주영주영', + }, +}; diff --git a/src/infrastructure/mock/team.ts b/src/infrastructure/mock/team.ts index 7417d494..da0d2cd1 100644 --- a/src/infrastructure/mock/team.ts +++ b/src/infrastructure/mock/team.ts @@ -1,45 +1,10 @@ import { TeamService } from '../provider/team'; +import { TEAM_DATA } from './team.data'; export function teamDataMock(): TeamService { const getIssueInfo = async () => { await wait(2000); - return { - createdAt: '2021-12-27', - title: '깃알못이라 iOS 프로젝트가 엉켜서 망가졌다', - category: '팀컬쳐', - team: { - teammates: [ - 'https://ww.namu.la/s/34abe06e2ac92dc187a850f51930231b0b933b71ef9372e4ad0c4c2084b231c772ff46ccdbed58e1967cfc9415be646acb7cd18fb95d96bf16052c1634e221ea01c72f96f97a4588c0ed1a9c2f53c741723b5794cecea4f8107ad062cc84e0d4', - 'https://ww.namu.la/s/0e30b51afeaedaccb096046b25d42d73599c54d16e44e0ea6ffd88a96f81d724e9d38cc3703b7c11ba2a70a4d136b02c68d7a2559a3da2e2dbdb1066424f5728449bc216de079e38f19434a086f7081437e4f833a8aabde3674cd34188c8c839', - ], - thumbnail: 'https://m.media-amazon.com/images/I/61EeKaRVyUL._AC_SL1100_.jpg', - title: '포켓몬주식회사', - }, - issueList: [ - { - writer: '주영주영', - target: '서진서진', - body: '서진아고맙다', - createdAt: '12/20', - keywordList: ['고마워'], - }, - { - writer: '효인효인', - target: '서진서진', - body: '서진아\n고맙다', - createdAt: '12/20', - keywordList: ['고마워'], - }, - { - writer: '지연지연', - target: '서진서진', - body: '서진아\n\n고맙다', - createdAt: '12/20', - keywordList: ['고마워'], - }, - ], - writer: '주영주영', - }; + return TEAM_DATA.ISSUE_INFO; }; return { getIssueInfo }; From cc393d4643404b94200a05babdb34ec75cbedcc4 Mon Sep 17 00:00:00 2001 From: seojin kim <001106ksj@gmail.com> Date: Sun, 9 Jan 2022 03:26:41 +0900 Subject: [PATCH 7/7] =?UTF-8?q?:nail=5Fcare:style:=20api=20=EC=A0=9C?= =?UTF-8?q?=EA=B3=B5=20=EB=A1=9C=EC=A7=81=EC=9D=84=20=EC=88=98=ED=96=89?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=B9=9C=EA=B5=AC=EC=9D=98=20=EB=94=94?= =?UTF-8?q?=EB=A0=89=ED=84=B0=EB=A6=AC=EB=AA=85=EC=9D=84=20api=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/{provider => api}/index.ts | 0 src/infrastructure/{provider => api}/team.ts | 0 src/infrastructure/{provider => api}/types/team.ts | 0 src/infrastructure/mock/team.ts | 2 +- src/presentation/pages/Team/Issue/index.tsx | 4 ++-- tsconfig.paths.json | 3 +-- 6 files changed, 4 insertions(+), 5 deletions(-) rename src/infrastructure/{provider => api}/index.ts (100%) rename src/infrastructure/{provider => api}/team.ts (100%) rename src/infrastructure/{provider => api}/types/team.ts (100%) diff --git a/src/infrastructure/provider/index.ts b/src/infrastructure/api/index.ts similarity index 100% rename from src/infrastructure/provider/index.ts rename to src/infrastructure/api/index.ts diff --git a/src/infrastructure/provider/team.ts b/src/infrastructure/api/team.ts similarity index 100% rename from src/infrastructure/provider/team.ts rename to src/infrastructure/api/team.ts diff --git a/src/infrastructure/provider/types/team.ts b/src/infrastructure/api/types/team.ts similarity index 100% rename from src/infrastructure/provider/types/team.ts rename to src/infrastructure/api/types/team.ts diff --git a/src/infrastructure/mock/team.ts b/src/infrastructure/mock/team.ts index da0d2cd1..b3b8a97b 100644 --- a/src/infrastructure/mock/team.ts +++ b/src/infrastructure/mock/team.ts @@ -1,4 +1,4 @@ -import { TeamService } from '../provider/team'; +import { TeamService } from '@api/team'; import { TEAM_DATA } from './team.data'; export function teamDataMock(): TeamService { diff --git a/src/presentation/pages/Team/Issue/index.tsx b/src/presentation/pages/Team/Issue/index.tsx index 335cfd4e..072df174 100644 --- a/src/presentation/pages/Team/Issue/index.tsx +++ b/src/presentation/pages/Team/Issue/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; -import { api } from '@provider/index'; -import { IssueData } from '@provider/types/team'; +import { api } from '@api/index'; +import { IssueData } from '@api/types/team'; function TeamIssue() { const { teamID, issueID } = useParams(); diff --git a/tsconfig.paths.json b/tsconfig.paths.json index dc1d3e51..e871e20f 100644 --- a/tsconfig.paths.json +++ b/tsconfig.paths.json @@ -10,8 +10,7 @@ "@models/*": ["src/application/models/*"], "@stores/*": ["src/application/stores/*"], "@hooks/*": ["src/application/hooks/*"], - "@api/*": ["src/infrastructure/api/*"], - "@provider/*": ["src/infrastructure/provider/*"] + "@api/*": ["src/infrastructure/api/*"] } } }