diff options
Diffstat (limited to 'src/slskd/API/Controllers/UserController.cs')
| -rw-r--r-- | src/slskd/API/Controllers/UserController.cs | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/slskd/API/Controllers/UserController.cs b/src/slskd/API/Controllers/UserController.cs index 73efca0f..1dd96f7a 100644 --- a/src/slskd/API/Controllers/UserController.cs +++ b/src/slskd/API/Controllers/UserController.cs @@ -1,16 +1,33 @@ -namespace slskd.API.Controllers +// <copyright file="UserController.cs" company="slskd Team"> +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// </copyright> + +namespace slskd.API.Controllers { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; - using Soulseek; using slskd.API.DTO; using slskd.Trackers; + using Soulseek; /// <summary> - /// Users + /// Users. /// </summary> [Route("api/v{version:apiVersion}/[controller]")] [ApiVersion("0")] @@ -30,8 +47,8 @@ BrowseTracker = browseTracker; } - private ISoulseekClient Client { get; } private IBrowseTracker BrowseTracker { get; } + private ISoulseekClient Client { get; } /// <summary> /// Retrieves the address of the specified <paramref name="username"/>. @@ -43,7 +60,7 @@ [Authorize] [ProducesResponseType(typeof(UserAddress), 200)] [ProducesResponseType(404)] - public async Task<IActionResult> Address([FromRoute, Required]string username) + public async Task<IActionResult> Address([FromRoute, Required] string username) { try { @@ -65,7 +82,7 @@ [Authorize] [ProducesResponseType(typeof(IEnumerable<Directory>), 200)] [ProducesResponseType(404)] - public async Task<IActionResult> Browse([FromRoute, Required]string username) + public async Task<IActionResult> Browse([FromRoute, Required] string username) { try { @@ -94,7 +111,7 @@ [Authorize] [ProducesResponseType(typeof(decimal), 200)] [ProducesResponseType(404)] - public IActionResult BrowseStatus([FromRoute, Required]string username) + public IActionResult BrowseStatus([FromRoute, Required] string username) { if (BrowseTracker.TryGet(username, out var progress)) { @@ -113,7 +130,7 @@ [Authorize] [ProducesResponseType(typeof(UserInfo), 200)] [ProducesResponseType(404)] - public async Task<IActionResult> Info([FromRoute, Required]string username) + public async Task<IActionResult> Info([FromRoute, Required] string username) { try { @@ -135,7 +152,7 @@ [Authorize] [ProducesResponseType(typeof(UserStatus), 200)] [ProducesResponseType(404)] - public async Task<IActionResult> Status([FromRoute, Required]string username) + public async Task<IActionResult> Status([FromRoute, Required] string username) { try { |
