diff --git a/server/docs/docs.go b/server/docs/docs.go index b168c30..094752b 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -143,7 +143,7 @@ const docTemplate = `{ "summary": "Get HTML of magnet links", "responses": { "200": { - "description": "Magnet links" + "description": "HTML with Magnet links" } } } @@ -352,7 +352,7 @@ const docTemplate = `{ "summary": "Get / Set server settings", "parameters": [ { - "description": "Settings request", + "description": "Settings request. Available params for action: get, set, def", "name": "request", "in": "body", "required": true, @@ -363,7 +363,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "Depends on what action has been asked", + "description": "Settings JSON or nothing. Depends on what action has been asked.", "schema": { "$ref": "#/definitions/settings.BTSets" } @@ -387,17 +387,17 @@ const docTemplate = `{ }, "/stat": { "get": { - "description": "Stat server.", + "description": "Show server and torrents statistics.", "produces": [ "text/plain" ], "tags": [ "Pages" ], - "summary": "Stat server", + "summary": "TorrServer Statistics", "responses": { "200": { - "description": "Stats" + "description": "TorrServer statistics" } } } @@ -500,7 +500,7 @@ const docTemplate = `{ "tags": [ "API" ], - "summary": "Only one file support", + "summary": "Add .torrent file", "parameters": [ { "type": "file", @@ -552,7 +552,7 @@ const docTemplate = `{ }, "/torrents": { "post": { - "description": "Allow to add, get or set torrents to server. The action depends of what has been asked.", + "description": "Allow to list, add, remove, get, set, drop, wipe torrents on server. The action depends of what has been asked.", "consumes": [ "application/json" ], @@ -565,7 +565,7 @@ const docTemplate = `{ "summary": "Handle torrents informations", "parameters": [ { - "description": "Torrent request", + "description": "Torrent request. Available params for action: add, get, set, rem, list, drop, wipe. link required for add, hash required for get, set, rem, drop.", "name": "request", "in": "body", "required": true, @@ -596,7 +596,7 @@ const docTemplate = `{ "summary": "Set / List / Remove viewed torrents", "parameters": [ { - "description": "Viewed torrent request", + "description": "Viewed torrent request. Available params for action: set, rem, list", "name": "request", "in": "body", "required": true, diff --git a/server/docs/swagger.json b/server/docs/swagger.json index 984a495..fd3344c 100644 --- a/server/docs/swagger.json +++ b/server/docs/swagger.json @@ -136,7 +136,7 @@ "summary": "Get HTML of magnet links", "responses": { "200": { - "description": "Magnet links" + "description": "HTML with Magnet links" } } } @@ -345,7 +345,7 @@ "summary": "Get / Set server settings", "parameters": [ { - "description": "Settings request", + "description": "Settings request. Available params for action: get, set, def", "name": "request", "in": "body", "required": true, @@ -356,7 +356,7 @@ ], "responses": { "200": { - "description": "Depends on what action has been asked", + "description": "Settings JSON or nothing. Depends on what action has been asked.", "schema": { "$ref": "#/definitions/settings.BTSets" } @@ -380,17 +380,17 @@ }, "/stat": { "get": { - "description": "Stat server.", + "description": "Show server and torrents statistics.", "produces": [ "text/plain" ], "tags": [ "Pages" ], - "summary": "Stat server", + "summary": "TorrServer Statistics", "responses": { "200": { - "description": "Stats" + "description": "TorrServer statistics" } } } @@ -493,7 +493,7 @@ "tags": [ "API" ], - "summary": "Only one file support", + "summary": "Add .torrent file", "parameters": [ { "type": "file", @@ -545,7 +545,7 @@ }, "/torrents": { "post": { - "description": "Allow to add, get or set torrents to server. The action depends of what has been asked.", + "description": "Allow to list, add, remove, get, set, drop, wipe torrents on server. The action depends of what has been asked.", "consumes": [ "application/json" ], @@ -558,7 +558,7 @@ "summary": "Handle torrents informations", "parameters": [ { - "description": "Torrent request", + "description": "Torrent request. Available params for action: add, get, set, rem, list, drop, wipe. link required for add, hash required for get, set, rem, drop.", "name": "request", "in": "body", "required": true, @@ -589,7 +589,7 @@ "summary": "Set / List / Remove viewed torrents", "parameters": [ { - "description": "Viewed torrent request", + "description": "Viewed torrent request. Available params for action: set, rem, list", "name": "request", "in": "body", "required": true, diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml index 1c22d04..e0a81ec 100644 --- a/server/docs/swagger.yaml +++ b/server/docs/swagger.yaml @@ -393,7 +393,7 @@ paths: - text/html responses: "200": - description: Magnet links + description: HTML with Magnet links summary: Get HTML of magnet links tags: - Pages @@ -527,7 +527,7 @@ paths: - application/json description: Allow to get or set server settings. parameters: - - description: Settings request + - description: 'Settings request. Available params for action: get, set, def' in: body name: request required: true @@ -537,7 +537,7 @@ paths: - application/json responses: "200": - description: Depends on what action has been asked + description: Settings JSON or nothing. Depends on what action has been asked. schema: $ref: '#/definitions/settings.BTSets' summary: Get / Set server settings @@ -554,13 +554,13 @@ paths: - API /stat: get: - description: Stat server. + description: Show server and torrents statistics. produces: - text/plain responses: "200": - description: Stats - summary: Stat server + description: TorrServer statistics + summary: TorrServer Statistics tags: - Pages /stream: @@ -658,17 +658,19 @@ paths: description: Torrent status schema: $ref: '#/definitions/state.TorrentStatus' - summary: Only one file support + summary: Add .torrent file tags: - API /torrents: post: consumes: - application/json - description: Allow to add, get or set torrents to server. The action depends - of what has been asked. + description: Allow to list, add, remove, get, set, drop, wipe torrents on server. + The action depends of what has been asked. parameters: - - description: Torrent request + - description: 'Torrent request. Available params for action: add, get, set, + rem, list, drop, wipe. link required for add, hash required for get, set, + rem, drop.' in: body name: request required: true @@ -688,7 +690,8 @@ paths: - application/json description: Allow to set, list or remove viewed torrents from server. parameters: - - description: Viewed torrent request + - description: 'Viewed torrent request. Available params for action: set, rem, + list' in: body name: request required: true diff --git a/server/web/api/settings.go b/server/web/api/settings.go index 92b1418..16335e2 100644 --- a/server/web/api/settings.go +++ b/server/web/api/settings.go @@ -27,11 +27,11 @@ type setsReqJS struct { // // @Tags API // -// @Param request body setsReqJS true "Settings request" +// @Param request body setsReqJS true "Settings request. Available params for action: get, set, def" // // @Accept json // @Produce json -// @Success 200 {object} sets.BTSets "Depends on what action has been asked" +// @Success 200 {object} sets.BTSets "Settings JSON or nothing. Depends on what action has been asked." // @Router /settings [post] func settings(c *gin.Context) { var req setsReqJS diff --git a/server/web/api/torrents.go b/server/web/api/torrents.go index e334afb..3888339 100644 --- a/server/web/api/torrents.go +++ b/server/web/api/torrents.go @@ -30,11 +30,11 @@ type torrReqJS struct { // torrents godoc // // @Summary Handle torrents informations -// @Description Allow to add, get or set torrents to server. The action depends of what has been asked. +// @Description Allow to list, add, remove, get, set, drop, wipe torrents on server. The action depends of what has been asked. // // @Tags API // -// @Param request body torrReqJS true "Torrent request" +// @Param request body torrReqJS true "Torrent request. Available params for action: add, get, set, rem, list, drop, wipe. link required for add, hash required for get, set, rem, drop." // // @Accept json // @Produce json diff --git a/server/web/api/upload.go b/server/web/api/upload.go index f98445a..08a831e 100644 --- a/server/web/api/upload.go +++ b/server/web/api/upload.go @@ -12,7 +12,7 @@ import ( // torrentUpload godoc // -// @Summary Only one file support +// @Summary Add .torrent file // @Description Only one file support. // // @Tags API diff --git a/server/web/api/viewed.go b/server/web/api/viewed.go index fcacd5d..cd8a6b8 100644 --- a/server/web/api/viewed.go +++ b/server/web/api/viewed.go @@ -25,7 +25,7 @@ type viewedReqJS struct { // // @Tags API // -// @Param request body viewedReqJS true "Viewed torrent request" +// @Param request body viewedReqJS true "Viewed torrent request. Available params for action: set, rem, list" // // @Accept json // @Produce json diff --git a/server/web/pages/route.go b/server/web/pages/route.go index 3c2ad8f..7a7e6e9 100644 --- a/server/web/pages/route.go +++ b/server/web/pages/route.go @@ -31,13 +31,13 @@ func SetupRoute(route gin.IRouter) { // stat godoc // -// @Summary Stat server -// @Description Stat server. +// @Summary TorrServer Statistics +// @Description Show server and torrents statistics. // // @Tags Pages // // @Produce text/plain -// @Success 200 "Stats" +// @Success 200 "TorrServer statistics" // @Router /stat [get] func statPage(c *gin.Context) { torr.WriteStatus(c.Writer) @@ -52,7 +52,7 @@ func statPage(c *gin.Context) { // @Tags Pages // // @Produce text/html -// @Success 200 "Magnet links" +// @Success 200 "HTML with Magnet links" // @Router /magnets [get] func getTorrents(c *gin.Context) { list := settings.ListTorrent()