Files
jsowell-charger-web/doc/接口文档New.md
2023-03-04 16:29:55 +08:00

622 lines
22 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 小程序接口
## 接口返回格式
| 字段名 | 类型 | 是否必传 | 备注 |
| ------- | ------ | -------- | ---------- |
| resCode | String | Y | 返回码 |
| msg | String | Y | 返回信息 |
| obj | Object | Y | 返回的数据 |
以下接口反参指的是obj中的数据接口返回都有resCodemsgobj这三个字段。
### 示例
~~~json
# 入参
{
"pageSize": "10",
"pageNum": "1",
"stationLng": "55.96",
"stationLat": "155.77"
}
# 反参
{
"resCode": "00100000",
"msg": "操作成功",
"obj": {
"pageNum": 1,
"pageSize": 10,
"list": [
{
"stationId": "2",
"stationName": "测试仓库",
"stationAddress": "华新镇华隆路1777号6幢D座",
"distance": "10745.74",
"electricityPrice": null,
"servicePrice": null,
"fastTotal": 0,
"fastFree": 0,
"slowTotal": 3,
"slowFree": 0
},
{
"stationId": "1",
"stationName": "测试",
"stationAddress": "黄埔江南路278号举视新能源",
"distance": "10762.94",
"electricityPrice": null,
"servicePrice": null,
"fastTotal": 0,
"fastFree": 0,
"slowTotal": 0,
"slowFree": 0
}
],
"total": 2,
"pages": 1
}
}
# 错误反参
{
"resCode": "00100010",
"msg": "查询充电站信息列表异常",
"obj": null
}
~~~
## 1001 登录注册接口
## 1002 查询会员信息
> 接口地址http://localhost:8080/uniapp/member/getMemberInfo
>
> 请求方式GET
### 入参
null在Header中需传Authorization
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| -------- | ------ | -------- | ------------ |
| MemberVO | Object | Y | 用户信息对象 |
### MemberVO
| 字段名 | 类型 | 是否必传 | 备注 |
| ------------------ | ------ | -------- | --------------------------- |
| memberId | String | Y | 会员Id |
| status | String | Y | 状态(1-正常;0-停用) |
| nickName | String | Y | 用户昵称 |
| mobileNumber | String | Y | 手机号码 |
| principalPrice | Number | Y | 本金金额 |
| giftPrice | Number | Y | 赠送金额 |
| totalAccountAmount | Number | Y | 总金额(本金金额 + 赠送金额) |
## 1003 修改会员信息
## 2001 根据经纬度查询充电站列表(分页排序)
> 接口地址http://localhost:8080/uniapp/pile/queryStationInfos
>
> 请求类型POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------- | ------ | -------- | ---------------- |
| stationLng | String | N | 经度 |
| stationLat | String | N | 纬度 |
| pageNum | Number | Y | 页码 |
| pageSize | Number | Y | 每页数量 |
| stationName | String | y | 站点名称(搜索) |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| -------- | ---------------- | -------- | ---------- |
| pageNum | Number | Y | 页码 |
| pageSize | Number | Y | 每页数量 |
| list | Array<StationVO> | Y | 充电站列表 |
| total | Number | Y | 总数 |
| pages | Number | Y | 总页数 |
StationVO
| 字段名 | 类型 | 是否必传 | 备注 |
| ---------------- | ------------- | -------- | --------------------- |
| stationId | String | Y | 站点id |
| stationName | String | Y | 站点名称 |
| stationAddress | String | Y | 站点地址 |
| stationImgList | Array<String> | N | 站点图片 |
| distance | String | N | 距离 单位千米 |
| electricityPrice | String | Y | 电费 每度单价 |
| servicePrice | String | Y | 服务费 每度单价 |
| totalPrice | String | Y | 总金额(电费+服务费) |
| fastTotal | Number | Y | 快充枪口总数 |
| fastFree | Number | Y | 快充枪口空闲数 |
| slowTotal | Number | Y | 慢充枪口总数 |
| slowFree | Number | Y | 慢充枪口空闲数 |
| stationLng | String | Y | 经度 |
| stationLat | String | Y | 纬度 |
## 3001 查询充电桩详情
## 3002 查询充电桩枪口详情
> 接口地址http://localhost:8080/uniapp/pile/selectConnectorListByParams
>
> 请求类型POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------------- | -------- | --------------------------- |
| pageNum | Number | Y | 页码 |
| pageSize | Number | Y | 每页数量 |
| merchantId | String | N | 运营商id ==接口暂未支持== |
| stationIdList | Array<Long> | N | 站点id列表 |
| pileIds | Array<Long> | N | 充电桩id列表 |
| connectorIdList | Array<Long> | N | 枪口id列表 |
| connectorCodeList | Array<String> | N | 枪口号列表 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| -------- | -------------------------- | -------- | ------------ |
| pageNum | Number | Y | 页码 |
| pageSize | Number | Y | 每页数量 |
| list | Array<PileConnectorInfoVO> | Y | 充电枪口对象 |
| total | Number | Y | 总数 |
| pages | Number | Y | 总页数 |
### PileConnectorInfoVO
| 字段名 | 类型 | 是否必传 | 备注 |
| ------------------ | ---------- | :------: | ------------------------------------------------------------ |
| connectorId | String | Y | 充电枪口id |
| connectorCode | String | Y | 枪口编号 |
| connectorQrCodeUrl | String | Y | 枪口二维码 |
| status | Number | Y | 状态 0离网 (默认)1空闲2占用未充电3占用充电中4占用预约锁定 255故障 |
| stationId | String | Y | 站点id |
| merchantId | String | Y | 运营商id |
| merchantName | String | Y | 运营商名称 |
| pileSn | String | Y | 充电桩编号 |
| type | String | Y | 类型 1-直流接口 汽车桩+快充 2-交流接口 汽车桩+慢充 3-插座接口 电单车桩 |
| instantPower | BigDecimal | Y | 即时功率 |
| electricity | BigDecimal | Y | 电量 |
| equipmentOrderNum | String | Y | 设备订单号 |
| platformOrderNum | String | Y | 平台订单 |
| chargingTime | String | Y | 充电时长 |
| voltage | BigDecimal | Y | 电压 |
| current | BigDecimal | Y | 电流 |
| gunLineTemperature | String | Y | 枪线温度 |
| userInfo | String | Y | 用户信息 |
| orderId | String | Y | 订单id |
| carNo | String | Y | 车牌号 |
| soc | String | Y | SOC |
| chargingAmount | BigDecimal | Y | 充电金额 |
| chargingDegree | BigDecimal | Y | 充电度数 |
| businessType | | y | 经营类型1-运营桩2-个人桩) |
### 示例:
```json
#
{
"pageNum": 1,
"pageSize":10,
"connectorIdList":[1]
}
#
{
"resCode": "00100000",
"msg": "操作成功",
"obj": {
"pageNum": 1,
"pageSize": 10,
"list": [
{
"connectorId": "1",
"connectorCode": "8800000000000101",
"connectorQrCodeUrl": "http://localhost/pileConnectorInfo&code=8800000000000101",
"status": 0,
"stationId": "2",
"merchantId": "5",
"merchantName": "举视(上海)新能源科技有限公司",
"pileSn": "88000000000001",
"type": "2",
"instantPower": 0.00,
"electricity": null,
"equipmentOrderNum": null,
"platformOrderNum": null,
"chargingTime": null,
"voltage": 0.0,
"current": 0.0,
"gunLineTemperature": "0",
"userInfo": null,
"orderId": null,
"carNo": null,
"chargingAmount": 0.00,
"chargingDegree": 0.00,
"soc": "0"
}
],
"total": 1,
"pages": 1
}
}
```
## 4001 启动充电
> 接口地址http://localhost:8080/uniapp/order/generateOrder
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | --------------------------- |
| pileSn | String | Y | 桩编码 |
| connectorCode | String | Y | 枪口号 |
| pileConnectorCode | String | Y | 桩枪口编号(桩编码+枪口号) |
| memToken | String | Y | 用户token写在Header中 |
备注pileSn + connectorCode 或 pileConnectorCode 选其一,接口都支持
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | ------ |
| orderCode | String | Y | 订单号 |
## 4002 结束充电
> 接口地址http://localhost:8080/uniapp/order/settleOrder
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | --------------------------- |
| orderCode | String | Y | 订单号 |
| pileSn | String | Y | 桩编码 |
| connectorCode | String | Y | 枪口号 |
| pileConnectorCode | String | Y | 桩枪口编号(桩编码+枪口号) |
### 反参
null若成功msg中会有“==操作成功==”提示
## 5001 查询订单列表
> 请求地址http://localhost:8080/uniapp/order/getOrderList
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | --------------------------- |
| memberId | String | Y | 会员id |
| pageSize | Number | Y | |
| pageNum | Number | Y | |
| orderStatus | String | Y | 订单状态 1-全部 2-未完成 3-已完成 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | --------------------------- |
| orderCode | String | Y | 订单号 |
| pileSn | String | Y | 桩编码 |
| connectorCode | String | Y | 枪口号 |
| stationName | String | Y | 站点名称 |
| pileConnectorCode | String | Y | 桩枪口编号(桩编码+枪口号) |
| chargingDegree | BigDecimal | Y | 充电度数|
| orderAmount | BigDecimal | Y | 订单金额 |
| orderStatus | String | Y | 订单状态(0-待支付1-充电中2-待结算3-待补缴4-异常5-可疑6-订单完成) |
| startTime | String | Y | 订单开始时间 |
| endTime | String | Y | 订单结束时间 |
| payAmount | BigDecimal | Y | 用户支付金额 |
| payStatus | String | Y | 支付状态(0-待支付1-支付完成) |
| reason | String | Y | 订单异常原因 |
## 60001 查询余额明细
> 请求地址: http://localhost:8080/uniapp/member/getMemberBalanceChanges
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------- | ------ | -------- | ------------------------ |
| memberToken | String | Y | 会员令牌 |
| type | String | Y | 交易类型 1-进账2-出账 |
| pageSize | | | |
| pageNum | | | |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| ------------------ | ------ | -------- | -------------------------- |
| memberId | String | Y | 会员Id |
| principalBalance | Number | Y | 当前账户本金余额 |
| giftBalance | Number | Y | 当前账户赠送余额 |
| totalAccountAmount | Number | Y | 账户总余额 |
| type | String | Y | 交易类型 1-进账2-出账 |
| subType | String | Y | 子类型 |
| amount | String | Y | 出账/入账金额 |
| transactionTime | String | Y | 交易时间 |
| category | String | Y | 余额类型1-本金2-赠送) |
## 7001 生成订单
> 请求地址http://localhost:8080/uniapp/order/generateOrder
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | ---------- |
| pileConnectorCode | String | Y | 桩枪口编码 |
| chargeAmount | Number | Y | 充电金额 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | ------ |
| orderCode | String | Y | 订单号 |
## 7002 支付订单
> 请求地址http://localhost:8080/uniapp/pay/payOrder
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | -------- |
| orderCode | String | Y | 订单号 |
| payMode | String | Y | 支付方式 |
| payAmount | String | Y | 支付金额 |
### 反参
null提示”==操作成功==“
## 7003 订单停止充电
> 请求地址http://localhost:8080/uniapp/order/stopCharging
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | ------ |
| orderCode | String | Y | 订单号 |
### 反参
null提示”==操作成功==“
# 首页大数据展示
## 8001 概况
> 请求地址http://localhost:8080/index/getGeneralSituation
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | ------ |
| stationId | String | N | 站点id |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------------------- | ------ | -------- | ---------- |
| totalChargingDegree | String | Y | 总充电电量 |
| totalChargingAmount | String | Y | 总充电费用 |
| totalChargingQuantity | String | Y | 总充电笔数 |
| totalPileQuantity | String | Y | 总设备数量 |
| totalMemberAmount | String | Y | 总客户余额 |
## 8002 订单
> 请求地址http://localhost:8080/index/getOrderInfo
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| --------- | ------ | -------- | ------ |
| stationId | String | N | 站点id |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| -------------------------- | ------ | -------- | -------------- |
| date | String | Y | 日期 |
| totalElectricity | String | Y | 总用电量 |
| totalOrderAmount | String | Y | 总订单金额 |
| totalSharpUsedElectricity | String | Y | 尖时段总用电量 |
| totalPeakUsedElectricity | String | Y | 峰时段总用电量 |
| totalFlatUsedElectricity | String | Y | 平时段总用电量 |
| totalValleyUsedElectricity | String | Y | 谷时段总用电量 |
# 个人桩相关
## 9001 用户绑定个人桩
> 请求地址: http://localhost:8080/uniapp/personalPile/pileMemberBinding
>
> 请求方式: POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ---------------- | ------ | -------- | -------------- |
| pileSn | String | Y | 桩编码 |
| phoneNumber | String | Y | 用户手机号码 |
| verificationCode | String | Y | 用户手机验证码 |
### 反参
## 9002 桩管理员下发给其他用户
> 请求地址http://localhost:8080/uniapp/personalPile/adminIssuePile
>
> 请求方式: POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------- | ------ | -------- | -------------------- |
| PileSn | String | Y | 桩编码 |
| phoneNumber | String | Y | 另一个用户的手机号码 |
## 9003 获取个人桩列表
> 请求地址: http://localhost:8080/uniapp/personalPile/getPersonalPileList
>
> 请求方式: GET
### 反参
### List<PersonalPileInfoVO>
| 字段名 | 类型 | 是否必传 | 备注 |
| ------------ | ------ | -------- | ---------------------------- |
| pileSn | String | Y | 桩编码 |
| connectorNum | String | Y | 枪口数量==(2023.02.23新增)== |
| memberId | String | Y | 会员id |
| type | String | Y | 身份类型 |
| modelName | String | Y | 型号 |
| ratedPower | String | Y | 额定功率 |
| ratedCurrent | String | Y | 额定电流 |
| ratedVoltage | String | Y | 额定电压 |
| speedType | String | Y | 充电类型 |
## 9004 获取枪口实时数据
> 请求地址http://localhost:8080/uniapp/personalPile/getConnectorRealTimeInfo
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | -------- |
| pileConnectorCode | String | Y | 桩枪口号 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| -------------- | ------ | -------- | -------- |
| instantCurrent | Number | Y | 实时电流 |
| instantVoltage | Number | Y | 实时电压 |
| instantPower | Number | Y | 实时功率 |
## 9005 累积充电量数据
> 请求地址http://localhost:8080/uniapp/personalPile/getAccumulativeInfo
>
> 请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | -------- |
| pileConnectorCode | String | Y | 桩枪口号 |
| startTime | String | Y | 开始日期 |
| endTime | String | Y | 结束日期 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| ---------------------- | ------ | -------- | ------------ |
| memberId | String | Y | 会员id |
| startTime | String | Y | 开始日期 |
| endTime | String | Y | 结束日期 |
| sumChargingElectricity | String | Y | 累计充电量 |
| sumChargingTime | String | Y | 累计充电时长 |
## 9006 充电记录
请求地址http://localhost:8080/uniapp/personalPile/getChargingRecord
请求方式POST
### 入参
| 字段名 | 类型 | 是否必传 | 备注 |
| ----------------- | ------ | -------- | -------- |
| pileConnectorCode | String | Y | 桩枪口号 |
| pageNum | Number | Y | 页码 |
| pageSize | Number | Y | 每页数量 |
### 反参
| 字段名 | 类型 | 是否必传 | 备注 |
| ------------------- | ------ | -------- | -------- |
| startChargingTime | String | Y | 启动时间 |
| endChargingTime | String | Y | 结束时间 |
| chargingElectricity | String | Y | 用电量 |
| chargingTime | String | Y | 充电时长 |