Skip to content

Commit

Permalink
Merge pull request #196 from rocboss/feature/mir
Browse files Browse the repository at this point in the history
引入go-mir重构paopao-ce的接入层与业务逻辑层
  • Loading branch information
alimy authored Jan 7, 2023
2 parents 03dba40 + 4efb9d0 commit e0d0e25
Show file tree
Hide file tree
Showing 305 changed files with 15,586 additions and 4,901 deletions.
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ windows-x64:
@echo Build paopao-ce [windows-x64] CGO_ENABLED=$(CGO_ENABLED)
@CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/$(basename $(TARGET)).exe

.PHONY: generate
generate: gen-mir gen-grpc

.PHONY: gen-mir
gen-mir:
@go generate mirc/main.go
@go fmt ./auto/api/...

.PHONY: gen-grpc
gen-grpc:
@rm -rf auto/rpc
@buf generate proto
@go fmt ./auto/rpc/...

.PHONY: proto-mod
proto-mod:
@cd proto/ && buf mod update

.PHONY: proto-lint
proto-lint:
@cd proto/ && buf lint

clean:
@go clean
@find ./release -type f -exec rm -r {} +
Expand All @@ -83,7 +105,15 @@ test:
@go test ./...

pre-commit: fmt
go mod tidy
@go mod tidy

.PHONY: install-protobuf-plugins
install-protobuf-plugins:
@go install github.com/bufbuild/buf/cmd/[email protected]
@go install github.com/bufbuild/buf/cmd/[email protected]
@go install github.com/bufbuild/buf/cmd/[email protected]
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

help:
@echo "make: make"
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ Web端:

## 🛠 技术栈

PaoPao主要由以下优秀的开源项目/工具构建

* [Go](https://go.dev/)
* [Gin](https://gin-gonic.com/)
* [Zinc](https://zinclabs.io/)
PaoPao主要由以下优秀的开源项目/工具构建
#### 后端:
* [Go](https://go.dev/ 'go')
* [Gin](https://gin-gonic.com/ 'gin')
* [Mir](https://github.com/alimy/mir 'go-mir')
* [Buf](https://github.com/bufbuild/buf 'buf')
* [gRPC](https://github.com/grpc/grpc-go 'grpc-go')
* [Zinc](https://zinclabs.io/ 'zinc')

#### 前端:
* [Naive UI](https://www.naiveui.com/)
* [Vue.js](https://vuejs.org/)
* [Vite.js](https://vitejs.dev/)
* [tauri](https://github.com/tauri-apps/tauri 'tauri')

<!-- GETTING STARTED -->
## 🏗 快速开始
Expand Down Expand Up @@ -316,13 +322,15 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
目前支持的功能集合:
| 功能项 | 类别 | 状态 | 备注 |
| ----- | ----- | ----- | ----- |
|`OldWeb` | 子服务 | 稳定(默认) | 开启旧的Web服务 |
|`Web` | 子服务 | WIP | 开启Web服务|
|`Web` | 子服务 | 内测 | 开启Web服务|
|`Admin` | 子服务 | WIP | 开启Admin后台运维服务|
|`SpaceX` | 子服务 | WIP | 开启SpaceX服务|
|`Bot` | 子服务 | WIP | 开启Bot服务|
|`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务|
|`Deprecated:Web` | 子服务 | 稳定 | Deprecated(关闭) OldWeb服务|
|`Docs` | 子服务 | WIP | 开启开发者文档服务|
|`Frontend:Web` | 子服务 | 内测 | 开启独立前端服务|
|`Frontend:EmbedWeb` | 子服务 | 内测 | 开启内嵌于后端Web API服务中的前端服务|
|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务|
|`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合|
|`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM|
|`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库|
Expand Down
13 changes: 6 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ paopao-ce roadmap.
### v0.2.0
* [x] add `Friendship` feature
* [ ] add `Lightship` feature
* [ ] add `sqlx` feature
* [ ] add new `web` service
* [ ] add `deprecated:web` feature
* [ ] support run multiple service in single paopao-ce instance
* [ ] use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture

* [ ] add `Sqlx` feature
* [x] add new `Web` service
* [x] add `Frontend:Web` feature
* [x] add `Deprecated:OldWeb` feature
* [x] support run multiple service in single paopao-ce instance
* [x] use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture

### Next
* [ ] add `Followship` feature
Expand All @@ -29,4 +29,3 @@ paopao-ce roadmap.
* [ ] optimize topics service
* [ ] optimize backend data logic service(optimize database CRUD operate)
* [ ] optimize search logic service

140 changes: 140 additions & 0 deletions auto/api/m/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 140 additions & 0 deletions auto/api/r/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e0d0e25

Please sign in to comment.