2024-02-04 16:37:11 +08:00
|
|
|
|
# d2admin-service
|
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## 项目说明
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
本项目为一个前后端分离的应用,旨在提供一个简洁、易学的后端服务框架。
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
- **前端**: [D2 Admin Start Kit](https://gitee.com/d2-projects/d2-admin-start-kit)
|
|
|
|
|
- **后端**: 从零开始构建,无依赖Casbin,无二次封装,适合学习。
|
2024-02-04 16:45:36 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## 文档地址
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
- **Gin 框架**: [官方文档](https://gin-gonic.com/docs/quickstart)
|
|
|
|
|
- **GORM 框架**: [官方文档](https://gorm.io/zh_CN/docs/index.html)
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## 项目结构
|
2024-02-04 19:15:00 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
- **API 接口**:
|
|
|
|
|
- 所有 API 接口必须在 `src/infra/bind_api.go` 文件中定义,并与 `gin.HandlerFunc` 绑定。
|
|
|
|
|
- 所有 API 接口必须在数据库表 `system_api` 中定义。
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## Go 版本
|
|
|
|
|
|
|
|
|
|
- **版本**: go1.21.5 darwin/amd64
|
2024-02-04 16:45:36 +08:00
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## 安装依赖并启动
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
```bash
|
|
|
|
|
go mod tidy
|
|
|
|
|
go run main.go
|
|
|
|
|
```
|
|
|
|
|
|
2024-12-11 20:52:15 +08:00
|
|
|
|
## 构建
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
```bash
|
|
|
|
|
go build -o d2admin-service
|
2024-12-11 20:52:15 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 贡献指南
|
|
|
|
|
|
|
|
|
|
欢迎贡献代码!请遵循以下步骤:
|
|
|
|
|
|
|
|
|
|
1. **Fork 仓库**
|
|
|
|
|
2. **创建新分支**: `git checkout -b feature/your-feature`
|
|
|
|
|
3. **提交更改**: `git commit -m 'Add some feature'`
|
|
|
|
|
4. **推送分支**: `git push origin feature/your-feature`
|
|
|
|
|
5. **发起 Pull Request**
|
|
|
|
|
|
|
|
|
|
## 许可证
|
|
|
|
|
|
|
|
|
|
本项目采用 [MIT License](LICENSE) 许可证。
|