-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b515043
Showing
29 changed files
with
3,724 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
on: # Apply to all pushes to `main` | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bufbuild/[email protected] | ||
with: | ||
github_token: ${{ github.token }} | ||
- uses: bufbuild/[email protected] | ||
with: | ||
buf_token: ${{ secrets.BUF_TOKEN }} | ||
breaking: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bufbuild/[email protected] | ||
with: | ||
github_token: ${{ github.token }} | ||
- uses: bufbuild/[email protected] | ||
with: | ||
against: 'https://github.com/juanjiTech/daya-proto.git#branch=main' | ||
buf_token: ${{ secrets.BUF_TOKEN }} | ||
generate: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: | ||
- lint | ||
- breaking | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 'stable' | ||
- run: go install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts | ||
- uses: bufbuild/[email protected] | ||
with: | ||
github_token: ${{ github.token }} | ||
- run: rm -rf ./gen && buf generate && go mod tidy | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'update: automatic generate new proto' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# daya-proto | ||
|
||
## 快速开始 | ||
|
||
1. 安装软件 | ||
- [buf](https://buf.build/docs/installation) 以及buf的IDE插件 | ||
- `go install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts` | ||
- `buf mod update` | ||
2. 修改proto | ||
3. 检查 `buf lint` | ||
4. 生成 `buf generate` | ||
|
||
## 相关文档 | ||
|
||
[OpenAPI 说明](https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_openapi_output/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# command: buf generate | ||
version: v1 | ||
plugins: | ||
- plugin: buf.build/protocolbuffers/go | ||
out: gen/proto | ||
opt: | ||
- paths=source_relative | ||
- plugin: buf.build/grpc/go | ||
out: gen/proto | ||
opt: | ||
- paths=source_relative | ||
- plugin: buf.build/grpc-ecosystem/gateway | ||
out: gen/proto | ||
opt: | ||
- paths=source_relative | ||
- plugin: buf.build/grpc-ecosystem/openapiv2 | ||
out: gen/openapi | ||
- name: grpc-gateway-ts | ||
out: gen/proto | ||
opt: | ||
- paths=source_relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: googleapis | ||
repository: googleapis | ||
commit: 28151c0d0a1641bf938a7672c500e01d | ||
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
version: v1 | ||
directories: | ||
- proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: v1 | ||
breaking: | ||
use: | ||
- FILE | ||
lint: | ||
use: | ||
- DEFAULT | ||
deps: | ||
- buf.build/googleapis/googleapis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "auth/v1/auth_service.proto", | ||
"version": "version not set" | ||
}, | ||
"tags": [ | ||
{ | ||
"name": "AuthService" | ||
} | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": { | ||
"/gapi/auth/v1/login": { | ||
"post": { | ||
"summary": "用户登录", | ||
"operationId": "AuthService_Login", | ||
"responses": { | ||
"200": { | ||
"description": "A successful response.", | ||
"schema": { | ||
"$ref": "#/definitions/v1LoginResponse" | ||
} | ||
}, | ||
"default": { | ||
"description": "An unexpected error response.", | ||
"schema": { | ||
"$ref": "#/definitions/rpcStatus" | ||
} | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "body", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/v1LoginRequest" | ||
} | ||
} | ||
], | ||
"tags": [ | ||
"AuthService" | ||
] | ||
} | ||
}, | ||
"/gapi/auth/v1/refreshToken": { | ||
"post": { | ||
"summary": "Token刷新", | ||
"operationId": "AuthService_RefreshToken", | ||
"responses": { | ||
"200": { | ||
"description": "A successful response.", | ||
"schema": { | ||
"$ref": "#/definitions/v1RefreshTokenResponse" | ||
} | ||
}, | ||
"default": { | ||
"description": "An unexpected error response.", | ||
"schema": { | ||
"$ref": "#/definitions/rpcStatus" | ||
} | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "body", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/v1RefreshTokenRequest" | ||
} | ||
} | ||
], | ||
"tags": [ | ||
"AuthService" | ||
] | ||
} | ||
}, | ||
"/gapi/auth/v1/register": { | ||
"post": { | ||
"summary": "用户注册", | ||
"operationId": "AuthService_Register", | ||
"responses": { | ||
"200": { | ||
"description": "A successful response.", | ||
"schema": { | ||
"$ref": "#/definitions/v1RegisterResponse" | ||
} | ||
}, | ||
"default": { | ||
"description": "An unexpected error response.", | ||
"schema": { | ||
"$ref": "#/definitions/rpcStatus" | ||
} | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "body", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/v1RegisterRequest" | ||
} | ||
} | ||
], | ||
"tags": [ | ||
"AuthService" | ||
] | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"protobufAny": { | ||
"type": "object", | ||
"properties": { | ||
"@type": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": {} | ||
}, | ||
"rpcStatus": { | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
}, | ||
"details": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "#/definitions/protobufAny" | ||
} | ||
} | ||
} | ||
}, | ||
"v1LoginRequest": { | ||
"type": "object", | ||
"properties": { | ||
"username": { | ||
"type": "string", | ||
"title": "账户 可为手机号或邮箱" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"twoFactorAuth": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1LoginResponse": { | ||
"type": "object", | ||
"properties": { | ||
"accessToken": { | ||
"type": "string" | ||
}, | ||
"refreshToken": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1RefreshTokenRequest": { | ||
"type": "object", | ||
"properties": { | ||
"refreshToken": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1RefreshTokenResponse": { | ||
"type": "object", | ||
"properties": { | ||
"accessToken": { | ||
"type": "string" | ||
}, | ||
"refreshToken": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1RegisterRequest": { | ||
"type": "object", | ||
"properties": { | ||
"email": { | ||
"type": "string" | ||
}, | ||
"verifyCode": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1RegisterResponse": { | ||
"type": "object", | ||
"properties": { | ||
"accessToken": { | ||
"type": "string" | ||
}, | ||
"refreshToken": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "user/v1/user.proto", | ||
"version": "version not set" | ||
}, | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": {}, | ||
"definitions": { | ||
"protobufAny": { | ||
"type": "object", | ||
"properties": { | ||
"@type": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": {} | ||
}, | ||
"rpcStatus": { | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
}, | ||
"details": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "#/definitions/protobufAny" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.