Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/5d-jh/school-menu-api

🏫 학ꡐ API - μ΄ˆΒ·μ€‘Β·κ³ λ“±ν•™κ΅ 식단 및 학ꡐ정보 μ‰½κ²Œ 뢈러였기
https://github.com/5d-jh/school-menu-api

firebase-functions monorepo nodejs rest-api school-api

Last synced: 7 days ago
JSON representation

🏫 학ꡐ API - μ΄ˆΒ·μ€‘Β·κ³ λ“±ν•™κ΅ 식단 및 학ꡐ정보 μ‰½κ²Œ 뢈러였기

Awesome Lists containing this project

README

        

# 학ꡐ식단 API
**[학ꡐ식단 API, 학ꡐ정보 APIλŠ” 2023λ…„ 8μ›” 1μΌλΆ€λ‘œ μ’…λ£Œλ©λ‹ˆλ‹€.
](https://github.com/5d-jh/school-menu-api/issues/216)**
## κ°œμš” 및 νŠΉμ§•
**λ”μš± μ •ν™•ν•œ 정보λ₯Ό 보μž₯ν•˜λŠ” [λ‚˜μ΄μŠ€ κ΅μœ‘μ •λ³΄ κ°œλ°©ν¬ν„Έ](https://open.neis.go.kr/portal/mainPage.do) μ‚¬μš©μ„ ꢌμž₯ν•©λ‹ˆλ‹€.**

[HTTP GET μš”μ²­](https://opentutorials.org/course/3385/21674)을 톡해 학ꡐ 식단을 [JSON](https://opentutorials.org/course/1375/6844)으둜 λ°›μ•„ μ–΄λ–€ ν”Œλž«νΌμ—μ„œλ“  μ‰½κ²Œ 뢈러올 수 μžˆμŠ΅λ‹ˆλ‹€.
[school-api](https://github.com/agemor/school-api) ν”„λ‘œμ νŠΈκ°€ μ œμž‘μ— 큰 도움이 λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

식단을 ν•œ 번 이상 μš”μ²­ μ‹œ μš”μ²­ν•œ 학ꡐ, λ…„, μ›”λ³„λ‘œ 식단이 μ„œλ²„μ— μ €μž₯λ˜μ–΄ 응닡 속도가 λŒ€ν­ κ°œμ„ λ©λ‹ˆλ‹€.

μ΄ˆλ“±ν•™κ΅, 쀑학ꡐ, 고등학ꡐλ₯Ό μ§€μ›ν•©λ‹ˆλ‹€.

## 학ꡐ μœ ν˜•
* μ΄ˆλ“±ν•™κ΅: `elementary`
* 쀑학ꡐ: `middle`
* 고등학ꡐ: `high`

## 학ꡐ μ½”λ“œ
[μ—¬κΈ°](https://school-api.xyz/code/app)μ—μ„œ 학ꡐ μ½”λ“œλ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

## 식단 뢈러였기
`https://school-api.xyz/api/[ν•™κ΅μœ ν˜•]/[ν•™κ΅μ½”λ“œ]`둜 ν˜„μž¬ λ‹¬μ˜ 식단을 뢈러올 수 μžˆμŠ΅λ‹ˆλ‹€. 응닡 λ°μ΄ν„°λŠ” JSON μž…λ‹ˆλ‹€.

### λ§€κ°œλ³€μˆ˜(선택사항)
λ‹€μŒκ³Ό 같이 μ£Όμ†Œ 끝에 λ³€μˆ˜λͺ…κ³Ό 값을 적어 μ‚¬μš©ν•©λ‹ˆλ‹€.

https://school-api.xyz/api/[ν•™κ΅μœ ν˜•]/[ν•™κ΅μ½”λ“œ]?[λ³€μˆ˜λͺ…1]=[κ°’1]&[λ³€μˆ˜λͺ…2]=[κ°’2]

| λ³€μˆ˜λͺ… | μ„€λͺ… | κΈ°λ³Έκ°’ |
| :------: | ------ | ------ |
| year | νŠΉμ •ν•œ 년도λ₯Ό μ§€μ •ν•˜μ—¬ ν•΄λ‹Ή 년도에 ν•΄λ‹Ήν•˜λŠ” 식단을 λΆˆλŸ¬μ˜΅λ‹ˆλ‹€. | ν˜„μž¬ λ‚ μ§œμ˜ 연도 |
| month | νŠΉμ •ν•œ 달을 μ§€μ •ν•˜μ—¬ ν•΄λ‹Ή 달에 ν•΄λ‹Ήν•˜λŠ” 식단을 λΆˆλŸ¬μ˜΅λ‹ˆλ‹€. | ν˜„μž¬ λ‚ μ§œμ˜ μ›” |
| date | νŠΉμ •ν•œ 일을 μ§€μ •ν•˜μ—¬ ν•΄λ‹Ή λ‚ μ§œμ— ν•΄λ‹Ήν•˜λŠ” 식단을 λΆˆλŸ¬μ˜΅λ‹ˆλ‹€. | ν˜„μž¬ λ‚ μ§œμ˜ 일 |
| allergy | `hidden`으둜 μ„€μ •ν•˜λ©΄ μ•Œλ ˆλ₯΄κΈ° 정보가 ν‘œμ‹œλ˜μ§€ μ•ŠμœΌλ©°, `formed`둜 μ„€μ •ν•˜λ©΄ 정보가 κ΅¬μ‘°ν™”λ˜μ–΄ ν‘œμ‹œλ©λ‹ˆλ‹€. | μ—†μŒ |

## μ˜ˆμ‹œ
> Node.js
```javascript
const request = require('request');

const url = 'https://school-api.xyz/api/high/X123456789?date=23';
request(url, (err, res, body) => {
var json = JSON.parse(body);
console.log(json);
});
```
> Python
```python
import requests
import json

url = 'https://school-api.xyz/api/middle/X123456789?year=2018&month=5'
response = requests.get(url)
school_menu = json.loads(response.text)
print(school_menu)
```

### 응닡
```
{
menu: [
...,
{
date:"5",
breakfast:["μ°ΉμŒ€λ°₯","홍합미역ꡭ5.6.","λ‹­κ°ˆλΉ„5.6.13.","김ꡬ이13.","λ°°μΆ”κΉ€μΉ˜9.13.","λ°©μšΈν† λ§ˆν† 12."],
lunch:["흑미λ°₯","μ½©λ‚˜λ¬Όκ΅­5.13.","λΌμ§€λ“±λΌˆκΉ€μΉ˜μ°œ9.10.13.","도토리묡무침5.6.13.","μ΄κ°κΉ€μΉ˜9.13.","청포도"],
dinner:["μ°ΉμŒ€λ°₯","μ˜€μ§•μ–΄μ§¬λ½•κ΅­5.6.","λ°°μΆ”κ²‰μ ˆμ΄13.","포도μ₯¬μŠ€5.13.","λ§Œλ‘μ˜€κΌ¬λ…Έλ―Έμ•ΌλΌ1.5.6.10.12.13."]
},
...
],
server_message: ["foo", "bar", ...]
}
```

## 기타 사항
### 직접 λΉŒλ“œ 및 λ°°ν¬ν•˜κΈ°
쀀비사항
* Node.js 16
* Firebase CLI
* Firebase Consoleμ—μ„œ μƒμ„±ν•œ ν”„λ‘œμ νŠΈ

ν”„λ‘œμ νŠΈ λ£¨νŠΈμ— μœ„μΉ˜ν•œ `.firebaserc` νŒŒμΌμ—μ„œ firebase project idλ₯Ό μˆ˜μ •ν•œ ν›„, λ‹€μŒκ³Ό 같이 λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•˜λ©΄ 배포할 수 μžˆμŠ΅λ‹ˆλ‹€.
```sh
firebase deploy
```

### μ €μž‘κΆŒ
ν•΄λ‹Ή ν”„λ‘œμ νŠΈλŠ” MIT λΌμ΄μ„ μŠ€ ν•˜μ— 배포되며, μˆ˜μ •, 볡제, 2μ°¨ μ°½μž‘, 영리적 μ‚¬μš©, λ‹€λ₯Έ λΌμ΄μ„ μŠ€ ν•˜μ— 재배포 등이 κ°€λŠ₯ν•©λ‹ˆλ‹€. λ‹€λ§Œ ν•΄λ‹Ή ν”„λ‘œμ νŠΈμ™€ κ΄€λ ¨λœ 피해에 λŒ€ν•΄ μ±…μž„μ§€μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.