Skip to content

Commit 53cc5a4

Browse files
authored
Merge pull request #77 from konkuk-icteam-student/dev
[docs] 업무일지 관련 api 문서 최신화
2 parents be0dcb3 + 81a0f18 commit 53cc5a4

File tree

5 files changed

+453
-366
lines changed

5 files changed

+453
-366
lines changed

docs/api/category.md

Lines changed: 102 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,118 +20,160 @@ FAQ 분류용 카테고리를 관리하는 API입니다.
2020

2121
---
2222

23-
## 🔐 인증
23+
## ✅ 카테고리 등록
2424

25-
현재 `SecurityConfig` 기준으로 인증이 강제되지 않습니다. (permitAll)
25+
### Endpoint:
26+
**POST /api/v1/categories**
2627

27-
---
28+
새로운 category(분류)를 등록하는 API입니다.\
29+
• 동일한 이름의 분류가 이미 존재하는 경우 등록할 수 없습니다.\
30+
• 중복이 아닌 경우 새로운 Category를 생성하고 저장합니다.
2831

29-
## ✅ 카테고리 등록
3032

31-
**Endpoint**: `POST /api/v1/categories`
32-
33-
**Request Body**:
33+
### Request Body:
3434
```json
3535
{
36-
"categoryName": "인사관리"
36+
"categoryName": "인사관리"
3737
}
3838
```
3939

40-
**Response (200 OK)**:
40+
41+
### Request Example:\
42+
POST /api/v1/categories
43+
44+
45+
46+
### Response (200 OK):
4147
```json
4248
{
43-
"isSuccess": true,
44-
"message": "카테고리 등록 성공",
45-
"details": {
46-
"categoryId": 1
47-
}
49+
"isSuccess": true,
50+
"message": "카테고리 등록 성공",
51+
"details": {
52+
"categoryId": 1
53+
}
4854
}
4955
```
5056

5157
---
5258

5359
## ✏️ 카테고리 수정
5460

55-
**Endpoint**: `PUT /api/v1/categories/{categoryId}`
61+
### Endpoint:
62+
**PUT /api/v1/categories/{categoryId}**
63+
64+
기존 category의 이름을 변경하는 API입니다.
5665

57-
**Request Body**:
66+
동작 방식은 다음과 같습니다:\
67+
• 전달된 categoryId가 존재하는지 확인합니다.\
68+
• 변경하려는 이름이 이미 존재하는지 확인합니다.\
69+
• 중복이 아닐 경우 category 이름을 변경합니다.
70+
71+
72+
### Request Body:
5873
```json
5974
{
6075
"categoryName": "학생복지"
6176
}
6277
```
6378

64-
**Response (200 OK)**:
65-
```json
66-
{
67-
"isSuccess": true,
68-
"message": "카테고리 수정 성공",
69-
"details": {
70-
"categoryId": 1,
71-
"updatedName": "학생복지"
72-
}
73-
}
74-
```
7579

76-
---
80+
### Request Example:
81+
PUT /api/v1/categories/1
7782

78-
## 📋 카테고리 전체 조회
7983

80-
**Endpoint**: `GET /api/v1/categories`
8184

82-
**Response (200 OK)**:
85+
### Response (200 OK):
8386
```json
8487
{
85-
"isSuccess": true,
86-
"message": "전체 카테고리 조회 성공",
87-
"details": {
88-
"categories": [
89-
{
88+
"isSuccess": true,
89+
"message": "카테고리 수정 성공",
90+
"details": {
9091
"categoryId": 1,
91-
"categoryName": "시스템"
92-
},
93-
{
94-
"categoryId": 2,
95-
"categoryName": "인사관리"
96-
}
97-
]
98-
}
92+
"updatedName": "학생복지"
93+
}
9994
}
10095
```
101-
10296
---
10397

104-
## 🗑️ 카테고리 삭제
98+
## 🔎 카테고리 전체 조회
10599

106-
**Endpoint**: `DELETE /api/v1/categories/{categoryId}`
100+
### Endpoint:
101+
**GET /api/v1/categories**
107102

108-
**Response (200 OK)**:
103+
전체 category(분류) 목록을 조회하는 API입니다.
104+
105+
등록되어 있는 모든 카테고리를 조회하며,\
106+
별도의 필터 조건 없이 전체 목록을 반환합니다.
107+
108+
109+
### Request Example:
110+
GET /api/v1/categories
111+
112+
113+
### Response (200 OK):
109114
```json
110115
{
111-
"isSuccess": true,
112-
"message": "성공적으로 삭제되었습니다.",
113-
"details": null
116+
"isSuccess": true,
117+
"message": "전체 카테고리 조회 성공",
118+
"details": {
119+
"categories": [
120+
{
121+
"categoryId": 1,
122+
"categoryName": "시스템"
123+
},
124+
{
125+
"categoryId": 2,
126+
"categoryName": "인사관리"
127+
},
128+
{
129+
"categoryId": 3,
130+
"categoryName": "학생복지"
131+
}
132+
]
133+
}
114134
}
115135
```
116136

137+
### 응답 필드 설명
138+
***필드명 - 설명***\
139+
categories - 전체 카테고리 목록\
140+
categoryId - 분류 ID\
141+
categoryName - 분류 이름
142+
143+
117144
---
118145

119-
## ⭐ 즐겨찾기 등록/해제
146+
## 🗑️ 카테고리 삭제
147+
148+
### Endpoint:
149+
**DELETE /api/v1/categories/{categoryId}**
120150

121-
**Endpoint**: `PATCH /api/v1/categories/{categoryId}?favorite=true|false`
151+
특정 category(분류)를 삭제하는 API입니다.
122152

123-
**Response (200 OK)**:
153+
삭제 조건은 다음과 같습니다:\
154+
• 해당 categoryId가 존재해야 합니다.\
155+
• 해당 카테고리에 연결된 FAQ가 없어야 합니다.\
156+
• 해당 카테고리에 연결된 담당자(ManagerCategory)가 없어야 합니다.
157+
158+
위 조건 중 하나라도 만족하지 않으면 삭제할 수 없습니다.
159+
160+
161+
162+
### Request Example:
163+
DELETE /api/v1/categories/1
164+
165+
166+
167+
### Response (200 OK):
124168
```json
125169
{
126-
"isSuccess": true,
127-
"message": "즐겨찾기 등록 성공",
128-
"details": {
129-
"categoryId": 1,
130-
"favorite": true
131-
}
170+
"isSuccess": true,
171+
"message": "카테고리 삭제 성공",
172+
"details": null
132173
}
133174
```
134175

176+
135177
---
136178

137179
## 🔗 관련 문서

0 commit comments

Comments
 (0)