Skip to content

Commit

Permalink
Merge pull request #2 from quan-CN/quan-dev
Browse files Browse the repository at this point in the history
优化获取用户好友申请列表接口(游标分页优化)、在线swagger文档添加Authorization选项
  • Loading branch information
danmuking authored Apr 5, 2024
2 parents 80792a3 + 19dcda7 commit 9808d43
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 66 deletions.
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"
}
}
}
27 changes: 7 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ go 1.22.1

require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-gonic/gin v1.9.1
github.com/gorilla/websocket v1.5.1
github.com/jinzhu/copier v0.4.0
github.com/pkg/errors v0.9.1
github.com/spf13/viper v1.18.2
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0
github.com/swaggo/swag v1.16.3
gorm.io/driver/mysql v1.5.6
gorm.io/gen v0.3.25
gorm.io/gorm v1.25.9
gorm.io/plugin/dbresolver v1.5.1
Expand All @@ -14,17 +21,12 @@ require (
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.2.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/bytedance/sonic v1.11.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
Expand All @@ -34,9 +36,7 @@ require (
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -51,25 +51,15 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/swaggo/files v1.0.1 // indirect
github.com/swaggo/gin-swagger v1.6.0 // indirect
github.com/swaggo/swag v1.16.3 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/urfave/cli/v2 v2.27.1 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
Expand All @@ -81,11 +71,8 @@ require (
golang.org/x/tools v0.19.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/datatypes v1.2.0 // indirect
gorm.io/driver/mysql v1.5.6 // indirect
gorm.io/driver/sqlite v1.5.5 // indirect
gorm.io/hints v1.1.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 9808d43

Please sign in to comment.