Adds new API/Editor endpoint to deal with created packages - get methods
This commit is contained in:
49
src/Umbraco.Web/Editors/PackageController.cs
Normal file
49
src/Umbraco.Web/Editors/PackageController.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using umbraco.cms.businesslogic.packager;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
{
|
||||
/// <summary>
|
||||
/// A controller used for installing packages and managing all of the data in the packages section in the back office
|
||||
/// </summary>
|
||||
[PluginController("UmbracoApi")]
|
||||
[UmbracoApplicationAuthorize(Core.Constants.Applications.Packages)]
|
||||
public class PackageController : UmbracoAuthorizedJsonController
|
||||
{
|
||||
[HttpGet]
|
||||
public List<CreatedPackage> GetCreatedPackages()
|
||||
{
|
||||
//TODO: Packager stuff still lives in business logic - YUK
|
||||
//TODO: Could be too much data down the wire
|
||||
return CreatedPackage.GetAllCreatedPackages();
|
||||
|
||||
/*
|
||||
* "author": "Test",
|
||||
"files": [],
|
||||
"iconUrl": "",
|
||||
"id": 1,
|
||||
"license": "MIT License",
|
||||
"licenseUrl": "http://opensource.org/licenses/MIT",
|
||||
"name": "Test v8",
|
||||
"url": "https://test.com",
|
||||
"version": "0.0.0"
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public CreatedPackage GetCreatedPackageById(int id)
|
||||
{
|
||||
return CreatedPackage.GetById(id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -111,6 +111,7 @@
|
||||
<Compile Include="Cache\UserGroupCacheRefresher.cs" />
|
||||
<Compile Include="Components\BackOfficeUserAuditEventsComponent.cs" />
|
||||
<Compile Include="Editors\BackOfficePreviewModel.cs" />
|
||||
<Compile Include="Editors\PackageController.cs" />
|
||||
<Compile Include="Logging\WebProfiler.cs" />
|
||||
<Compile Include="Logging\WebProfilerComponent.cs" />
|
||||
<Compile Include="Logging\WebProfilerProvider.cs" />
|
||||
|
||||
Reference in New Issue
Block a user