DocSpace-client/web/ASC.Web.Api/Controllers/ModulesController.cs

54 lines
1.3 KiB
C#
Raw Normal View History

2019-08-15 12:04:42 +00:00
using System.Collections.Generic;
2020-02-17 08:58:14 +00:00
2021-01-25 14:37:26 +00:00
using ASC.Api.Core;
2020-02-17 08:58:14 +00:00
using ASC.Common;
using ASC.Web.Api.Routing;
2019-06-10 12:17:45 +00:00
using ASC.Web.Core;
using ASC.Web.Core.WebZones;
2020-02-17 08:58:14 +00:00
using Microsoft.AspNetCore.Mvc;
namespace ASC.Web.Api.Controllers
{
2020-10-19 15:53:15 +00:00
[Scope]
2020-02-17 08:58:14 +00:00
[DefaultRoute]
[ApiController]
public class ModulesController : ControllerBase
2019-09-09 12:56:33 +00:00
{
2020-08-12 09:58:08 +00:00
private WebItemManagerSecurity WebItemManagerSecurity { get; }
2019-09-09 12:56:33 +00:00
public ModulesController(
WebItemManagerSecurity webItemManagerSecurity)
2019-09-09 12:56:33 +00:00
{
WebItemManagerSecurity = webItemManagerSecurity;
2019-09-09 12:56:33 +00:00
}
2020-02-17 08:58:14 +00:00
[Read]
public IEnumerable<string> GetAll()
2019-06-10 12:17:45 +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
{
result.Add(a.ApiURL);
2019-06-10 12:17:45 +00:00
}
2020-02-17 08:58:14 +00:00
return result;
}
2021-01-25 14:37:26 +00:00
[Read("info")]
public IEnumerable<Module> GetAllWithInfo()
{
foreach (var a in WebItemManagerSecurity.GetItems(WebZoneType.StartProductList))
{
if(a is Product product)
{
product.Init();
yield return new Module(product);
}
}
}
2019-10-31 13:54:43 +00:00
}
2020-02-17 08:58:14 +00:00
}