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

Main branch update from Dev branch #533

Merged
merged 64 commits into from
Aug 20, 2024
Merged
Changes from 6 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6b3ecf6
Add: 첫번째 계획 코드 (미사용 예정)
ybmin Feb 6, 2024
1d7a106
Add: Cron 추가 및 기작 수정
ybmin Feb 6, 2024
4de7926
Docs: 주석 수정
ybmin Feb 6, 2024
754396c
Add: 네이버 api용 .env 환경 변수 추가
ybmin Feb 6, 2024
de8eefc
Add: Added validator & use project locations
ybmin Feb 13, 2024
163abbf
Add: 일주일 단위 캐싱
ybmin Mar 9, 2024
9d72e86
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 9, 2024
a8cce54
Refactor: change fare location schema string to object id
ybmin Mar 13, 2024
1120f42
Refactor: express-validator to ajv & swagger docs
ybmin Mar 13, 2024
514e174
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 13, 2024
2ac458a
Refactor: start, goal to from, to
ybmin Mar 13, 2024
840b99e
Fix: init error case
ybmin Mar 19, 2024
86ed106
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 19, 2024
11c69cc
Refactor: chat content validation
chlehdwon Mar 21, 2024
1b898f3
Docs: add chatsSchema
chlehdwon Mar 21, 2024
081b182
Merge branch 'dev' of https://github.com/sparcs-kaist/taxi-back into …
chlehdwon Mar 21, 2024
a1bab8d
Refactor: zod migration
ybmin Mar 21, 2024
cd94ed6
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 21, 2024
4c88442
Docs: change to naver api optional
ybmin Mar 21, 2024
f11d01c
Add: module init code & exception case
ybmin Mar 21, 2024
f2c87db
Merge branch 'dev' into #449.2-chat-validation
chlehdwon Mar 22, 2024
c7603ba
Fix: remove import
ybmin Mar 25, 2024
671a07e
Fix: naver api axios 429 error
ybmin Mar 26, 2024
4dfaa40
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 26, 2024
5f58f32
feat: chat content regex sync with client
Mar 26, 2024
d9f92ca
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Mar 26, 2024
17ac485
Fix: env file
ybmin Mar 26, 2024
836e49e
Fix: naver api key none to null
ybmin Apr 23, 2024
b63c720
Refactor: review contents
ybmin May 1, 2024
b421a38
Fix: enable commented code
ybmin May 7, 2024
3ea9766
Fix: undo promise resolve
ybmin May 7, 2024
b72bfcc
Docs: comment added
ybmin May 7, 2024
8b29fef
Merge branch 'dev' into #450-택시비용-보여주기
ybmin May 7, 2024
cf1a7c8
Fix: unusual case
ybmin May 7, 2024
5b8ee06
Docs: add fare docs to swagger
chlehdwon May 14, 2024
c1eb307
Merge branch '#450-택시비용-보여주기' of https://github.com/sparcs-kaist/taxi…
chlehdwon May 14, 2024
3b7adfd
Refactor: ts migration
ybmin Jul 7, 2024
a1e6a7e
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Jul 7, 2024
e1b82cb
Add: non credential test case execption
ybmin Jul 9, 2024
47671f9
Revert "Revert "#517 미정산 시 방 생성/참여 차단""
kmc7468 Jul 9, 2024
f36c436
Fix: code convention
ybmin Jul 9, 2024
57d1237
Revert: ts to js
ybmin Jul 18, 2024
a69f0fd
Add: 초기화시 빈 필드만 채움
ybmin Jul 18, 2024
c7a8d29
Fix: undefined error
ybmin Jul 18, 2024
ec9396f
Merge pull request #526 from sparcs-kaist/revert-521-revert-518-#517-…
kmc7468 Jul 18, 2024
ef3bc02
Fix: code review
ybmin Jul 19, 2024
b6c80fe
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Jul 19, 2024
ad54172
Remove: unused library
ybmin Jul 19, 2024
99e4262
Merge branch '#450-택시비용-보여주기' of https://github.com/sparcs-kaist/taxi…
ybmin Jul 19, 2024
81a37da
Fix: taxiFareModel is not displayed in admin page
kmc7468 Jul 20, 2024
7c48579
Fix: getTaxiFare -> getTaxiFareHandler
ybmin Jul 21, 2024
e348e63
Merge pull request #502 from sparcs-kaist/#449.2-chat-validation
kmc7468 Jul 23, 2024
4b2ca98
Merge branch 'dev' into #450-택시비용-보여주기
ybmin Jul 23, 2024
147fc5c
Merge pull request #451 from sparcs-kaist/#450-택시비용-보여주기
kmc7468 Jul 24, 2024
de3329f
Refactor: fix error
ybmin Aug 13, 2024
efe24c6
Fix: callback remove
ybmin Aug 13, 2024
ef7c98c
Feat: double catch
ybmin Aug 13, 2024
0eed8ab
Feat: null safety catch
ybmin Aug 20, 2024
9e6af15
Fix: invalid location in sampleData.json
kmc7468 Aug 20, 2024
d5c8346
Refactor: return 0 when locations are same in getTaxiFareHandler
kmc7468 Aug 20, 2024
d1efc81
Refactor: refactoring
kmc7468 Aug 20, 2024
ed177db
Merge pull request #532 from sparcs-kaist/#529-예상-택시-비용-쿼리-오류-해결
kmc7468 Aug 20, 2024
bdb4889
Fix: return 200 when there are no naver map api credentials
kmc7468 Aug 20, 2024
5ca7315
Merge pull request #535 from sparcs-kaist/#534-fix-gettaxifare-endpoint
kmc7468 Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/modules/patterns.js
Original file line number Diff line number Diff line change
@@ -15,5 +15,7 @@ module.exports = {
chat: {
chatImgType: RegExp("^(image/png|image/jpg|image/jpeg)$"),
chatSendType: RegExp("^(text|account)$"),
chatContent: RegExp("^\\s{0,}\\S{1}[\\s\\S]{0,}$"), // 왼쪽 공백 제외 최소 1개 문자
chatContentLength: RegExp("^[\\s\\S]{1,140}$"), // 공백 포함 최대 140문자
},
};
7 changes: 3 additions & 4 deletions src/routes/chats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const express = require("express");
const { body } = require("express-validator");
const validator = require("../middlewares/validator");
const { validateBody } = require("../middlewares/zod");
const { chatsZod } = require("./docs/schemas/chatsSchema");
const patterns = require("../modules/patterns");

