전체 글
-
FLASK 프레임워크 만들기학원 프로젝트 2023. 5. 30. 11:08
1. 개요 간호사 업무 해소 환자 위치 찾기 프로젝트를 제작하던 도중, raspberry를 적극적으로 활용하자는 이야기가 나와서 기존에 eclipse로 제작하던 프로젝트를 FLASK형태로 다시 만들었다. 결과적으로는 다시 eclipse로 돌아가긴 했지만, FLASK 형태로 프로젝트를 만들고 DB와 연동하고 pythonanywhere로 배포하는 경험을 했다. 2. 프레임워크 형태 FLASK에서 주의할 점은 static 폴더와 templates 폴더이다. css, js, img같은 정적 resources들을 이용하려면 static 폴더에 꼭 들어가 있어야하고 html파일은 templates 폴더에 위치해야 한다. 또한, 서버를 시작하는 메인 python 파일이 필요하다. 이번 프로젝트에서는 app.py로 지..
-
간호사 업무 해소 환자 위치 찾기 프로젝트 (3. KakaoMap API 활용 )학원 프로젝트 2023. 5. 30. 10:36
1. 개요 Geo Location API로 얻은 환자의 위치 정보 데이터를 병원 측에서 눈으로 확인할 수 있게 지도에 나타내고 싶었다. 그 중 Kakao Map을 이용했다. 2. Kakao Map API 2 - 1 인증하기 카카오 맵을 이용하려면, 카카오 개발자에 로그인하고 애플리캐이션 추가 해야한다. 애플리캐이션을 추가하면 네이티브 앱 키, REST API 키 , JAVA SCRIPT 키 , Admin 키를 얻을 수 있고 이용하고자 하는 플랫폼 탭에 들어가서 사이트 도메인을 꼭 등록해야한다. 2 - 2 구현 모습 환자가 현재 지도 화면 밖에 위치하고 있다면 추적할 수 있는 트래커를 이용했고, 1000ms 마다 현재 위치 정보를 업데이트하도록 만들었다. 왼쪽의 환자 리스트에서 특정 환자를 클릭하면 그 환..
-
간호사 업무 해소 환자 위치 찾기 프로젝트 (2. 공공데이터 활용 )학원 프로젝트 2023. 5. 30. 10:25
1. 개요 사용자가 병원의 이름을 입력 했을 때, 해당 키워드가 포함된 병원의 리스트와 병원의 위치 데이터를 활용하고 싶었다. 2. 공공데이터 이용하기 이용하려고 하는 공공데이터에는 약 78000개의 병원 데이터가 있었다. 이 병원들 중 사용자가 입력한 키워드가 병원 이름에 포함되어 있는 경우에, 배열에 저장하고 list로 나타내는 script를 작성했다. $.ajax({ type:'GET', dataType:'JSON', url:`${apiUrl}?ServiceKey=${serviceKey}&numOfRows=${numOfRows}&pageNo=1&sidoCd=${cityData}`, error: function(err){ console.log(err); }, success: function(data)..
-
간호사 업무 해소 환자 위치 찾기 프로젝트 (1. Geolacation API )학원 프로젝트 2023. 5. 26. 13:50
1. 프로젝트 개요 학원에서 2번째 과제로 라즈베리파이를 이용한 간호사 업무 해소 기능을 만들기로 했다. 환자의 위치를 추적할 수 있으면, 간호사가 환자를 찾는 수고를 덜 수 있고 코로나 바이러스 처럼 전염 위험이 높은 병을 가진 환자를 관리할 수 있을 것이다. 결론부터 말하자면 라즈베리 파이의 GPS와 블루투스 이용하는 것이 잘 되지 않았고 라즈베리 파이를 적극적으로 활용하기 위해 flask 프레임워크를 제작하고 pythonanywhere에서 실행하고 싶었는데 이 부분에도 많은 문제가 발생했다. eclipse의 spring legacy project로 Geolocation API와 Kakao Map API를 사용해서 환자의 위치를 실시간으로 확인할 수 있는 기능을 만들었다. 이 글에서 eclipse로 ..
-
반응형 웹 레이아웃 만들기기타 2023. 5. 15. 22:31
반응형 웹 화면을 만들기 위해 bootstrap을 사용했지만, js 로 작성된 css 부분이 많아서 원하는 방향으로 css 를 작성하기 어려웠다. 그래서, 반응형 웹을 직접 만들기로 했고, 우선은 반응형 웹을 이해하기 위해 레이아웃을 먼저 작성했다 데스크탑에서 이용할 때 두 개의 요소가 가로로 배치된다. 모바일에서 이용할 때 모바일에서 볼 때는, flex로 배치되어 있던 요소들이 세로로 나타난다 #contentsWrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } @media only screen and (min-width: 768px) { #contentsWrap..
-
API 키 숨기기 ( Spring Legacy 에서 properties 이용하기 )Spring 2023. 5. 14. 22:23
API key나 아이디 , 비밀번호 같이 프로젝트를 하다보면 숨겨야할 정보들이 있다. 이번에는 spring legacy project에서 해당 정보들을 .properties 파일에 저장해서 사용하고, 깃허브에는 .properties 파일을 gitignore 파일에 추가해서 개인정보가 유출되지 않도록 할 것이다. 먼저, src/main/resources 경로에 .properties 파일을 생성하자 src/main/resources 경로는 classpath 라고도 한다. root-context , servlet-context 설정 root-context와 servlet-context에 PropertyPlaceholderConfigurer 를 사용할 수 있도록 Bean을 설정한다 사용하기 원하는 propert..
-
gitignore 생성 ( spring legacy )Spring 2023. 5. 14. 18:03
지난번 팀 프로젝트 때, gitignore 파일을 생성하지 않아서 팀원들이 commit 할 때 pom.properties이 저장소에 저장되는 바람에 version이 맞지 않아 골치아픈 경우가 생겼었다. 이번에는 spring legacy project를 생성하고 pom.properties 파일을 gitignore 파일에 추가해서 이런 불상사를 막아보자. 방법 생성한 프로젝트를 git 저장소와 연동하면, team 탭이 활성화 되고, 무시하고자 하는 파일을 다음과 같이 눌러서 지정하면 된다. 다음의 경로에 gitignore이 자동으로 생성되고, 무시할 파일의 이름이 추가되어 있다. 이제는 pom.properties 파일을 추가하고 commit 해도 자동으로 무시할 것이다. ** 이미 git에 올라가 있는 파일..