92 lines
2.3 KiB
Markdown
92 lines
2.3 KiB
Markdown
# 制度类型搜索接口实现指南
|
||
|
||
## 接口定义
|
||
|
||
### 请求接口
|
||
```
|
||
GET /api/regulation/types
|
||
Content-Type: application/json
|
||
```
|
||
|
||
### 请求参数
|
||
```json
|
||
{
|
||
"page": number, // 页码(可选,默认1)
|
||
"size": number, // 每页大小(可选,默认10)
|
||
"typeName": "string", // 类型名称(模糊搜索,可选)
|
||
"status": "string", // 状态筛选("1"启用,"0"禁用,可选)
|
||
"remark": "string" // 备注内容(模糊搜索,可选)
|
||
}
|
||
```
|
||
|
||
### 响应格式
|
||
```json
|
||
{
|
||
"code": 200,
|
||
"message": "success",
|
||
"data": {
|
||
"records": [
|
||
{
|
||
"typeId": "string",
|
||
"typeName": "string",
|
||
"sortOrder": number,
|
||
"isEnabled": "string",
|
||
"remark": "string",
|
||
"createBy": "string",
|
||
"createTime": "string",
|
||
"updateBy": "string",
|
||
"updateTime": "string",
|
||
"delFlag": "string"
|
||
}
|
||
],
|
||
"total": number, // 总记录数
|
||
"current": number, // 当前页码
|
||
"size": number, // 每页大小
|
||
"pages": number // 总页数
|
||
}
|
||
}
|
||
```
|
||
|
||
## 后端实现说明
|
||
|
||
后端已实现以下接口:
|
||
```java
|
||
@ApiOperation(value = "获取制度类型列表", httpMethod = "GET")
|
||
@GetMapping
|
||
public Result getRegulationTypes(
|
||
@RequestParam(defaultValue = "1") int page,
|
||
@RequestParam(defaultValue = "10") int size,
|
||
@RequestParam(required = false) String typeName,
|
||
@RequestParam(required = false) String status,
|
||
@RequestParam(required = false) String remark
|
||
) {
|
||
return regulationTypeService.getRegulationTypes(page, size, typeName, status, remark);
|
||
}
|
||
```
|
||
|
||
## 前端集成说明
|
||
|
||
前端已完成以下功能:
|
||
1. ✅ 调整为GET请求接口
|
||
2. ✅ 参数名匹配后端接口(isEnabled → status)
|
||
3. ✅ 移除排序参数(后端不支持)
|
||
4. ✅ 简化搜索表单,只支持手动搜索
|
||
5. ✅ 保持原有功能不受影响
|
||
|
||
## 搜索流程
|
||
|
||
1. 用户在搜索表单中输入条件
|
||
2. 点击"搜索"按钮触发搜索
|
||
3. 调用后端GET接口 `/api/regulation/types`
|
||
4. 后端返回搜索结果
|
||
5. 前端展示搜索结果
|
||
|
||
## 参数说明
|
||
|
||
- **page**: 页码,默认1
|
||
- **size**: 每页大小,默认10
|
||
- **typeName**: 类型名称,支持模糊搜索
|
||
- **status**: 状态筛选,"1"表示启用,"0"表示禁用
|
||
- **remark**: 备注内容,支持模糊搜索
|
||
|