# domainBAPI接口说明

## 接口1: 路由查询

- 实现细节：

基本透传结果，需要注意非联通号码返回信息不同

```http
POST HTTP://127.0.0.1:12091/domainB/api/route/
Content-Type: application/json

{
  "phoneNumber": "18503369666",
  "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "phoneNumber": "18503369666",
    "isUnicomNumber": true,
    "userStatus": "2",
    "routeType": "00",
    "eparchyCode": "0335",
    "provinceCode": "18"
  }
}
```

### 输出参数说明
<table>
    <tr><td>phoneNumber</td><td>手机号</td></tr>
    <tr><td>isUnicomNumber</td><td>是否联通号码</td></tr>
    <tr><td>userStatus</td><td>用户状态；1：drds 号码在用状态 且为新架构号码 2：oracle 号码在用状态 且为cBss常态化号码 3：非CB 号码在cBss系统没有路由记录 4：drds 号码失效状态 且为新架构号码 5：oracle 号码失效状态 且为cBss常态化号码</td></tr>
    <tr><td>routeType</td><td>路由类型</td></tr>
    <tr><td>eparchyCode</td><td>地市编码</td></tr>
    <tr><td>provinceCode</td><td>省份编码</td></tr>
</table>

## 接口2: 5GSA查询

- 实现细节：

需要查询全国用户，因此需要套一层路由查询

```http
POST HTTP://127.0.0.1:12091/domainB/api/sa/
Content-Type: application/json

{
  "phoneNumber": "18503369666",
  "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "isUnicomNumber": true,
    "isHaveSa": true,
    "isUdmUser": true
  }
}
```

### 输出参数说明
<table>
    <tr><td>isUnicomNumber</td><td>是否联通号码</td></tr>
    <tr><td>isHaveSa</td><td>是否有SA服务</td></tr>
    <tr><td>isUdmUser</td><td>是否UDM用户</td></tr>
</table>

## 接口3: 功能查询

- 实现细节：

由于操作员权限限制，查询仅支持河北联通用户，需要注意处理非河北联通用户及非联通用户的特殊情况

```http
POST HTTP://127.0.0.1:12091/domainB/api/product/saAndVolte/
Content-Type: application/json

{
  "phoneNumber": "18503369666",
  "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "isHebeiUnicomNumber": true,
    "is5gProduct": true,
    "isHaveSa": true,
    "isHaveVolte": true
  }
}

```

### 输出参数说明
<table>
    <tr><td>isHebeiUnicomNumber</td><td>是否河北联通号码</td></tr>
    <tr><td>is5gProduct</td><td>是否5g套餐</td></tr>
    <tr><td>isHaveSa</td><td>是否开通5g</td></tr>
    <tr><td>isHaveVolte</td><td>是否开通volte</td></tr>
</table>

## 接口4：用户资料三户返回

```http
POST HTTP://127.0.0.1:12091/domainB/api/threePart/userState/
Content-Type: application/json

{
  "phoneNumber": "18503369666",
  "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "userState": "0"
  }
}
```

### 输出参数说明
<table>
    <tr><td>userState</td><td>用户状态</td></tr>
</table>

## 接口5：欠费接口整合

```http
POST HTTP://127.0.0.1:12091/domainB/api/acting/qryowefee/
Content-Type: application/json

{
  "phoneNumber": "18503369666",
  "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "payFee": "0",
    "balanceFee": "4144",
    "realFee": "12900",
    "creditClass": "B",
    "totalCreditValue": "32250",
    "availableCreditValue": "32794"
  }
}
```

### 输出参数说明
<table>
    <tr><td>payFee</td><td>应交金额=费用合计-上次余额,应交金额&gt;=0(往月欠费+实时话费)</td></tr>
    <tr><td>balanceFee</td><td>当前余额</td></tr>
    <tr><td>realFee</td><td>实时话费</td></tr>
    <tr><td>creditClass</td><td>信用等级</td></tr>
    <tr><td>totalCreditValue</td><td>用户总信用度</td></tr>
    <tr><td>availableCreditValue</td><td>可用额度</td></tr>
</table>
