Adds new API/Editor endpoint to deal with created packages - get methods

This commit is contained in:
Warren Buckley
2018-12-06 09:50:05 +00:00
parent 046b35e242
commit 17d489bb54
2 changed files with 50 additions and 0 deletions

View 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);
}
}
}

View File

@@ -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" />