Skip to content

Commit

Permalink
Merge pull request #16 from joog-lim/hotfix-develop
Browse files Browse the repository at this point in the history
Hotfix develop
  • Loading branch information
sunrabbit123 authored Feb 17, 2022
2 parents d40bfa0 + 6f71fc3 commit c534452
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 95 deletions.
156 changes: 86 additions & 70 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,21 @@ export const CLIENT_ID_WEB = process.env.CLIENT_ID_WEB;

export const TIME_A_WEEK = 7 * 24 * 60 * 60;

export const rules = `
제 1μ‘° λͺ©μ 
export interface RuleContent {
_id: number;
title: string;
content: string;
}

λ³Έ κ·œμΉ™μ€ κ΄‘μ£Όμ†Œν”„νŠΈμ›¨μ–΄λ§ˆμ΄μŠ€ν„°κ³ λ“±ν•™κ΅ λŒ€λ‚˜λ¬΄μˆ² κ·œμΉ™μœΌλ‘œ, λŒ€λ‚˜λ¬΄μˆ²μ˜ 투λͺ…ν•œ 운영 및 읡λͺ…μ„± 보μž₯을 λͺ©μ μœΌλ‘œ ν•œλ‹€.
export interface descriptionRule extends RuleContent {
description: string[];
}

제 2μ‘° κ²Œμ‹œκΈ€ κ²Œμ‹œμ— κ΄€ν•œ κ·œμΉ™
export interface subContentrule extends RuleContent {
subContent?: Array<RuleContent | descriptionRule | subContentrule>;
}

- 제 1ν•­
λ‹€μŒκ³Ό 같은 κ²Œμ‹œλ¬Όμ˜ 경우 반렀 μ²˜λ¦¬κ°€ λ˜κ±°λ‚˜, μ‚­μ œκ°€ 될 수 μžˆλ‹€.
1호 λ‹€λ₯Έ μ‚¬μš©μžμ—κ²Œ λΆˆνŽΈν•¨μ„ 쀄 수 μžˆλŠ” 경우
1λͺ© 홍보λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” 경우
- 맀우 개인적인 μ‚¬ν•­λ“€λ‘œ, μ•± μΆ”μ²œμΈμ΄λ‚˜ κ²Œμž„ μΆ”μ²œμΈ 같은 경우
- λ§Žμ€ μ‚¬λžŒλ“€μ—κ²Œ λΆˆνŽΈν•¨μ„ μ•ˆκ²¨μ£ΌλŠ” 홍보인 경우
2λͺ© 친λͺ©μ„ 닀지기 μœ„ν•œ κ²Œμ‹œκΈ€μΌ 경우
3λͺ© μš•μ„€ 및 비속어 λ˜λŠ” 외섀적인 λ‚΄μš©μ„ ν¬ν•¨ν•˜λŠ” 경우
λ‹€μŒκ³Ό 같은 κ²½μš°λŠ” μ΅œμš°μ„ μ μœΌλ‘œ λ°˜λ €λ˜κ±°λ‚˜ μ‚­μ œλ  수 μžˆλ‹€.
- μ‹€λͺ…μ˜ 일뢀 이상이 μ–ΈκΈ‰λœ 경우, ex : 였xx, x병x, 였x진, xx진
4λͺ© 곡격적인 μ–΄μ‘°λ‘œ μž‘μ„±ν•œ 경우
λ‹€μŒκ³Ό 같은 κ²½μš°λŠ” μ΅œμš°μ„ μ μœΌλ‘œ λ°˜λ €λ˜κ±°λ‚˜ μ‚­μ œλ  수 μžˆλ‹€.
- μ‹€λͺ…μ˜ 일뢀 이상이 μ–ΈκΈ‰λœ 경우, ex : 였xx, x병x, 였x진, xx진
5λͺ© 제보 반렀 μ‚¬μœ λ₯Ό λ¬»λŠ” κ²Œμ‹œκΈ€μΌ 경우
6λͺ© μ§€λ‚˜μΉ˜κ²Œ κΈΈκ±°λ‚˜ μ§€λ‚˜μΉ˜κ²Œ 짧은 경우
- λ‘νŽ˜μ΄μ§€ 이상 μž‘μ•„λ¨ΉλŠ” 경우
- ν•œλ¬Έμž₯도 μ™„μ„±μ‹œν‚€μ§€ λͺ»ν•˜λŠ” 경우
7λͺ© λ‚΄μš©μ΄ μ§€λ‚˜μΉ˜κ²Œ λΆ€μ‹€ν•  경우
8λͺ© 해석이 λΆˆκ°€λŠ₯ν•œ μ•Œκ³ λ¦¬μ¦˜μΌ 경우
9λͺ© 타 고등학ꡐ λ˜λŠ” 본ꡐλ₯Ό λΉ„λ°©, λΉ„λ‚œν•˜λŠ” 경우
- 이유 μ—†λŠ” λΉ„νŒ λ˜ν•œ 제재의 λŒ€μƒμ΄ 될 수 μžˆλ‹€.
10λͺ© μ •μΉ˜/쒅ꡐ λ“± λ…Όλž€μ„ λΆˆλŸ¬μΌμœΌν‚¬ 여지가 μžˆλŠ” 경우
2호 νŠΉμ • μΈλ¬Όμ΄λ‚˜ 단체λ₯Ό μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜λŠ” 경우
단, μ‹€λͺ…이 κ±°λ‘ λ˜μ§€μ•ŠλŠ” 경우 λ˜ν•œ ν¬ν•¨ν•œλ‹€.
1λͺ© μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜μ—¬ λΉ„λ°©ν•˜λŠ” 경우
2λͺ© μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜μ—¬ λ°˜λ³΅λ˜λŠ” κ²Œμ‹œκΈ€μ΄ μ˜¬λΌμ˜€λŠ” 경우
3호 거래, 섀문쑰사, λΆ„μ‹€λ¬Ό 회수 λ˜λŠ” ꡬ인/ꡬ직을 λͺ©μ μœΌλ‘œ ν•˜λŠ” 경우
4호 λΆ„λž€μ„ μ‘°μž₯ν•˜λŠ” 경우
5호 λŒ€μˆ²μ§€κΈ°μ˜ νŒλ‹¨ μ•„λž˜, 반절 μ΄μƒμ˜ λŒ€μˆ²μ§€κΈ°λ“€μ΄ λ¬Έμ œκ°€ μžˆλ‹€κ³  νŒλ‹¨ν•œ 경우
ν•΄λ‹Ή ν˜Έκ°€ ν•΄λ‹Ήλ˜λŠ” 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ νšŒμ˜λ‘μ„ κ³΅κ°œν•΄μ•Όν•œλ‹€.
- 제 2ν•­
제 2μ‘° 1ν•­ 2ν˜Έμ— ν•΄λ‹Ήν•˜λŠ” κ²Œμ‹œκΈ€μ΄ 곡읡을 λͺ©μ μœΌλ‘œ ν•˜λŠ” κ³ λ°œμ„± 제보일 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ 회의 μ•„λž˜ κ²Œμ‹œλ  수 μžˆλ‹€.
단 λ‹€μŒ 기쀀듀이 μ—„κ²©νžˆ μ μš©λœλ‹€.
1호 μ‹€λͺ… 거둠의 경우 μ΄ˆμ„±μ²˜λ¦¬λ‚˜ λΈ”λΌμΈλ“œ 처리둜 μˆ˜μ •λœλ‹€.
2호 μœ‘ν•˜μ›μΉ™μ— μ˜κ±°ν•˜μ—¬ μž‘μ„±λ˜μ–΄μžˆμ–΄μ•Ό ν•œλ‹€.
3호 μΆ”μΈ‘μ„± λ‚΄μš©μ΄ ν¬ν•¨λ˜μ–΄μžˆμœΌλ©΄ μ•ˆλœλ‹€.
4호 μ‚¬μ‹€λ§Œ ν¬ν•¨λ˜μ–΄ μžˆμ–΄μ•Ό ν•œλ‹€.
5호 비약적인 논리 μ „κ°œκ°€ 있으면 μ•ˆλœλ‹€.
- 제 3ν•­
이 외에 제 2μ‘° 1ν•­μ˜ 기쀀에 ν•΄λ‹Ήλ˜λŠ” μ œλ³΄λ”λΌλ„, λ…Όλž€μ˜ μ†Œμ§€κ°€ μ—†λ‹€κ³  νŒλ‹¨λ˜λŠ” λ²”μœ„ λ‚΄μ—μ„œ
λŒ€λ‚˜λ¬΄μˆ² ν™œμ„±ν™”λ₯Ό μœ„ν•΄ λŒ€μˆ²μ§€κΈ°μ˜ μž¬λŸ‰μœΌλ‘œ κ²Œμ‹œκΈ€μ΄ κ²Œμ‹œλ  수 μžˆλ‹€. 단, λ‹€μŒ 기쀀듀이 μ μš©λœλ‹€.
1호 홍보λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” κ²Œμ‹œκΈ€μΌ 경우, λ””μŠ€μ½”λ“œ λŒ€λ‚˜λ¬΄μˆ² μ„œλ²„λ₯Ό 톡해 λŒ€μˆ²μ§€κΈ°μ—κ²Œ 문의λ₯Ό 톡해 사전 ν—ˆκ°€λ₯Ό λ°›μ•„μ•Ό ν•œλ‹€.
2호 섀문쑰사λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” κ²Œμ‹œκΈ€μΌ 경우, λ””μŠ€μ½”λ“œ λŒ€λ‚˜λ¬΄μˆ² μ„œλ²„λ₯Ό 톡해 λŒ€μˆ²μ§€κΈ°μ—κ²Œ 문의λ₯Ό 톡해 사전 ν—ˆκ°€λ₯Ό λ°›μ•„μ•Ό ν•œλ‹€.
제 3μ‘° μ‹ κ³ λœ κ²Œμ‹œλ¬Όμ— κ΄€ν•œ κ·œμΉ™
- 제 1ν•­
μ‹ κ³  μ‚¬μœ μ— 따라 λ‹€μŒ κ·œμΉ™λ“€μ— 해당이 되며, 사싀일 경우 μ‚­μ œλœλ‹€.
1호 μ‹€λͺ…μœΌλ‘œμ¨, μ–ΈκΈ‰λœ 본인이 μ‚­μ œμš”μ²­μ„ ν•˜μ˜€μ„ 경우
2호 κ²Œμ‹œλ¬Ό κ²Œμ‹œ κ·œμΉ™μ— μ–΄κΈ‹λ‚œ κ²Œμ‹œλ¬Όμ— λŒ€ν•œ μ‚­μ œμš”μ²­μΌ 경우
- 제 2ν•­
μ‹ κ³  μ‚¬μœ κ°€ λ‹€μŒκ³Ό 같은 경우일 λ•Œ, 기각 될 수 μžˆλ‹€.
1호 μ‹ κ³  μ‚¬μœ κ°€ 없을 λ•Œ
2호 제 3μ‘° 1항에 ν•΄λ‹Ήλ˜μ§€ μ•ŠμœΌλ©°, μ‹ κ³  μ‚¬μœ κ°€ λΆˆμΆ©λΆ„ν•  λ•Œ
3호 μ‹ κ³ μ‚¬μœ κ°€ ν•΄λ‹Ή μ•Œκ³ λ¦¬μ¦˜ λ‚΄μš©κ³Ό 상관이 없을 λ•Œ
제 4μ‘° νŠΉμ • 이슈둜 μΈν•œ 과열에 κ΄€ν•œ κ·œμΉ™
- 제 1ν•­
νŠΉμ • 이슈둜 λŒ€λ‚˜λ¬΄μˆ²μ΄ 과열이 λ˜λŠ” 쑰짐을 보일 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ 자체적인 νŒλ‹¨μ— 따라, ν•΄λ‹Ή μ£Όμ œμ— κ΄€ν•œ 제보 μ—…λ‘œλ“œλ₯Ό 보λ₯˜ν•˜λŠ” μ‹œμŠ€ν…œμœΌλ‘œ, λŒ€μˆ²μ§€κΈ°μ˜ νŒλ‹¨ ν•˜μ— 곡지 없이 μ‹œν–‰λ  수 μžˆλ‹€.
ν•΄λ‹Ή μ΄μŠˆμ— κ΄€ν•œ 글듀은 일정 μ‹œκ°„μ΄ μ§€λ‚œ 이후에 ν•˜λ‚˜μ˜ κ²Œμ‹œκΈ€λ‘œ λ¬Άμ—¬ μ—…λ‘œλ“œ λœλ‹€.
`;
type Rule = subContentrule[];

