Skip to content

Commit

Permalink
update swagger doc
Browse files Browse the repository at this point in the history
  • Loading branch information
golangisfun123 committed May 1, 2024
1 parent 652b099 commit d390ea0
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 0 deletions.
43 changes: 43 additions & 0 deletions contrib/screener-api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,54 @@ const docTemplate = `{
"name": "signature",
"in": "header",
"required": true
},
{
"description": "Blacklist request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/db.BlacklistedAddress"
}
}
],
"responses": {}
}
}
},
"definitions": {
"db.BlacklistedAddress": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"data": {
"type": "string"
},
"id": {
"type": "string"
},
"network": {
"type": "string"
},
"remark": {
"type": "string"
},
"tag": {
"type": "string"
},
"typereq": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
}
}`

Expand Down
43 changes: 43 additions & 0 deletions contrib/screener-api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,53 @@
"name": "signature",
"in": "header",
"required": true
},
{
"description": "Blacklist request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/db.BlacklistedAddress"
}
}
],
"responses": {}
}
}
},
"definitions": {
"db.BlacklistedAddress": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"data": {
"type": "string"
},
"id": {
"type": "string"
},
"network": {
"type": "string"
},
"remark": {
"type": "string"
},
"tag": {
"type": "string"
},
"typereq": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
}
}
28 changes: 28 additions & 0 deletions contrib/screener-api/docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
definitions:
db.BlacklistedAddress:
properties:
address:
type: string
createdAt:
type: string
data:
type: string
id:
type: string
network:
type: string
remark:
type: string
tag:
type: string
typereq:
type: string
updatedAt:
type: string
type: object
info:
contact: {}
paths:
Expand Down Expand Up @@ -32,6 +54,12 @@ paths:
name: signature
required: true
type: string
- description: Blacklist request
in: body
name: request
required: true
schema:
$ref: '#/definitions/db.BlacklistedAddress'
produces:
- application/json
responses: {}
Expand Down
1 change: 1 addition & 0 deletions contrib/screener-api/screener/screener.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (s *screenerImpl) fetchBlacklist(ctx context.Context) {
// @Param nonce header string true "A unique nonce for the request"
// @Param queryString header string true "Query string parameters included in the request"
// @Param signature header string true "Signature for request validation"
// @Param request body db.BlacklistedAddress true "Blacklist request"
// @Accept json
// @Produce json
// @Router /api/data/sync [post].
Expand Down

0 comments on commit d390ea0

Please sign in to comment.