Files
updata_hfb/README.md
T
2026-07-23 13:03:47 +08:00

89 lines
1.7 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.
# updata_hfb
一个 Go 桌面 GUI 上传工具。用户打开程序后填写服务器、上传人、上传密钥,粘贴账号数据,点击“预览 JSON”或“上传”即可,不需要使用命令行参数。
## 本地运行
在项目根目录直接运行:
```bash
go run .
```
也可以运行 cmd 入口:
```bash
go run ./cmd/updata_hfb
```
启动后会打开窗口:
- `服务器`:默认 `http://127.0.0.1:8080`
- `上传人`:对应服务端的 `uploaderName`
- `上传密钥`:服务端外部上传密钥,未配置可留空
- `账号数据`:粘贴 `字段:值` 格式的数据
- `预览 JSON`:只转换,不上传
- `上传`:提交到服务端接口
## 文本格式
支持中文冒号 `` 和英文冒号 `:`
```text
上号方式:QQ扫码
哈夫币纯币:156
段位:铂金
等级:60
保险格数:9
每日消耗:10
体力:7
负重:7
AWM子弹数量:80
6头数量:13
6甲数量:12
皮肤:暗星
绝密KD0.2
押金:350
号主在线时间:11:00 至 00:00
封禁记录:无
常用地区:海南
回收比例:1:47.0
回收租金:332
联系电话:15203616450
```
## 环境变量
程序会读取这些环境变量作为窗口默认值:
- `HFB_SERVER`
- `HFB_UPLOADER_NAME`
- `HFB_UPLOAD_SECRET`
## 对接接口
- `POST /api/open/listing-uploads`
- 请求体是 JSON
- 如果填写上传密钥,会自动发送:
- `X-HFB-Timestamp`
- `X-HFB-Signature`
签名方式与服务端一致:`HMAC-SHA256(timestamp + "." + body)`
## 测试
```bash
go test ./...
go vet ./...
```
## 构建
当前 Mac
```bash
go build -o dist/updata_hfb ./cmd/updata_hfb
```
如果要给 Windows 打包,建议在 Windows 环境里构建,或者准备完整的 Fyne 交叉编译环境。