export const bold15: string[] = [
"제 1μ‘° λͺ©μ ",
Expand All @@ -92,7 +36,7 @@ export const bold13: string[] = [
"- 제 4ν•­",
];

export const ruleForWeb: Object[] = [
export const ruleForWeb: Rule = [
{
_id: 1,
title: "제 1μ‘° λͺ©μ ",
Expand Down Expand Up @@ -192,7 +136,7 @@ export const ruleForWeb: Object[] = [
title: "2호",
content: "νŠΉμ • μΈλ¬Όμ΄λ‚˜ 단체λ₯Ό μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜λŠ” 경우",
description: ["단, μ‹€λͺ…이 κ±°λ‘ λ˜μ§€μ•ŠλŠ” 경우 λ˜ν•œ ν¬ν•¨ν•œλ‹€."],
subContents: [
subContent: [
{
_id: 1,
title: "1λͺ©",
Expand Down Expand Up @@ -347,3 +291,75 @@ export const ruleForWeb: Object[] = [
],
},
];

export const rules = `
제 1μ‘° λͺ©μ 
λ³Έ κ·œμΉ™μ€ κ΄‘μ£Όμ†Œν”„νŠΈμ›¨μ–΄λ§ˆμ΄μŠ€ν„°κ³ λ“±ν•™κ΅ λŒ€λ‚˜λ¬΄μˆ² κ·œμΉ™μœΌλ‘œ, λŒ€λ‚˜λ¬΄μˆ²μ˜ 투λͺ…ν•œ 운영 및 읡λͺ…μ„± 보μž₯을 λͺ©μ μœΌλ‘œ ν•œλ‹€.
제 2μ‘° κ²Œμ‹œκΈ€ κ²Œμ‹œμ— κ΄€ν•œ κ·œμΉ™
- 제 1ν•­
λ‹€μŒκ³Ό 같은 κ²Œμ‹œλ¬Όμ˜ 경우 반렀 μ²˜λ¦¬κ°€ λ˜κ±°λ‚˜, μ‚­μ œκ°€ 될 수 μžˆλ‹€.
1호 λ‹€λ₯Έ μ‚¬μš©μžμ—κ²Œ λΆˆνŽΈν•¨μ„ 쀄 수 μžˆλŠ” 경우
1λͺ© 홍보λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” 경우
- 맀우 개인적인 μ‚¬ν•­λ“€λ‘œ, μ•± μΆ”μ²œμΈμ΄λ‚˜ κ²Œμž„ μΆ”μ²œμΈ 같은 경우
- λ§Žμ€ μ‚¬λžŒλ“€μ—κ²Œ λΆˆνŽΈν•¨μ„ μ•ˆκ²¨μ£ΌλŠ” 홍보인 경우
2λͺ© 친λͺ©μ„ 닀지기 μœ„ν•œ κ²Œμ‹œκΈ€μΌ 경우
3λͺ© μš•μ„€ 및 비속어 λ˜λŠ” 외섀적인 λ‚΄μš©μ„ ν¬ν•¨ν•˜λŠ” 경우
λ‹€μŒκ³Ό 같은 κ²½μš°λŠ” μ΅œμš°μ„ μ μœΌλ‘œ λ°˜λ €λ˜κ±°λ‚˜ μ‚­μ œλ  수 μžˆλ‹€.
- μ‹€λͺ…μ˜ 일뢀 이상이 μ–ΈκΈ‰λœ 경우, ex : 였xx, x병x, 였x진, xx진
4λͺ© 곡격적인 μ–΄μ‘°λ‘œ μž‘μ„±ν•œ 경우
λ‹€μŒκ³Ό 같은 κ²½μš°λŠ” μ΅œμš°μ„ μ μœΌλ‘œ λ°˜λ €λ˜κ±°λ‚˜ μ‚­μ œλ  수 μžˆλ‹€.
- μ‹€λͺ…μ˜ 일뢀 이상이 μ–ΈκΈ‰λœ 경우, ex : 였xx, x병x, 였x진, xx진
5λͺ© 제보 반렀 μ‚¬μœ λ₯Ό λ¬»λŠ” κ²Œμ‹œκΈ€μΌ 경우
6λͺ© μ§€λ‚˜μΉ˜κ²Œ κΈΈκ±°λ‚˜ μ§€λ‚˜μΉ˜κ²Œ 짧은 경우
- λ‘νŽ˜μ΄μ§€ 이상 μž‘μ•„λ¨ΉλŠ” 경우
- ν•œλ¬Έμž₯도 μ™„μ„±μ‹œν‚€μ§€ λͺ»ν•˜λŠ” 경우
7λͺ© λ‚΄μš©μ΄ μ§€λ‚˜μΉ˜κ²Œ λΆ€μ‹€ν•  경우
8λͺ© 해석이 λΆˆκ°€λŠ₯ν•œ μ•Œκ³ λ¦¬μ¦˜μΌ 경우
9λͺ© 타 고등학ꡐ λ˜λŠ” 본ꡐλ₯Ό λΉ„λ°©, λΉ„λ‚œν•˜λŠ” 경우
- 이유 μ—†λŠ” λΉ„νŒ λ˜ν•œ 제재의 λŒ€μƒμ΄ 될 수 μžˆλ‹€.
10λͺ© μ •μΉ˜/쒅ꡐ λ“± λ…Όλž€μ„ λΆˆλŸ¬μΌμœΌν‚¬ 여지가 μžˆλŠ” 경우
2호 νŠΉμ • μΈλ¬Όμ΄λ‚˜ 단체λ₯Ό μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜λŠ” 경우
단, μ‹€λͺ…이 κ±°λ‘ λ˜μ§€μ•ŠλŠ” 경우 λ˜ν•œ ν¬ν•¨ν•œλ‹€.
1λͺ© μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜μ—¬ λΉ„λ°©ν•˜λŠ” 경우
2λͺ© μ§€μΉ­ν•˜κ±°λ‚˜ κ±°λ‘ ν•˜μ—¬ λ°˜λ³΅λ˜λŠ” κ²Œμ‹œκΈ€μ΄ μ˜¬λΌμ˜€λŠ” 경우
3호 거래, 섀문쑰사, λΆ„μ‹€λ¬Ό 회수 λ˜λŠ” ꡬ인/ꡬ직을 λͺ©μ μœΌλ‘œ ν•˜λŠ” 경우
4호 λΆ„λž€μ„ μ‘°μž₯ν•˜λŠ” 경우
5호 λŒ€μˆ²μ§€κΈ°μ˜ νŒλ‹¨ μ•„λž˜, 반절 μ΄μƒμ˜ λŒ€μˆ²μ§€κΈ°λ“€μ΄ λ¬Έμ œκ°€ μžˆλ‹€κ³  νŒλ‹¨ν•œ 경우
ν•΄λ‹Ή ν˜Έκ°€ ν•΄λ‹Ήλ˜λŠ” 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ νšŒμ˜λ‘μ„ κ³΅κ°œν•΄μ•Όν•œλ‹€.
- 제 2ν•­
제 2μ‘° 1ν•­ 2ν˜Έμ— ν•΄λ‹Ήν•˜λŠ” κ²Œμ‹œκΈ€μ΄ 곡읡을 λͺ©μ μœΌλ‘œ ν•˜λŠ” κ³ λ°œμ„± 제보일 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ 회의 μ•„λž˜ κ²Œμ‹œλ  수 μžˆλ‹€.
단 λ‹€μŒ 기쀀듀이 μ—„κ²©νžˆ μ μš©λœλ‹€.
1호 μ‹€λͺ… 거둠의 경우 μ΄ˆμ„±μ²˜λ¦¬λ‚˜ λΈ”λΌμΈλ“œ 처리둜 μˆ˜μ •λœλ‹€.
2호 μœ‘ν•˜μ›μΉ™μ— μ˜κ±°ν•˜μ—¬ μž‘μ„±λ˜μ–΄μžˆμ–΄μ•Ό ν•œλ‹€.
3호 μΆ”μΈ‘μ„± λ‚΄μš©μ΄ ν¬ν•¨λ˜μ–΄μžˆμœΌλ©΄ μ•ˆλœλ‹€.
4호 μ‚¬μ‹€λ§Œ ν¬ν•¨λ˜μ–΄ μžˆμ–΄μ•Ό ν•œλ‹€.
5호 비약적인 논리 μ „κ°œκ°€ 있으면 μ•ˆλœλ‹€.
- 제 3ν•­
이 외에 제 2μ‘° 1ν•­μ˜ 기쀀에 ν•΄λ‹Ήλ˜λŠ” μ œλ³΄λ”λΌλ„, λ…Όλž€μ˜ μ†Œμ§€κ°€ μ—†λ‹€κ³  νŒλ‹¨λ˜λŠ” λ²”μœ„ λ‚΄μ—μ„œ
λŒ€λ‚˜λ¬΄μˆ² ν™œμ„±ν™”λ₯Ό μœ„ν•΄ λŒ€μˆ²μ§€κΈ°μ˜ μž¬λŸ‰μœΌλ‘œ κ²Œμ‹œκΈ€μ΄ κ²Œμ‹œλ  수 μžˆλ‹€. 단, λ‹€μŒ 기쀀듀이 μ μš©λœλ‹€.
1호 홍보λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” κ²Œμ‹œκΈ€μΌ 경우, λ””μŠ€μ½”λ“œ λŒ€λ‚˜λ¬΄μˆ² μ„œλ²„λ₯Ό 톡해 λŒ€μˆ²μ§€κΈ°μ—κ²Œ 문의λ₯Ό 톡해 사전 ν—ˆκ°€λ₯Ό λ°›μ•„μ•Ό ν•œλ‹€.
2호 섀문쑰사λ₯Ό λͺ©μ μœΌλ‘œ ν•˜λŠ” κ²Œμ‹œκΈ€μΌ 경우, λ””μŠ€μ½”λ“œ λŒ€λ‚˜λ¬΄μˆ² μ„œλ²„λ₯Ό 톡해 λŒ€μˆ²μ§€κΈ°μ—κ²Œ 문의λ₯Ό 톡해 사전 ν—ˆκ°€λ₯Ό λ°›μ•„μ•Ό ν•œλ‹€.
제 3μ‘° μ‹ κ³ λœ κ²Œμ‹œλ¬Όμ— κ΄€ν•œ κ·œμΉ™
- 제 1ν•­
μ‹ κ³  μ‚¬μœ μ— 따라 λ‹€μŒ κ·œμΉ™λ“€μ— 해당이 되며, 사싀일 경우 μ‚­μ œλœλ‹€.
1호 μ‹€λͺ…μœΌλ‘œμ¨, μ–ΈκΈ‰λœ 본인이 μ‚­μ œμš”μ²­μ„ ν•˜μ˜€μ„ 경우
2호 κ²Œμ‹œλ¬Ό κ²Œμ‹œ κ·œμΉ™μ— μ–΄κΈ‹λ‚œ κ²Œμ‹œλ¬Όμ— λŒ€ν•œ μ‚­μ œμš”μ²­μΌ 경우
- 제 2ν•­
μ‹ κ³  μ‚¬μœ κ°€ λ‹€μŒκ³Ό 같은 경우일 λ•Œ, 기각 될 수 μžˆλ‹€.
1호 μ‹ κ³  μ‚¬μœ κ°€ 없을 λ•Œ
2호 제 3μ‘° 1항에 ν•΄λ‹Ήλ˜μ§€ μ•ŠμœΌλ©°, μ‹ κ³  μ‚¬μœ κ°€ λΆˆμΆ©λΆ„ν•  λ•Œ
3호 μ‹ κ³ μ‚¬μœ κ°€ ν•΄λ‹Ή μ•Œκ³ λ¦¬μ¦˜ λ‚΄μš©κ³Ό 상관이 없을 λ•Œ
제 4μ‘° νŠΉμ • 이슈둜 μΈν•œ 과열에 κ΄€ν•œ κ·œμΉ™
- 제 1ν•­
νŠΉμ • 이슈둜 λŒ€λ‚˜λ¬΄μˆ²μ΄ 과열이 λ˜λŠ” 쑰짐을 보일 경우, λŒ€μˆ²μ§€κΈ°λ“€μ˜ 자체적인 νŒλ‹¨μ— 따라, ν•΄λ‹Ή μ£Όμ œμ— κ΄€ν•œ 제보 μ—…λ‘œλ“œλ₯Ό 보λ₯˜ν•˜λŠ” μ‹œμŠ€ν…œμœΌλ‘œ, λŒ€μˆ²μ§€κΈ°μ˜ νŒλ‹¨ ν•˜μ— 곡지 없이 μ‹œν–‰λ  수 μžˆλ‹€.
ν•΄λ‹Ή μ΄μŠˆμ— κ΄€ν•œ 글듀은 일정 μ‹œκ°„μ΄ μ§€λ‚œ 이후에 ν•˜λ‚˜μ˜ κ²Œμ‹œκΈ€λ‘œ λ¬Άμ—¬ μ—…λ‘œλ“œ λœλ‹€.
`;
2 changes: 1 addition & 1 deletion src/middleware/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class AuthMiddleware {
const answer = body.verify?.answer;

if (!(verifyId && answer)) {
createErrorRes({ errorCode: "JL003" });
return createErrorRes({ errorCode: "JL003" });
}

return (await checkQuestionAnswer(verifyId, answer, req.connectionName))
Expand Down
40 changes: 23 additions & 17 deletions src/repository/algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ export class AlgorithmRepository extends Repository<Algorithm> {
"algorithm.createdAt",
"algorithm.reason",
])
.leftJoinAndSelect("algorithm.emojis", "emoji")
.where("algorithm.algorithmStatus = :status1", {
status1: status,
});
.leftJoinAndSelect("algorithm.emojis", "emoji");
return status === "ACCEPTED"
? base.orWhere("algorithm.algorithmStatus = :status2", {
status2: "REPORTED",
})
: base;
? base
.where("(algorithm.algorithmStatus = :status1 ", {
status1: status,
})
.orWhere("algorithm.algorithmStatus = :status2 )", {
status2: "REPORTED",
})
: base.where("algorithm.algorithmStatus = :status1", {
status1: status,
});
}
getList(
{ count, criteria, status }: JoinAlgorithmDTO,
Expand All @@ -71,7 +74,7 @@ export class AlgorithmRepository extends Repository<Algorithm> {
cursor: (base: SelectQueryBuilder<Algorithm>, criteria: number) => {
return criteria === 0
? base
: base.andWhere("algorithm.algorithmNumber <= :criteria", {
: base.andWhere("algorithm.algorithmNumber < :criteria", {
criteria,
});
},
Expand Down Expand Up @@ -143,15 +146,18 @@ export class AlgorithmRepository extends Repository<Algorithm> {
.andWhere(
"algorithm.algorithmNumber between :lastNumber and :firstNumber",
{ lastNumber, firstNumber },
)
.andWhere("algorithm.algorithmStatus = :status", { status });
);

const query =
status === "ACCEPTED"
? baseQuery.orWhere("algorithm.algorithmStatus = :orStatus", {
orStatus: "REPORTED",
})
: baseQuery;
const statusWhereQuery =
"(algorithm.algorithmStatus = :status" +
(status === "ACCEPTED"
? " OR algorithm.algorithmStatus = :orStatus)"
: ")");

const query = baseQuery.andWhere(statusWhereQuery, {
status,
orStatus: "REPORTED",
});
return query.orderBy("algorithmNumber", "DESC").getMany();
}

Expand Down
23 changes: 20 additions & 3 deletions src/router/algorithm/algorithm.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { Algorithm } from "../../entity";

import { AlgorithmRepository } from "../../repository/algorithm";

import { getAlgorithmList } from "../../util/algorithm";
import {
generateAlgorithmListResponse,
getAlgorithmList,
} from "../../util/algorithm";
import { createErrorRes, createRes } from "../../util/http";
import { isNumeric } from "../../util/number";
import {
Expand Down Expand Up @@ -75,8 +78,15 @@ export const AlgorithmService: { [k: string]: Function } = {
type,
);

const data = generateAlgorithmListResponse({
algorithmList: result,
status: STATUS,
count,
type,
});

return createRes({
data: { data: result, status: STATUS },
data,
});
},
getAlgorithmListByAdmin: async (event: APIGatewayEventIncludeDBName) => {
Expand All @@ -102,8 +112,15 @@ export const AlgorithmService: { [k: string]: Function } = {
sub,
type,
);
const data = generateAlgorithmListResponse({
algorithmList: result,
status: STATUS,
count,
type,
});

return createRes({
data: { data: result, status: STATUS },
data,
});
},

Expand Down
6 changes: 3 additions & 3 deletions src/router/emoji/emoji.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export const EmojiService: { [k: string]: Function } = {

const preResult = (
await emojiRepo.find({
where: { user: subId, algorithm: number },
where: { user: subId, algorithm: { idx: number } },
})
)[0];

if (!preResult) {
return createErrorRes({ errorCode: "JL012" });
if (!!preResult) {
return createErrorRes({ errorCode: "JL013" });
}

const result = await emojiRepo.addLeaf(subId, number);
Expand Down
27 changes: 26 additions & 1 deletion src/util/algorithm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import { getCustomRepository } from "typeorm";
import { JoinAlgorithmDTO } from "../DTO/algorithm.dto";
import {
AlgorithmListType,
AlgorithmStatusType,
JoinAlgorithmDTO,
} from "../DTO/algorithm.dto";
import { Algorithm } from "../entity";
import { AlgorithmRepository } from "../repository/algorithm";

export const generateAlgorithmListResponse: Function = ({
algorithmList,
status,
count,
type,
}: {
algorithmList: Algorithm[];
status: AlgorithmStatusType;
count: number;
type: AlgorithmListType;
}) =>
Object.assign(
{},
{ data: algorithmList, status },
type == "cursor"
? {
hasNext: algorithmList.length == Number(count),
nextCursor: algorithmList[algorithmList.length - 1].algorithmNumber,
}
: {},
);
export const algorithmListMergeEmojiList: Function = (
algorithmList: Algorithm[],
isClickedByUser: Algorithm[],
Expand Down
1 change: 1 addition & 0 deletions src/util/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const ERROR_CODE_LIST = {
JL010: "ν—ˆμš©λ˜μ§€μ•Šμ€ κ°’μž…λ‹ˆλ‹€.",
JL011: "λΉ„λ°€λ²ˆν˜Έ λ˜λŠ” μœ μ € 인증에 μ‹€νŒ¨ν•˜μ˜€μŠ΅λ‹ˆλ‹€.",
JL012: "ν•΄λ‹Ή μ•Œκ³ λ¦¬μ¦˜μ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.",
JL013: "이미 λˆŒλŸ¬μ§„ 이λͺ¨μ§€μž…λ‹ˆλ‹€.",
} as const;

export type ErrorCodeType = keyof typeof ERROR_CODE_LIST;
Expand Down

0 comments on commit c534452

Please sign in to comment.