Merge branch 'master' of http://khuhub.khu.ac.kr/2021105655/ossw-project into front
# Conflicts: # client/package.json # package-lock.json # package.json
Showing
7 changed files
with
189 additions
and
15 deletions
1 | +# How to Install | ||
2 | +``` | ||
3 | +npm install && cd client && npm install && cd ../ | ||
4 | +``` | ||
5 | + | ||
6 | +# How to Start | ||
7 | +``` | ||
8 | +npm start | ||
9 | +``` | ||
10 | + | ||
1 | # 학식 관련된 의견 주고 받는 커뮤니티 | 11 | # 학식 관련된 의견 주고 받는 커뮤니티 |
2 | > 친구의 부탁으로 인해 현재 제2기숙사와 학생회관의 학식을 보여주는 앱을 개발했습니다. | 12 | > 친구의 부탁으로 인해 현재 제2기숙사와 학생회관의 학식을 보여주는 앱을 개발했습니다. |
3 | > 이와 관련된 반응을 에브리타임 앱에서 보고 있었습니다. | 13 | > 이와 관련된 반응을 에브리타임 앱에서 보고 있었습니다. |
... | @@ -21,3 +31,170 @@ | ... | @@ -21,3 +31,170 @@ |
21 | ```한 사용자가 여러번 남기는 것을 막아야 해서 로그인 기능 고려 필요``` | 31 | ```한 사용자가 여러번 남기는 것을 막아야 해서 로그인 기능 고려 필요``` |
22 | * 게시물 작성을 유도하기 위해 포인트 적립을 통해 랭킹 기능 고려 | 32 | * 게시물 작성을 유도하기 위해 포인트 적립을 통해 랭킹 기능 고려 |
23 | * 작성된 글을 보기 쉽도록 게시글을 검색하는 기능 | 33 | * 작성된 글을 보기 쉽도록 게시글을 검색하는 기능 |
34 | + | ||
35 | +# BACK | ||
36 | +## 게시물 | ||
37 | +### /api/getList | ||
38 | +#### GET호출 | ||
39 | +> response | ||
40 | +> ``` | ||
41 | +> ["게시물 id1", "게시물 id2", "게시물 id3"] | ||
42 | +>``` | ||
43 | +>> 오늘 게시물들의 아이디 표시 | ||
44 | + | ||
45 | +------------- | ||
46 | +### /api/getList/:date | ||
47 | +#### GET호출 | ||
48 | +> response | ||
49 | +> ``` | ||
50 | +> ["게시물 id1", "게시물 id2", "게시물 id3"] | ||
51 | +>``` | ||
52 | +>> 특정 날자의 게시물들의 아이디 표시 | ||
53 | + | ||
54 | +------------- | ||
55 | +### /api/get | ||
56 | +#### GET호출 | ||
57 | +> request(body) | ||
58 | +> ``` | ||
59 | +> { | ||
60 | +> "idArray": ["게시물 id1", "게시물 id2", "게시물 id3"] | ||
61 | +> } | ||
62 | +> ``` | ||
63 | + | ||
64 | +> response | ||
65 | +> ``` | ||
66 | +> [ | ||
67 | +> { | ||
68 | +> "id": "게시물 id1", | ||
69 | +> "title": "제목1", | ||
70 | +> "content": "내용1" | ||
71 | +> }, | ||
72 | +> { | ||
73 | +> "id": "게시물 id2", | ||
74 | +> "title": "제목2", | ||
75 | +> "content": "내용2" | ||
76 | +> }, | ||
77 | +> { | ||
78 | +> "id": "게시물 id3", | ||
79 | +> "title": "제목3", | ||
80 | +> "content": "이 것은 긴 내용이..." | ||
81 | +> } | ||
82 | +> ] | ||
83 | +> ``` | ||
84 | +>> 특정 id(여러개)의 게시물 내용 요약 불러오기 | ||
85 | + | ||
86 | +------------- | ||
87 | +### /api/get/:id | ||
88 | +#### GET호출 | ||
89 | +> response | ||
90 | +> ``` | ||
91 | +> { | ||
92 | +> "title": "제목", | ||
93 | +> "content": "내용" | ||
94 | +> } | ||
95 | +>``` | ||
96 | +>> 특정 id의 게시물 불러오기 | ||
97 | + | ||
98 | +------------- | ||
99 | +### /api/isPassEqual | ||
100 | +#### POST호출 | ||
101 | +> request(body) | ||
102 | +> ``` | ||
103 | +> { | ||
104 | +> "id":"게시물 id", | ||
105 | +> "password":"사용자가 입력한 암호" | ||
106 | +> } | ||
107 | +> ``` | ||
108 | + | ||
109 | +> response | ||
110 | +> ``` | ||
111 | +> success | ||
112 | +> ``` | ||
113 | +> or | ||
114 | +> ``` | ||
115 | +> failed | ||
116 | +> ``` | ||
117 | +> | ||
118 | +>> 암호가 같으면 success, 아니면 failed | ||
119 | + | ||
120 | +------------- | ||
121 | +### /api/postSave | ||
122 | +#### POST호출 | ||
123 | +> request(body) | ||
124 | +> ``` | ||
125 | +> { | ||
126 | +> "title":"제목", | ||
127 | +> "content":"게시물 내용", | ||
128 | +> "password":"암호" | ||
129 | +> } | ||
130 | +> ``` | ||
131 | +>> 오늘 게시물 작성 | ||
132 | + | ||
133 | +## 대기시간 | ||
134 | +### /api/waiting | ||
135 | +#### GET호출 | ||
136 | +> response | ||
137 | +> ``` | ||
138 | +> [ | ||
139 | +> { | ||
140 | +> "value": "대기시간1", | ||
141 | +> "time": "12:34" | ||
142 | +> } | ||
143 | +> ] | ||
144 | +>``` | ||
145 | +>> 오늘의 대기시간 목록 가져오기 | ||
146 | + | ||
147 | +------------- | ||
148 | +### /api/waiting | ||
149 | +#### POST호출 | ||
150 | +> request(body) | ||
151 | +> ``` | ||
152 | +> { | ||
153 | +> "value":"대기시간2", | ||
154 | +> } | ||
155 | +> ``` | ||
156 | +> response | ||
157 | +> ``` | ||
158 | +> [ | ||
159 | +> { | ||
160 | +> "value": "대기시간1", | ||
161 | +> "time": "12:34" | ||
162 | +> }, | ||
163 | +> { | ||
164 | +> "value": "대기시간2", | ||
165 | +> "time": "13:57" | ||
166 | +> } | ||
167 | +> ] | ||
168 | +>``` | ||
169 | +>> 오늘의 대기시간 추가 | ||
170 | + | ||
171 | +## 제2기숙사 학식 메뉴 | ||
172 | +### /api/menuList | ||
173 | +#### GET호출 | ||
174 | +> response | ||
175 | +> ``` | ||
176 | +> { | ||
177 | +> "fo_date": [ | ||
178 | +> "2022-05-30", | ||
179 | +> "2022-05-31", | ||
180 | +> "2022-06-01", | ||
181 | +> "2022-06-02", | ||
182 | +> "2022-06-03" | ||
183 | +> ], | ||
184 | +> "fo_menu_lun": [ | ||
185 | +> "도시락: 고추장불고기,근대된장국,도토리묵무침,미역줄기볶음,배추김치", | ||
186 | +> "도시락: 치즈함박스테이크,쇠고기스프,양상추샐러드,햄채소볶음밥,오이피클,배추김치", | ||
187 | +> "운영없음", | ||
188 | +> "도시락: 王소시지&카레라이스,다시마무챗국,만두튀김,단무지무침,배추김치", | ||
189 | +> "도시락: 돈까스마요덮밥,매운콩나물국,카레크로켓,마카로니샐러드,볶음김치" | ||
190 | +> ], | ||
191 | +> "fo_menu_eve": [ | ||
192 | +> "도시락: 참치김치찌개,꼬마돈가스,돌자반볶음,단무지,쌀밥", | ||
193 | +> "도시락: 비빔우동&납작만두,유부장국,완자전,무말랭이무침,배추김치", | ||
194 | +> "운영없음", | ||
195 | +> "도시락: 치즈데리야끼불고기볶음밥,떡강정,양배추콘샐러드,배추김치,탄산음료", | ||
196 | +> "운영없음" | ||
197 | +> ] | ||
198 | +> } | ||
199 | +>``` | ||
200 | +>> 제2기숙사 학식 메뉴 일주일치 가져오기 | ... | ... |
... | @@ -7,6 +7,7 @@ | ... | @@ -7,6 +7,7 @@ |
7 | "@testing-library/react": "^13.3.0", | 7 | "@testing-library/react": "^13.3.0", |
8 | "@testing-library/user-event": "^13.5.0", | 8 | "@testing-library/user-event": "^13.5.0", |
9 | "bootstrap": "^5.1.3", | 9 | "bootstrap": "^5.1.3", |
10 | + "axios": "^0.27.2", | ||
10 | "react": "^18.1.0", | 11 | "react": "^18.1.0", |
11 | "react-bootstrap": "^2.4.0", | 12 | "react-bootstrap": "^2.4.0", |
12 | "react-dom": "^18.1.0", | 13 | "react-dom": "^18.1.0", | ... | ... |
This diff is collapsed. Click to expand it.
1 | { | 1 | { |
2 | "scripts": { | 2 | "scripts": { |
3 | "server": "cd server && nodemon server", | 3 | "server": "cd server && nodemon server", |
4 | - "client": "cd client && npm start", | 4 | + "client": "cd client && export PORT=8080 && set PORT=8080 && npm start --port", |
5 | "start": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"" | 5 | "start": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"" |
6 | }, | 6 | }, |
7 | "dependencies": { | 7 | "dependencies": { |
8 | "axios": "^0.27.2", | 8 | "axios": "^0.27.2", |
9 | - "bootstrap": "^5.1.3", | 9 | + "body-parser": "^1.20.0", |
10 | "concurrently": "^7.2.1", | 10 | "concurrently": "^7.2.1", |
11 | "express": "^4.18.1", | 11 | "express": "^4.18.1", |
12 | "http-proxy-middleware": "^2.0.6", | 12 | "http-proxy-middleware": "^2.0.6", |
13 | + "mongoose": "^6.3.4", | ||
13 | "nodemon": "^2.0.16", | 14 | "nodemon": "^2.0.16", |
14 | - "react-bootstrap": "^2.4.0" | 15 | + "xhr2": "^0.2.1" |
15 | } | 16 | } |
16 | } | 17 | } | ... | ... |
server/Router/api.js
0 → 100644
This diff is collapsed. Click to expand it.
server/Router/test.js
deleted
100644 → 0
1 | const express = require('express'); | 1 | const express = require('express'); |
2 | const app = express(); | 2 | const app = express(); |
3 | -const test = require('.//Router/test'); | 3 | +const api = require('./Router/api'); |
4 | +let bodyParser = require('body-parser'); | ||
5 | +app.use(bodyParser.urlencoded({ extended: false })); | ||
6 | +app.use(bodyParser.json()); | ||
4 | 7 | ||
5 | -app.use('/', test); | 8 | +app.use('/', api); |
6 | 9 | ||
7 | -const port=23023; | ||
8 | -app.listen(port, ()=>{console.log(`Listening on port ${port}`)}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
10 | +const port = 23023; | ||
11 | +app.listen(port, () => { console.log(`Listening on port ${port}`) }); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment