2019-08-15 12:04:42 +00:00
|
|
|
|
using System.Collections.Generic;
|
2019-08-08 09:26:58 +00:00
|
|
|
|
using ASC.Core;
|
2019-05-30 07:33:38 +00:00
|
|
|
|
using ASC.Web.Api.Routing;
|
2019-06-10 12:17:45 +00:00
|
|
|
|
using ASC.Web.Core;
|
|
|
|
|
using ASC.Web.Core.WebZones;
|
2019-05-15 14:56:09 +00:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2019-10-31 13:54:43 +00:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2019-06-10 12:17:45 +00:00
|
|
|
|
|
2019-05-15 14:56:09 +00:00
|
|
|
|
namespace ASC.Web.Api.Controllers
|
|
|
|
|
{
|
2019-05-30 07:33:38 +00:00
|
|
|
|
[DefaultRoute]
|
2019-05-15 14:56:09 +00:00
|
|
|
|
[ApiController]
|
|
|
|
|
public class ModulesController : ControllerBase
|
2019-09-09 12:56:33 +00:00
|
|
|
|
{
|
|
|
|
|
public UserManager UserManager { get; }
|
|
|
|
|
public TenantManager TenantManager { get; }
|
2019-09-11 10:42:52 +00:00
|
|
|
|
public WebItemManagerSecurity WebItemManagerSecurity { get; }
|
2019-09-09 12:56:33 +00:00
|
|
|
|
|
|
|
|
|
public ModulesController(
|
2019-10-31 13:54:43 +00:00
|
|
|
|
UserManager userManager,
|
|
|
|
|
TenantManager tenantManager,
|
2019-09-11 10:42:52 +00:00
|
|
|
|
WebItemManagerSecurity webItemManagerSecurity)
|
2019-09-09 12:56:33 +00:00
|
|
|
|
{
|
|
|
|
|
UserManager = userManager;
|
|
|
|
|
TenantManager = tenantManager;
|
2019-09-11 10:42:52 +00:00
|
|
|
|
WebItemManagerSecurity = webItemManagerSecurity;
|
2019-09-09 12:56:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-25 10:46:10 +00:00
|
|
|
|
[Read]
|
2019-07-05 13:58:04 +00:00
|
|
|
|
public IEnumerable<string> GetAll()
|
2019-06-10 12:17:45 +00:00
|
|
|
|
{
|
2019-07-05 13:58:04 +00:00
|
|
|
|
var result = new List<string>();
|
2019-06-10 12:17:45 +00:00
|
|
|
|
|
2019-09-16 14:51:39 +00:00
|
|
|
|
foreach (var a in WebItemManagerSecurity.GetItems(WebZoneType.StartProductList))
|
2019-06-10 12:17:45 +00:00
|
|
|
|
{
|
2019-07-05 13:58:04 +00:00
|
|
|
|
result.Add(a.ApiURL);
|
2019-06-10 12:17:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
2019-05-15 14:56:09 +00:00
|
|
|
|
}
|
2019-10-31 13:54:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class ModulesControllerExtension
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddModulesController(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
return services
|
|
|
|
|
.AddUserManagerService()
|
|
|
|
|
.AddTenantManagerService()
|
|
|
|
|
.AddWebItemManagerSecurity();
|
|
|
|
|
}
|
2019-05-15 14:56:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|