You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.0 KiB
Markdown

<h1 style="text-align: center">百业 - 短链服务v1.0 </h1>
<div style="text-align: center">
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/elunez/eladmin/blob/master/LICENSE)
</div>
#### 项目简介
为所有的百业业务系统提供短链服务
#### 参考项目地址
| 项目名 | 地址 |
| ---- | ---- |
| 短链接服务Octopus的实现与源码开放 | https://github.com/zjcscut/octopus |
| 短链接服务 | https://github.com/wyh267/shortService |
#### 模块说明
short-server-common - 公共模块
short-server-pojo - dto/bo 用于模块之间的传输实体/领域模型定义
short-server-service - 短链生成服务
### 调用方式1 - 生成单一短链服务[支持默认定时30天的清除短链(默认开启)]
- 请求
- 方式及body格式
- POST | json
- 地址及参数
- s.z48.cn/trans
- {"baseUrlAddr": "http://www.baidu.com"}
- ps baseUrlAddr 表示要进行缩短的长链接
- 响应
- {"status": 0,"data": {"shortChainResult": ["tG"]}}
- ps: shortChainResult 表示缩短后的结果
- 生成后的请求
- s.z48.cn/tG
### 调用方式2 - 生成带单一用户记录的服务[支持默认定时30天的清除短链(默认开启)]
- 请求
- 方式及body格式
- POST | json
- 地址及参数
- s.z48.cn/trans
- {"baseUrlAddr": "htttps://www.baidu.com/xxdsd/sdsdsds?sadsads=xxxx","variableList": [13111112211, 12111112222]}
- ps: baseUrlAddr 表示要进行缩短的长链接; variableList 表示要记录的手机号
- 响应
- {"status": 0,"data": {"shortChainResult": ["pINbght|13111112211","2Mfje8y|12111112222"]}}
- "|" 前面为唯一标识随机码,后面为对应的手机号
- 生成后的请求
- s.z48.cn/pINbght
- s.z48.cn/2Mfje8y
#### 部署方式
by-short-server 目录下 mvn clean package -Dmaven.test.skip=true 进行打包
上传到服务器 /home/www/sms/目录下
运行 /home/www/ 下的 run-short-server.sh 脚本启动