Files
platform/README.md

98 lines
2.1 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.
## todo
核心流程:
- [x] 注册与登录
- [ ] 对接接口
- [ ] 人机风险分级验证
- [ ] jwt 签发
- [x] 鉴权
- [x] 实名认证
- [x] 对接接口
- [x] 充值或购买
- [ ] 对接接口
- [ ] 提取记录
- [x] 提取 IP
- [ ] 长效提取
- [ ] 使用记录
- [x] 连接
中间件:
- [ ] Limiter
- [ ] Compress
错误处理类型转换失败问题
transition 服务,查询后立即完成,提供是否访问接口参数,统一主动与回调调用
callback 结果直接由 api 端提供,不通过前端转发
统一套餐创建逻辑
删除账单的状态字段,状态从关联表中计算获得
统一简化包导入别名
更新数据库填充
检查数据库枚举字段0 值只作为空值使用
实现开发时迁移脚本:
- 检查 sql 注释
- 执行迁移
- 如果有必要则填充数据
查端口需要通过外部接口实现,防止不同环境下的端口覆盖。提供一个额外的简便方法用来实现端口覆盖
业务代码和测试代码共用的控制变量可以优化为环境变量
channel 优化:
- 重新梳理逻辑流程,简化循环
- 端口分配时加锁
- 数据存入顺序,数据库 > 缓存 > 外部接口
用对称加密处理密钥
考虑将鉴权逻辑放到 handler 里,统一动静态鉴权以及解耦服务层
环境变量配置默认会话配置
oauth token 验证授权范围
保存 session 到数据库
## 环境变量和脚本
在 init/env 中有定义和默认值
开发环境数据库迁移:
```powershell
pg-schema-diff apply --schema-dir .\scripts\sql --dsn "host=localhost user=test password=test dbname=app port=5432 sslmode=disable TimeZone=Asia/Shanghai"
```
## 枚举字典
### 产品
| 代码 | 缩写 | 产品 |
|----------------------|-----|------|
| proxy/shared-static | pss | 动态代理 |
| proxy/shared-rotate | psr | 隧道代理 |
| proxy/private-static | pps | 独享代理 |
### 订单类型
| 枚举 | 说明 |
|----|------|
| 1 | 充值余额 |
| 2 | 直接购买 |
### 外部服务
服务器ip 110.40.82.248
api账密api:123456
## 业务逻辑