leeminjoo / write-me Goto Github PK
View Code? Open in Web Editor NEW오늘의 뉴스 키워드를 뽑아 매일 글감을 주는 웹블로그
오늘의 뉴스 키워드를 뽑아 매일 글감을 주는 웹블로그
키워드 - keywordName, keywordID, date, categoryID
힌트 - keywordID, hintID, hintName
포스트 - postID, postTitle, postDetail, userID, keywordID, categoryID, date, time, likeID,
좋아요 - postID, userID
유저 - userID, userPW, userName
카테고리를 인풋으로 주면 네이버 뉴스에서 많이 본 뉴스 30개 읽어오기
model 에서 나오느 키워드 바로 DB에 저장
창이 띄어져있지 않고 백엔드에서 실행
[GET] /api/posts/hint?keywordID={keywordID}
CORS 문제 해결해야 함
hintID - auto increment로
[GET] /api/posts/distinctKeyword?categoryID={categoryID}
여전히 중복된 키워드를 가져옴
각 카테고리별 주요키워드 3,4개 보여줄 예정
회원가입
[POST]/api/register/local
{
"username": "javainuse1",
"password": "password1"
}
로그인
[POST]/api/authenticate
{
"username": "javainuse1",
"password": "password1"
}
헤더 jwt 토큰으로부터 username 받아오기
[GET]/api/auth/me
[POST]/api/authenticate
에서 생성된 토큰을 헤더에 넣어 보내면 username 리턴(postman 에서는 authorization 탭에 토큰 넣으면 헤더에 자동으로 입력됨)
카테고리별 키워드 불러오기(중복 제거 없음)
[GET]/api/posts/keyword?categoryID={categoryID}
ex. http://localhost:8080/api/posts/keyword?categoryID=3 으로 api GET 했을 경우 결과
{
"keywordID": 17,
"categoryID": 3,
"keywordName": "할머니",
"date": "2020-05-19T00:00:00.000+0000",
"time": "pm"
} ...
카테고리별 키워드 불러오기(중복 제거된 키워드 리스트)
[GET]/api/posts/distinctKeyword?categoryID={categoryID}
keywordName별 키워드 불러오기
[GET]/api/posts/keyowrdName?keywordName={keywordName}
글 작성
postID는 auto_increment
[POST]/api/post
{
"postID": 4,
"postTitle": "테스트",
"postDetail": "테스트입니다",
"username": "test1",
"keywordID": 3,
"categoryID": 5,
"date": "2020-05-20T15:00:00.000+0000"
}
postID별 작성내용 조회
[GET]/api/post/{postID}
ex. http://localhost:8080/api/post/3
{
"postID": 3,
"postTitle": "edit",
"postDetail": "editing",
"username": "test1",
"keywordID": 3,
"categoryID": 5,
"date": "2020-05-20T00:00:00.000+0000"
}
username별 작성내용 조회
[GET]/api/post/user?username={username}
keywordID별 작성내용 조회
[GET]/api/post?keywordID={keywordID}
keywordName별 작성내용 조회
[GET]/api/post/keywordName?keywordName={keywordName}&categoryID={categoryID}
ex. 카테고리id 3 중 '코로나' 키워드로 작성된 글 GET
http://localhost:8080/api/post/keywordName?keywordName=코로나&categoryID=3
{
"postID": 2410211,
"postTitle": "[속보]강남대성학원 코로나19 확진자 발생…영통구 거주 조리보조원",
"postDetail": " [경향신문] 강남대성학원(송파) 급식실에서 근무하는 조리보조원(20대 남성)이 9일 코로나19 확진판정을 받았다.이 남성은 발열 등의 증상이 나타나지 않아 학원에 비치한 열화상기를 통과할 수 있었고, 지난 5일간 급식실에서 근무한 것으로 현재까지 파악되고 있다.수원시 영통구 영통3동에 거주하고 있는 이 남성은 지난달 30일 양천구 목동 탁구클럽에 방문한 이후 지난 3일 근육통과 어지러움을 느꼈지만 별도의 코로나19 검체검사를 받지 않고 8일까지 급식실에서 근무한 것으로 알려졌다. 그러나 이상함을 느낀 남성은 학원의 지시로 8일 오후 2시 귀가한 후 3시 구급차를 이용해 영통구 보건소 선별진료소를 방문해 검사를 받아 다음날인 9일 오전 10시 44분 양성판정을 받았다. 남성은 현재 경기도의료원 수원병원에 격리입원될 예정이다. 5층 규모에 1000여 명의 학생이 재원하고 있는 강남대성학원(송파)는 현재 급식실을 폐쇄하고 수업을 중단한 상태다.류인하 기자 [email protected]▶ 장도리 | 그림마당 보기▶ 경향신문 바로가기▶ 경향신문 구독신청하기©경향신문(www.khan.co.kr), 무단전재 및 재배포 금지 ",
"username": "test1",
"keywordID": 11,
"categoryID": 3,
"date": "2020-06-09T00:00:00.000+0000",
"keywordName": null
}
POST 테이블의 내용만 가져오므로 keywordName은 null
작성 내용 수정
[PUT]/api/post/edit/{postID}
글 삭제
[DELETE]api/post/delete/{postID}
[GET] /api/posts/hint?keywordID={keywordID}
회원가입/로그인
모든 서비스는 로그인이 되어있어야 접근 가능
로그인이 안 되어있으면 로그인 페이지로 넘어감
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.