2024-02-04 16:37:11 +08:00
|
|
|
|
# d2admin-service
|
|
|
|
|
|
2024-02-04 16:57:33 +08:00
|
|
|
|
#### 项目说明
|
|
|
|
|
|
|
|
|
|
```text
|
2024-02-04 16:45:36 +08:00
|
|
|
|
前端:https://gitee.com/d2-projects/d2-admin-start-kit
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
|
|
|
|
后端:从零开始。无依赖Casbin,无二次封装,适合学习。
|
|
|
|
|
```
|
2024-02-04 16:45:36 +08:00
|
|
|
|
|
|
|
|
|
### 文档地址
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
```text
|
|
|
|
|
# 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-02-04 19:15:00 +08:00
|
|
|
|
### 结构说明
|
|
|
|
|
```text
|
|
|
|
|
1、所有API接口必须在"src/infra/bind_api.go"上定义与"gin.HandlerFunc"的绑定关系
|
2024-02-06 10:26:33 +08:00
|
|
|
|
2、所有API接口必须在"system_api"表中定义
|
2024-02-04 19:15:00 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
### golang版本
|
2024-02-04 16:57:33 +08:00
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
```text
|
|
|
|
|
go1.21.5 darwin/amd64
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 安装依赖并启动
|
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-02-04 16:57:33 +08:00
|
|
|
|
|
2024-02-04 16:45:36 +08:00
|
|
|
|
```bash
|
|
|
|
|
go build -o d2admin-service
|
|
|
|
|
```
|