zhongchangyuyu 1cf46e5633 资产优化
2025-04-25 19:53:53 +08:00

184 lines
4.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 标签管理API接口文档
## 1. 接口说明
本文档描述了标签管理相关的API接口包括标签的查询、新增、修改、删除等操作。所有接口都需要进行身份验证请求头中需要携带token。
## 2. 接口列表
### 2.1 查询标签列表
- **接口说明**:查询标签列表,支持分页和条件查询
- **请求方式**GET
- **请求路径**/api/v1/labels
- **请求参数**
```json
{
"pageNum": 1, // 页码从1开始
"pageSize": 10, // 每页记录数
"templateType": "1", // 模板类型,可选
"paperType": "1", // 纸张类型,可选
"delFlag": "0" // 是否删除,可选
}
```
- **响应结果**
```json
{
"code": 200,
"message": "success",
"data": {
"total": 100,
"list": [
{
"id": "1",
"templateType": "1",
"labelItems": "1,2,3",
"paperType": "1",
"labelWidth": "100",
"labelHeight": "50",
"createUserId": "admin",
"createTime": "2024-04-07 10:00:00",
"delFlag": "0",
"lastModUserId": "admin",
"lastModTime": "2024-04-07 10:00:00",
"tenantId": "tenant1"
}
]
}
}
```
### 2.2 新增标签
- **接口说明**:新增标签
- **请求方式**POST
- **请求路径**/api/v1/labels
- **请求参数**
```json
{
"templateType": "1", // 模板类型 1-模板1 2-模板2 3-模板3 4-模板4
"labelItems": "1,2,3", // 标签集合,以逗号分隔的数字
"paperType": "1", // 纸张类型 1-标签专用纸 2-A4(2列标签) 3-A4(3列标签)
"labelWidth": "100", // 标签宽度(mm),仅当纸张类型为标签专用纸时有效
"labelHeight": "50" // 标签高度(mm),仅当纸张类型为标签专用纸时有效
}
```
- **响应结果**
```json
{
"code": 200,
"message": "success",
"data": {
"id": "1",
"templateType": "1",
"labelItems": "1,2,3",
"paperType": "1",
"labelWidth": "100",
"labelHeight": "50",
"createUserId": "admin",
"createTime": "2024-04-07 10:00:00",
"delFlag": "0",
"lastModUserId": "admin",
"lastModTime": "2024-04-07 10:00:00",
"tenantId": "tenant1"
}
}
```
### 2.3 修改标签
- **接口说明**:修改标签
- **请求方式**PUT
- **请求路径**/api/v1/labels/{id}
- **请求参数**
```json
{
"templateType": "1", // 模板类型 1-模板1 2-模板2 3-模板3 4-模板4
"labelItems": "1,2,3", // 标签集合,以逗号分隔的数字
"paperType": "1", // 纸张类型 1-标签专用纸 2-A4(2列标签) 3-A4(3列标签)
"labelWidth": "100", // 标签宽度(mm),仅当纸张类型为标签专用纸时有效
"labelHeight": "50" // 标签高度(mm),仅当纸张类型为标签专用纸时有效
}
```
- **响应结果**
```json
{
"code": 200,
"message": "success",
"data": {
"id": "1",
"templateType": "1",
"labelItems": "1,2,3",
"paperType": "1",
"labelWidth": "100",
"labelHeight": "50",
"createUserId": "admin",
"createTime": "2024-04-07 10:00:00",
"delFlag": "0",
"lastModUserId": "admin",
"lastModTime": "2024-04-07 10:00:00",
"tenantId": "tenant1"
}
}
```
### 2.4 删除标签
- **接口说明**:删除标签
- **请求方式**DELETE
- **请求路径**/api/v1/labels/{id}
- **请求参数**
- id标签ID
- **响应结果**
```json
{
"code": 200,
"message": "success"
}
```
### 2.5 批量删除标签
- **接口说明**:批量删除标签
- **请求方式**DELETE
- **请求路径**/api/v1/labels/batch
- **请求参数**
```json
{
"ids": ["1", "2", "3"] // 标签ID列表
}
```
- **响应结果**
```json
{
"code": 200,
"message": "success"
}
```
## 3. 错误码说明
| 错误码 | 说明 |
|--------|------|
| 200 | 成功 |
| 400 | 请求参数错误 |
| 401 | 未授权 |
| 403 | 禁止访问 |
| 404 | 资源不存在 |
| 500 | 服务器内部错误 |
## 4. 注意事项
1. 所有接口都需要在请求头中携带token进行身份验证
2. 请求参数中的时间格式统一为yyyy-MM-dd HH:mm:ss
3. 分页查询接口的页码从1开始
4. 所有接口返回的数据都包含在data字段中
5. 删除操作是逻辑删除将del_flag设置为1
6. 标签的宽度和高度仅在纸张类型为标签专用纸时有效
7. 标签集合中的数字对应关系:
- 1-资产名称
- 2-资产分类
- 3-资产编码
- 4-资产位置
- 5-品牌
- 6-型号
- 7-设备序列号
- 8-管理员
- 9-保养到期时间
- 10-保养说明
- 11-使用部门