# IPLibraryArtifactService
> IP库制品

---

## createIPLibraryArtifact
> 创建制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/createIPLibraryArtifact`
- RPC：`rpc createIPLibraryArtifact(CreateIPLibraryArtifactRequest) returns (CreateIPLibraryArtifactResponse);`

**请求对象 (`CreateIPLibraryArtifactRequest`)**

```json
{
  "fileId": "int64 // 文件ID",
  "metaJSON": "bytes",
  "name": "string // 名称",
  "type": "string"
}
```

**响应对象 (`CreateIPLibraryArtifactResponse`)**

```json
{
  "ipLibraryArtifactId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/createIPLibraryArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteIPLibraryArtifact
> 删除制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/deleteIPLibraryArtifact`
- RPC：`rpc deleteIPLibraryArtifact(DeleteIPLibraryArtifactRequest) returns (RPCSuccess);`

**请求对象 (`DeleteIPLibraryArtifactRequest`)**

```json
{
  "ipLibraryArtifactId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/deleteIPLibraryArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteRiskIPArtifact
> 删除风险IP制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/deleteRiskIPArtifact`
- RPC：`rpc deleteRiskIPArtifact(DeleteIPLibraryArtifactRequest) returns (RPCSuccess);`

**请求对象 (`DeleteIPLibraryArtifactRequest`)**

```json
{
  "ipLibraryArtifactId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/deleteRiskIPArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findAllIPLibraryArtifacts
> 查询所有制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/findAllIPLibraryArtifacts`
- RPC：`rpc findAllIPLibraryArtifacts(FindAllIPLibraryArtifactsRequest) returns (FindAllIPLibraryArtifactsResponse);`

**请求对象 (`FindAllIPLibraryArtifactsRequest`)**

```json
{}
```

**响应对象 (`FindAllIPLibraryArtifactsResponse`)**

```json
{
  "ipLibraryArtifacts": "[]IPLibraryArtifact"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/findAllIPLibraryArtifacts" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findIPLibraryArtifact
> 查找单个制品信息

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/findIPLibraryArtifact`
- RPC：`rpc findIPLibraryArtifact(FindIPLibraryArtifactRequest) returns (FindIPLibraryArtifactResponse);`

**请求对象 (`FindIPLibraryArtifactRequest`)**

```json
{
  "ipLibraryArtifactId": "int64"
}
```

**响应对象 (`FindIPLibraryArtifactResponse`)**

```json
{
  "ipLibraryArtifact": "IPLibraryArtifact"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/findIPLibraryArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findPublicIPLibraryArtifact
> 查找当前正在使用的制品

- 角色：`dns`, `node`, `admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/findPublicIPLibraryArtifact`
- RPC：`rpc findPublicIPLibraryArtifact(FindPublicIPLibraryArtifactRequest) returns (FindPublicIPLibraryArtifactResponse);`

**请求对象 (`FindPublicIPLibraryArtifactRequest`)**

```json
{}
```

**响应对象 (`FindPublicIPLibraryArtifactResponse`)**

```json
{
  "ipLibraryArtifact": "IPLibraryArtifact"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/findPublicIPLibraryArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findRiskIPPublicArtifact
> 查找当前正在使用的风险IP制品

- 角色：`dns`, `node`, `admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/findRiskIPPublicArtifact`
- RPC：`rpc findRiskIPPublicArtifact(FindPublicIPLibraryArtifactRequest) returns (FindPublicIPLibraryArtifactResponse);`

**请求对象 (`FindPublicIPLibraryArtifactRequest`)**

```json
{}
```

**响应对象 (`FindPublicIPLibraryArtifactResponse`)**

```json
{
  "ipLibraryArtifact": "IPLibraryArtifact"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/findRiskIPPublicArtifact" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateIPLibraryArtifactIsPublic
> 使用/取消使用制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/updateIPLibraryArtifactIsPublic`
- RPC：`rpc updateIPLibraryArtifactIsPublic(UpdateIPLibraryArtifactIsPublicRequest) returns (RPCSuccess);`

**请求对象 (`UpdateIPLibraryArtifactIsPublicRequest`)**

```json
{
  "ipLibraryArtifactId": "int64",
  "isPublic": "bool"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/updateIPLibraryArtifactIsPublic" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateRiskIPArtifactIsPublic
> 使用/取消风险IP制品

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryArtifactService/updateRiskIPArtifactIsPublic`
- RPC：`rpc updateRiskIPArtifactIsPublic(UpdateIPLibraryArtifactIsPublicRequest) returns (RPCSuccess);`

**请求对象 (`UpdateIPLibraryArtifactIsPublicRequest`)**

```json
{
  "ipLibraryArtifactId": "int64",
  "isPublic": "bool"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryArtifactService/updateRiskIPArtifactIsPublic" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
