Files
platform/README.md

61 lines
1.8 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
- 长效业务接入
- 页面 账户总览
- 页面 提取记录
- 页面 使用记录
- 代理数据表的 secret 字段 aes 加密存储
- globals 合并到 services 或者反之
- 自定义的服务错误没有必要,可以统一在 handler 层使用包装的 fiber.Error
- 公众号的到期提示
### 下阶段
- 支付回调处理
- 保存 session 到数据库
- 扩展 device 权限验证方式,提供一种方法区分内部和外部服务
- 废弃 password 授权模式,迁移到 authorization code 授权模式
- oauth token 验证授权范围
- 实现白银节点的 warp 服务,用来去重与端口分配,保证测试与生产环境不会产生端口竞争
- 增加 domain 层,缓解同包字段过长的问题
- callback 结果直接由 api 端提供,不通过前端转发
- debug白银节点提供一些工具接口方便快速操作
- 批量下线端口
- 统一使用 validator 进行参数验证
- 格式化控制台输出
### 长期
- 业务代码和测试代码共用的控制变量可以优化为环境变量
- 考虑统计接口调用频率并通过接口展示
- 考虑登录时曾经输入过验证码的用户,登录成功后允许一段时间内免输验证码
## 环境变量和脚本
在 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 | 直接购买 |
## 业务逻辑