{"id":21906257,"url":"https://github.com/alfex4936/rust-server","last_synced_at":"2025-04-15T23:53:33.205Z","repository":{"id":151852395,"uuid":"384458810","full_name":"Alfex4936/Rust-Server","owner":"Alfex4936","description":"Frontend + Backend + 카카오톡 아주대 챗봇 in Rust language","archived":false,"fork":false,"pushed_at":"2023-07-18T04:39:15.000Z","size":20806,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T03:04:14.113Z","etag":null,"topics":["chatbot","kakako-chatbot","kakao","mysql","rest","rest-api","rust","sql","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alfex4936.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T14:16:56.000Z","updated_at":"2024-08-16T02:45:38.000Z","dependencies_parsed_at":"2024-11-28T16:54:09.759Z","dependency_job_id":null,"html_url":"https://github.com/Alfex4936/Rust-Server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfex4936%2FRust-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfex4936%2FRust-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfex4936%2FRust-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfex4936%2FRust-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alfex4936","download_url":"https://codeload.github.com/Alfex4936/Rust-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","kakako-chatbot","kakao","mysql","rest","rest-api","rust","sql","web"],"created_at":"2024-11-28T16:43:15.365Z","updated_at":"2025-04-15T23:53:33.199Z","avatar_url":"https://github.com/Alfex4936.png","language":"Rust","readme":"# Rocket + MySQL + HTML\r\n\r\n카카오톡 챗봇 + Backend + Frontend 프로젝트 in Rust\r\n\r\n# Structure\r\n\r\n[chatbot/](https://github.com/Alfex4936/Rust-Server/tree/main/chatbot) : 카카오 챗봇 (actix)\r\n\r\n[src/routes/](https://github.com/Alfex4936/Rust-Server/tree/main/src/routes) : endpoints\r\n\r\ntests/ : unittest\r\n\r\n# Endpoints\r\n\r\n## TODO\r\n카카오 챗봇 JSON 로컬에서 미리보는 사이트\r\n\r\n어떠한 방식으로? 1번 구현 후 2번 버전 시도가 나을 듯\r\n\r\n1. 자신의 JSON 데이터를 복사해서 입력하면 그걸 메시지로 변환 시키는 방식\r\n\r\n(여기서 발화 메시지는 json 해석 후 알맞는 형태로)\r\n\r\n(Rust로 메시지 Deserialize 하고 형식에 맞는 HTML 코드 GET return?)\r\n\r\n2. 사이트 자체를 local에 받게한 후 실행 후 POST 방식\r\n\r\n![gif](https://user-images.githubusercontent.com/2356749/126978633-1df88884-14cd-4ec1-9211-45d69e5e1468.gif)\r\n\r\n## GET `/front/\u003cnums\u003e`\r\n프론트 엔드 테스트\r\n\r\n숫자에 맞게 공지사항을 파싱해서 HTML에 전달\r\n\r\n![error](https://user-images.githubusercontent.com/2356749/125958043-89964bf4-e2e8-408c-8978-7a4321a781e9.png)\r\n![error](https://user-images.githubusercontent.com/2356749/126478657-ce2553e1-111a-4e6c-bd84-e3eac74cbf15.png)\r\n\r\n## GET `/db`\r\nMySQL 연동 테스트\r\n```json\r\n[\r\n    {\r\n        \"id\": 1,\r\n        \"start_date\": \"07.06 (화)\",\r\n        \"end_date\": \"07.09 (금)\",\r\n        \"content\": \"내용\"\r\n    },\r\n]\r\n```\r\n\r\n## POST `/notice`\r\nHTML 파싱\r\n```json\r\n[\r\n    {\r\n        \"id\": 13727,\r\n        \"title\": \"제목\",\r\n        \"date\": \"21.07.15\",\r\n        \"link\": \"링크\",\r\n        \"writer\": \"글쓴이\"\r\n    },\r\n]\r\n```\r\n\r\n## POST `/yesterday`\r\n```sql\r\nSELECT * FROM notices WHERE date = ? ORDER BY id DESC\r\n```\r\n=\u003e query\r\n```json\r\n[\r\n    {\r\n        \"id\": 11111,\r\n        \"title\": \"제목1\",\r\n        \"date\": \"21.07.15\",\r\n        \"link\": \"링크1\",\r\n        \"writer\": \"글쓴이1\"\r\n    },\r\n    {\r\n        \"id\": 11110,\r\n        \"title\": \"제목2\",\r\n        \"date\": \"21.07.15\",\r\n        \"link\": \"링크2\",\r\n        \"writer\": \"글쓴이2\"\r\n    },\r\n]\r\n```\r\n\r\n## 카카오 챗봇 `ListCard`\r\n```rust\r\n#[test]\r\nfn result_json() {\r\n    let mut result = Template::new();\r\n    result.add_qr(QuickReply::new(\r\n        \"message\".to_string(),\r\n        \"라벨\".to_string(),\r\n        \"메시지\".to_string(),\r\n    ));\r\n\r\n    let mut list_card = ListCard::new(\"title\".to_string());\r\n    list_card.add_button(Box::new(\r\n        CallButton::new(\"msg\".to_string()).set_number(\"010-1234-5678\".to_string()),\r\n    ));\r\n\r\n    list_card.add_button(Box::new(ShareButton::new(\"msg\".to_string())));\r\n\r\n    list_card.add_item(ListItem::new(\"제목\".to_string()).set_desc(\"설명\".to_string()));\r\n\r\n    result.add_output(json!(list_card));\r\n\r\n    println!(\"Result: {}\", serde_json::to_string(\u0026result).expect(\"Woah\"));\r\n}\r\n```\r\n=\u003e \r\n```yaml\r\n{\r\n    \"template\": {\r\n        \"outputs\": [\r\n            {\r\n                \"listCard\": {\r\n                    \"buttons\": [\r\n                        {\r\n                            \"action\": \"phone\",\r\n                            \"label\": \"msg\",\r\n                            \"phoneNumber\": \"010-1234-5678\"\r\n                        },\r\n                        {\r\n                            \"action\": \"share\",\r\n                            \"label\": \"msg\"\r\n                        }\r\n                    ],\r\n                    \"header\": {\r\n                        \"title\": \"title\"\r\n                    },\r\n                    \"items\": [\r\n                        {\r\n                            \"description\": \"설명\",\r\n                            \"title\": \"제목\"\r\n                        }\r\n                    ]\r\n                }\r\n            }\r\n        ],\r\n        \"quickReplies\": [\r\n            {\r\n                \"action\": \"message\",\r\n                \"label\": \"라벨\",\r\n                \"messageText\": \"메시지\"\r\n            }\r\n        ]\r\n    },\r\n    \"version\": \"2.0\"\r\n}\r\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfex4936%2Frust-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfex4936%2Frust-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfex4936%2Frust-server/lists"}