Skip to content

Commit

Permalink
优化获取用户好友申请列表接口(游标分页优化)、在线swagger文档添加Authorization选项
Browse files Browse the repository at this point in the history
  • Loading branch information
quan-CN committed Apr 5, 2024
2 parents f40c9cc + 80792a3 commit 19dcda7
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 139 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/reademe-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
push:
branches:
- main

name: Generate a list of contributors

jobs:
contrib-readme-en-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.CONTRIBUTORS_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ go.work
*.sql
*.yaml
/sql/
/conf/
/conf/config.yml
!/conf/config_example.yml
!/.github/workflows/reademe-contributors.yml
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,22 @@
| Swagger-UI | API文档生成工具 |https://github.com/swagger-api/swagger-ui|

### Star 趋势
[<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=danmuking/DiTing&amp;type=Date"/>]
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=danmuking/DiTing&amp;type=Date"/>

### 贡献者

请阅读**CONTRIBUTING.md** 查阅为该项目做出贡献的开发者。
<!-- readme: collaborators,contributors -start -->
<table>
<tr>
<td align="center">
<a href="https://github.com/danmuking">
<img src="https://avatars.githubusercontent.com/u/47711726?v=4" width="100;" alt="danmuking"/>
<br />
<sub><b>LinYi</b></sub>
</a>
</td></tr>
</table>
<!-- readme: collaborators,contributors -end -->


### 作者
Expand Down
7 changes: 7 additions & 0 deletions conf/config_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mysql:
host: xxx.xxx.xxx.xx
port: 3306
username: diting
password: diting
jwt:
secret: diting
84 changes: 83 additions & 1 deletion docs/docs.go

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

81 changes: 81 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,37 @@
}
},
"/api/contact/delete": {
"put": {
"produces": [
"application/json"
],
"summary": "同意好友申请",
"parameters": [
{
"description": "好友uid",
"name": "uid",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/resp.ResponseData"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/resp.ResponseData"
}
}
}
},
"delete": {
"produces": [
"application/json"
Expand Down Expand Up @@ -79,6 +110,49 @@
}
}
},
"/api/contact/getApplyList": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"produces": [
"application/json"
],
"summary": "获取用户好友申请列表",
"parameters": [
{
"type": "integer",
"description": "last_id",
"name": "last_id",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "limit",
"name": "limit",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/resp.ResponseData"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/resp.ResponseData"
}
}
}
}
},
"/api/public/login": {
"post": {
"produces": [
Expand Down Expand Up @@ -181,5 +255,12 @@
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
118 changes: 0 additions & 118 deletions docs/swagger.yaml

This file was deleted.

Loading

0 comments on commit 19dcda7

Please sign in to comment.