const router = express.Router();
@@ -47,10 +49,7 @@ router.post(
*/
router.post(
"/send",
body("roomId").isMongoId(),
body("type").matches(patterns.chat.chatSendType),
body("content").isString(),
validator,
validateBody(chatsZod.sendChatHandler),
chatsHandlers.sendChatHandler
);

15 changes: 15 additions & 0 deletions src/routes/docs/schemas/chatsSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { z } = require("zod");
const { zodToSchemaObject } = require("../utils");
const { objectId, chat } = require("../../../modules/patterns");

const chatsZod = {
sendChatHandler: z.object({
roomId: z.string().regex(objectId),
type: z.string().regex(chat.chatSendType),
content: z.string().regex(chat.chatContent).regex(chat.chatContentLength),
}),
};

const chatsSchema = zodToSchemaObject(chatsZod);

module.exports = { chatsZod, chatsSchema };
2 changes: 2 additions & 0 deletions src/routes/docs/swaggerDocs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { reportsSchema } = require("./schemas/reportsSchema");
const { roomsSchema } = require("./schemas/roomsSchema");
const { chatsSchema } = require("./schemas/chatsSchema");
const reportsDocs = require("./reports");
const logininfoDocs = require("./logininfo");
const locationsDocs = require("./locations");
@@ -85,6 +86,7 @@ const swaggerDocs = {
schemas: {
...reportsSchema,
...roomsSchema,
...chatsSchema,
},
},
};