|
@@ -1,46 +1 @@
|
|
-```
|
|
|
|
-├── build //编译后
|
|
|
|
-├── cmd //启动命令文件
|
|
|
|
-├── internal //主要编码区域
|
|
|
|
-│ ├── common //框架本身文件
|
|
|
|
-│ └── module //模块,演示模块包括todo和user
|
|
|
|
-│ ├── todo
|
|
|
|
-│ │ ├── command //脚本文件
|
|
|
|
-│ │ ├── contract //契约,定义变量或结构体
|
|
|
|
-│ │ ├── external //外部调用service的入口
|
|
|
|
-│ │ ├── http //http相关文件,路由和控制器
|
|
|
|
-│ │ ├── model //model文件和dao文件
|
|
|
|
-│ │ └── service //service文件
|
|
|
|
-│ └── user
|
|
|
|
-│ ├── contract
|
|
|
|
-│ ├── external
|
|
|
|
-│ ├── http
|
|
|
|
-│ ├── model
|
|
|
|
-│ └── service
|
|
|
|
-└── vendor
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-- [x] 基础:http database config log
|
|
|
|
-- [x] 错误封装
|
|
|
|
-- [x] 脚本
|
|
|
|
-- [x] Redis
|
|
|
|
-- [x] Migrate https://github.com/golang-migrate/migrate/tree/master/cmd/migrate
|
|
|
|
-- [ ] Cache
|
|
|
|
-- [ ] Queue
|
|
|
|
-
|
|
|
|
-#### Migrate
|
|
|
|
-
|
|
|
|
-* 仓库:https://github.com/golang-migrate/migrate
|
|
|
|
-* 参考文章:https://zhuanlan.zhihu.com/p/69472163
|
|
|
|
-* migrate -verbose -source file://migrations -database mysql://root:root@tcp(127.0.0.1)/ppgo up
|
|
|
|
-
|
|
|
|
-#### Service
|
|
|
|
-
|
|
|
|
-* 调用方式
|
|
|
|
-
|
|
|
|
-```
|
|
|
|
- //拿到interface
|
|
|
|
- service := external.GetTodoService()
|
|
|
|
- TodoS := service.List(r)
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
|
|
+ppgo 个人使用的go快速开发脚手架
|