4bedf58a039a07682553b9455fe6aaea14a97792
feedsystem_video_go
项目简介
一款基于Go语言的视频feed流系统。
目录结构
cmd/:程序入口(main.go)。configs/:YAML 配置文件(config.yaml)。internal/:核心逻辑account/账号模型、仓储、服务config/YAML 配置加载db/MySQL 连接与迁移http/Gin 路由与 handler
test/:Postman Collection(account.json)start.sh:自定义启动脚本
快速开始
- 准备 Go 1.24+、MySQL 8+ 环境。
- 创建
feedsystem数据库,按需修改configs/config.yaml。 - 安装依赖:
go mod tidy。 - 启动服务:
go run ./cmd(或sh start.sh)。 - 导入
test/account.json,设置host=http://localhost:8080可快速调接口。
API
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /account/register |
username,password 创建账号 |
| POST | /account/rename |
id,new_username 修改账号名 |
| POST | /account/changePassword |
id,new_password 修改密码 |
| POST | /account/findByID |
id 查询账号 |
| POST | /account/findByUsername |
username 查询账号 |
- 接口统一使用 JSON 请求/响应。
- 启动时自动执行
db.AutoMigrate,保持用户表结构一致。
Description
Languages
Go
81.8%
TypeScript
12.9%
Shell
2.7%
CSS
1.7%
Dockerfile
0.8%
Other
0.1%