서버 IP |
13.124.57.45:80/api |
로컬 개발시 |
localhost:8081/api |
code 명 |
내용 |
1XX |
정보 제공 |
2XX |
성공 |
3XX |
Redirection |
4XX |
Cilent Error |
5XX |
Server Error |

{
Header:
{
Data Type: JSON,
Author: ~~,
},
Body:
{
Title: ~~,
Content: ~~,
}
}
API 명세서
⇒ 이전 프로젝트 양식
API 이름 |
Method |
요청값(예시) |
요청값(데이터타입) |
응답값 |
메모 |
토큰 필요 |
/login |
POST |
|
body = { loginId: String, |
|
|
|
loginPwd: String } |
{ success: Boolean |
|
|
|
|
|
code: Int, |
|
|
|
|
|
|
message: String |
|
|
|
|
|
|
accessToken : String |
|
|
|
|
|
|
} |
|
X |
|
|
|
|
/api/token |
POST |
|
|
{ |
|
|
accessToken : String |
|
|
|
|
|
|
} |
|
RefreshToken 필요(쿠키) |
|
|
|
|
/date/daily-sales |
GET |
2023-08-18 |
parameters = { date:String($date) } |
{ success: Boolean |
|
|
code: Int, |
|
|
|
|
|
|
message: String |
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
**diffSales: Int
previousSales: Int
thisSales: Int**
}
} | | O |
| /date/weekly-sales | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
diffSales: Int
previousSales: Int
thisSales: Int
}
} | | O |
| /date/monthly-sales | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
diffSales: Int
previousSales: Int
thisSales: Int
}
} | | O |
| /predict/daily | GET | 2023-08-18 | parameters = { date:String($date) } | { success: Boolean
code: Int,
message: String
data: {
prePredictRevenue: Long
nextPredictRevenue: Long
preRevenueList: List<Integer>
}
} | | O |
| /predict/weekly | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
prePredictRevenue: Long
nextPredictRevenue: Long
preRevenueList: List<Integer>
}
} | | O |
| /predict/monthly | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
prePredictRevenue: Long
nextPredictRevenue: Long
preRevenueList: List<Integer>
}
} | | O |
| /menu/daily-sales | GET | 2023-08-18 | parameters = { date:String($date) } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rank, menuName, totalRevenue, count, imageUrl}…]
}
} | Top3 | O |
| /menu/daily-sales/detail | GET | 2023-08-18 | parameters = { date:String($date) } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rankChange, isNew, rank, menuName, totalRevenue, count, imageUrl}…]
}
} | | O |
| /menu/weekly-sales | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rank, menuName, totalRevenue, count, imageUrl}…]
}
} | Top3 | O |
| /menu/weekly-sales/detail | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rankChange, isNew, rank, menuName, totalRevenue, count}…]
}
} | | O |
| /menu/monthly-sales | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rank, menuName, totalRevenue, count, imageUrl}…]
}
} | Top3 | O |
| /menu/monthly-sales/detail | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{rankChange, isNew, rank, menuName, totalRevenue, count}…]
}
} | | O |
| /menu/daily-diff | GET | 2023-08-18 | parameters = { date:String($date) } | { success: Boolean
code: Int,
message: String
data: {
best:
{rankChange, isNew, rank, menuName, totalRevenue, count},
worst:
{menuName, changeRate, changeRevenue, imageUrl}
}
} | | O |
| /menu/weekly-diff | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
best:
{rankChange, isNew, rank, menuName, totalRevenue, count},
worst:
{menuName, changeRate, changeRevenue, imageUrl}
}
} | | O |
| /menu/monthly-diff | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
best:
{rankChange, isNew, rank, menuName, totalRevenue, count},
worst:
{menuName, changeRate, changeRevenue, imageUrl}
}
} | | O |
| /menu/daily-diff/detail | GET | 2023-08-18 | parameters = { date:String($date) } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{menuName, changeRate, lastCount, thisCount, lastRevenue, thisRevenue}…]
}
} | | O |
| /menu/weekly-diff/detail | GET | 2023년 5월 1주차 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{menuName, changeRate, lastCount, thisCount, lastRevenue, thisRevenue}…]
}
} | | O |
| /menu/monthly-diff/detail | GET | 2023년 6월 | parameters = { dateString:String } | { success: Boolean
code: Int,
message: String
data: {
menus:
[{menuName, changeRate, lastCount, thisCount, lastRevenue, thisRevenue}…]
}
} | | O |
| /image/{image_name} | GET | | PathVariable = {
image_name:String
} | Image | | X |
| | GET | | | | 설정 페이지에서 로그인한 회원의 정보(role 빼고 전부다)
를 확인할 수 있도록
회원 1명의 정보를 GET하는 API가 필요합니다. | |
| /admin | GET | - | - | { success: Boolean
code: Int,
message: String
data: {
userDataList:
[{id, branchName, userName, state, phone, address, approvalDate, expirationDate}…]
}
} | 사용자 목록(사용자 조회) | O |
| /admin/{id} | PUT | 1 | PathVariable = {
id : Int,
changedUserInfo:{
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
}
} | {
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
} | 회원 정보 수정, 회원 정보 등록
| O |
| /admin/apply | GET | | | { success: Boolean
code: Int,
message: String
data: {
userDataList:
[{id, branchName, userName, state, phone, address, approvalDate, expirationDate}…]
}
} | 서비스 신청내역 목록 | |
| /admin/{id}/approve | PUT | 1 | PathVariable = {
userId : Int
} | { response: ok,
code: 200
} | 단일 승인 | O |
| /admin/{idList}/approve | PUT | 1 | PathVariable = {
idList : [{id}…]
} | { response: ok,
code: 200
} | 다중 승인 | O |
| /admin/{id}/expire | PUT | 1 | PathVariable = {
id : Int
} | { response: ok,
code: 200
} | 만료 | O |
| /admin/{id}/{date} | PUT | 1/2024-12-12 | PathVariable = {
id : Int,
date : LocalDate
} | { response: ok,
code: 200
} | 만료 연장 | O |
| /user | GET | | | {
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
} | 유저 본인의 회원 정보 확인
| O |
| /user | PUT | | PathVariable = {
id : Int,
changedUserInfo:{
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
}
} | {
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
} | 유저 본인의 회원 정보 수정, 회원 정보 등록
| O |
| /user/{months} | PUT | 3 | PathVariable = {
month : Int} | {
"id": Int,
"branchName": String,
"userName": String,
"state": Enum,
"phone": String,
"address": String,
"approvalDate": LocalDate,
"expirationDate": LocalDate
} | 서비스 신청
months 에는 신청할 기간(3개월, 6개월)을 설정합니다. | |
| /admin/banner | GET | | | "banners": [
{
"id": Int,
"image": {
"id": Int,
"filePath": String,
"fileSize": Int,
"originalFileName": String
},
"bannerName": String,
"state": enum
}, …
] | 모든 배너 정보를 가져옵니다. | 배너 아이디 |
| /admin/banner | PUT | | 사용할 배너 아이디 목록 | HttpStatus.*ACCEPTED*
| 배너의 상태를 변경합니다.(사용중 → 사용하지 않음 or 사용하지 않음 → 사용중) | |
| /admin/banner/{loginId}/{bannerName} | POST | | PathVariable = {
loginId : String,
bannerName : String
}
Request body = {
{
file : [String]
}
| HttpStatus.*CREATED*
| 새로운 배너를 등록합니다.
loginId = 관리자 아이디,
bannerName = “아무거나”
body에 등록할 배너 사진 파일을 첨부해서 보냅니다.
같은 사진을 여러번 등록 할 수 있지만 그러면 안됩니다. 다른 api 호출할 때 오류가 있음 | 프론트에서 사용자의 id를 저장하지않기때문에 loginId는 하드코딩해서 넣었습니다. |
| /admin/banner/{using} | GET | | USING
| "banners": [
{
"id": Int,
"image": {
"id": Int,
"filePath": String,
"fileSize": Int,
"originalFileName": String
},
"bannerName": String,
"state": enum
}, …
] | 지금 사용 중인 배너들을 가져옵니다. | |
body = { nickname: String, phone: String } |
{ "nickname": "johnny", "phone": "1234567890" } |
{ code: Int, message: String } |
{ "code": 200, "message": "Info updated" } |