176 lines
4.5 KiB
Markdown
176 lines
4.5 KiB
Markdown
# 资产管理API接口文档
|
||
|
||
## 1. 资产标签管理
|
||
|
||
### 1.1 查询资产标签列表
|
||
- **接口说明**:查询资产标签列表
|
||
- **请求方式**:GET
|
||
- **请求路径**:/asset/label/list
|
||
- **请求参数**:
|
||
```json
|
||
{
|
||
"templateType": "1", // 模板类型 1-模板1 2-模板2 3-模板3 4-模板4
|
||
"paperType": "1", // 纸张类型 1-标签专用纸 2-A4(2列标签) 3-A4(3列标签)
|
||
"delFlag": "0" // 是否删除 0-未删除 1-已删除
|
||
}
|
||
```
|
||
- **响应结果**:
|
||
```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"
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
### 1.2 新增资产标签
|
||
- **接口说明**:新增资产标签
|
||
- **请求方式**:POST
|
||
- **请求路径**:/asset/label
|
||
- **请求参数**:
|
||
```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"
|
||
}
|
||
}
|
||
```
|
||
|
||
### 1.3 修改资产标签
|
||
- **接口说明**:修改资产标签
|
||
- **请求方式**:PUT
|
||
- **请求路径**:/asset/label
|
||
- **请求参数**:
|
||
```json
|
||
{
|
||
"id": "1",
|
||
"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"
|
||
}
|
||
}
|
||
```
|
||
|
||
### 1.4 删除资产标签
|
||
- **接口说明**:删除资产标签
|
||
- **请求方式**:DELETE
|
||
- **请求路径**:/asset/label/{id}
|
||
- **请求参数**:
|
||
- id:资产标签ID
|
||
- **响应结果**:
|
||
```json
|
||
{
|
||
"code": 200,
|
||
"message": "success"
|
||
}
|
||
```
|
||
|
||
### 1.5 批量删除资产标签
|
||
- **接口说明**:批量删除资产标签
|
||
- **请求方式**:DELETE
|
||
- **请求路径**:/asset/label/batch
|
||
- **请求参数**:
|
||
```json
|
||
{
|
||
"ids": ["1", "2", "3"] // 资产标签ID列表
|
||
}
|
||
```
|
||
- **响应结果**:
|
||
```json
|
||
{
|
||
"code": 200,
|
||
"message": "success"
|
||
}
|
||
```
|
||
|
||
## 2. 错误码说明
|
||
|
||
| 错误码 | 说明 |
|
||
|--------|------|
|
||
| 200 | 成功 |
|
||
| 400 | 请求参数错误 |
|
||
| 401 | 未授权 |
|
||
| 403 | 禁止访问 |
|
||
| 404 | 资源不存在 |
|
||
| 500 | 服务器内部错误 |
|
||
|
||
## 3. 注意事项
|
||
|
||
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-使用部门 |