# 测试环境部署文档

## jar包及数据库部署

### jar包部署

有3个jar包需要部署 分别是 sms_blk_api-exec.jar(对外接口程序)、 sms_blk_server-exec.jar(模拟socket服务器)、 sms_blk_interface-exec.jar(对接数据借口)

- sms_blk_api.exec.jar

```sh
# 部署目录 192.168.50.3:/data1/sms_blk/sms_blk_api/
# 启动命令 
sh run.sh
# 停止命令
sh stop.sh

# 为了保证能开对测试环境的访问，同时添加了在133.96.94.108上的nginx映射到12110端口
# 打包之前需要注意修改验证条件
```

- sms_blk_interface-exec.jar

```sh
# 部署目录 192.168.10.7:/data1/sms_blk/sms_blk_interface/
# 启动命令 
sh run.sh
# 停止命令
sh stop.sh

# 为避免数据丢失，测试版本不要删除服务端文件
```

- sms_blk_server-exec.jar

```sh
# 部署目录 192.168.50.3:/data1/sms_blk/sms_blk_server/
# 启动命令 
sh run.sh
# 停止命令
sh stop.sh
```

### 测试环境数据库

数据库URL jdbc:postgresql://192.168.50.4:5432/sqmmt

do/Richr00t

## 接口测试

- 接口1： 黑名单查询接口

```http
POST HTTP://192.168.50.3:12120/sms/blacklist/api/query/
Content-Type: application/json

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

nginx转发

```http
POST HTTP://133.96.94.108:12110/sms/blacklist/api/query/
Content-Type: application/json

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

- 黑名单解除接口

本机访问

```http
POST HTTP://192.168.50.3:12120/sms/blacklist/api/remove/
Content-Type: application/json

{
    "phone": "13739798862",
    "fromSystem": "test",
    "operator": "test01"
}
```

nginx转发

```http
POST HTTP://133.96.94.108:12110/sms/blacklist/api/remove/
Content-Type: application/json

{
    "phone": "13739798862",
    "fromSystem": "test",
    "operator": "test01"
}
```
