curl -X GET http://localhost:5000/
curl -d '{"title":"42DoProject", "totalMember":"5", "currentMember":"5", "state":"proceeding", "tag":["react", "express"]}' -H "Content-Type: application/json" -X POST http://localhost:5000/project
curl -X DELETE 'http://localhost:5000/project?id=1'
http://localhost:5000/dump
를 활용하여 데이터 저장 가능jwt.io
를 통해 여러 user를 접속시켜 테스트 가능{
"title": "42DoProject",
"startDate": "2021-09-01",
"endDate": "2021-12-15",
"content": "hi",
"skill": ["0", "1"]
}
{
"title": "foryouth",
"startDate": "2021-07-01",
"endDate": "2021-09-01",
"content": "hello"
}
{
"title": "42chelin",
"startDate": "2021-07-01",
"endDate": "2021-12-15",
"content": "world",
"skill": ["0"],
"position": ["1"]
}
{
"title": "OFDM",
"state": "completed",
"startDate": "2018-09-01",
"endDate": "2019-01-25",
"content": "bye"
}
{
"title": "drone",
"state": "completed",
"startDate": "2019-03-01",
"endDate": "2019-07-01",
"content": "hello drone",
"skill": ["0"],
"position": ["1"]
}
{
"title": "emotion",
"startDate": "2021-09-01",
"endDate": "2021-12-15",
"content": "emotion timeline",
"skill": ["0", "1"],
"position": ["0", "1", "1", "1"]
}
{
"title": "42 restaurants",
"startDate": "2021-09-01",
"endDate": "2021-12-15",
"content": "delicious 42",
"skill": ["0", "2"],
"position": ["0", "1", "1"]
}
{
"title": "humans of 42",
"startDate": "2021-09-01",
"endDate": "2021-12-15",
"content": "warm 42cadet",
"skill": ["0", "1", "2", "3"],
"position": ["0", "0", "1", "1"]
}
{
"title": "Matching Education",
"startDate": "2021-09-01",
"endDate": "2021-12-15",
"content": "hello cadet",
"skill": ["1", "3"],
"position": ["0", "0", "1", "1", "1"]
}
{
"title": "42 checkin",
"startDate": "2021-01-01",
"endDate": "2021-12-15",
"content": "please checkin",
"skill": ["0", "1", "3"],
"position": ["0", "1", "1", "1"]
}
profiles
INSERT INTO profiles (`level`) VALUE(1);
INSERT INTO profiles (`level`) VALUE(2);
INSERT INTO profiles (`level`) VALUE(3);
INSERT INTO profiles (`level`) VALUE(4);
INSERT INTO profiles (`level`) VALUE(5);
INSERT INTO profiles (`level`) VALUE(6);
INSERT INTO profiles (`level`) VALUE(7);
applyprojectprofiles
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(1, 1, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(1, 4, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(1, 6, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(1, 7, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(2, 4, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 1, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 2, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 3, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 4, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 5, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 6, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(3, 7, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(4, 2, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(4, 4, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `createdAt`, `updatedAt`) VALUE(4, 6, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `position`, `createdAt`, `updatedAt`) VALUE(11, 1, 1, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `position`, `createdAt`, `updatedAt`) VALUE(11, 1, 3, NOW(), NOW());
INSERT INTO applyprojectprofiles (`projectId`, `profileId`, `position`, `createdAt`, `updatedAt`) VALUE(12, 1, 1, NOW(), NOW());
comments
{
"comment": "wonderful",
"contentId": "3",
"profileId": "1"
}
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("beautiful", 3, 2, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("awesome", 3, 3, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("good", 1, 4, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("exellent", 3, 5, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("nice to meet you", 2, 6, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("see you again", 4, 7, NOW(), NOW());
INSERT INTO comments (`comment`, `contentId`, `profileId`, `createdAt`, `updatedAt`) VALUE("thank you", 4, 7, NOW(), NOW());
+a project
INSERT INTO projects (`title`, `leader`, `totalMember`, `currentMember`, `state`, `startDate`, `endDate`, `like`, `viewCount`, `commentCount`, `skill`, `position`, `createdAt`, `updatedAt`) VALUE("testProject", 2, 3, 1, "recruiting", "2021-09-01", "2021-12-15", 0, 0, 0, "[1, 2]", "[1, 3]", NOW(), NOW());
INSERT INTO projects (`title`, `leader`, `totalMember`, `currentMember`, `state`, `startDate`, `endDate`, `like`, `viewCount`, `commentCount`, `skill`, `position`, `createdAt`, `updatedAt`) VALUE("testProject2", 3, 4, 1, "recruiting", "2021-09-01", "2021-12-15", 0, 0, 0, "[1]", "[3, 1, 0]", NOW(), NOW());
INSERT INTO projects (`title`, `leader`, `totalMember`, `currentMember`, `state`, `startDate`, `endDate`, `like`, `viewCount`, `commentCount`, `skill`, `position`, `createdAt`, `updatedAt`) VALUE("testProject3", 4, 4, 1, "recruiting", "2021-09-01", "2021-12-15", 0, 0, 0, "[1]", "[3, 0, 0]", NOW(), NOW());
project.service.ts
코드 리팩토링