Initial Commit
This commit is contained in:
31
Server/DemoLibrary/Summit.ApiDemo.DemoLibrary.csproj
Normal file
31
Server/DemoLibrary/Summit.ApiDemo.DemoLibrary.csproj
Normal file
@@ -0,0 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Summit.ApiDemo.DemoLibrary</AssemblyName>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<OutputPath>..\..\bin</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<Authors>Peter Donker</Authors>
|
||||
<Company>Summit</Company>
|
||||
<Product>apidemo</Product>
|
||||
<Copyright>Copyright 2025 by Summit</Copyright>
|
||||
<PackageId>ApiDemo</PackageId>
|
||||
<AssemblyVersion>0.0.1</AssemblyVersion>
|
||||
<FileVersion>0.0.1</FileVersion>
|
||||
<Description>ApiDemo module</Description>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<ApplicationIcon />
|
||||
<OutputType>Library</OutputType>
|
||||
<StartupObject />
|
||||
<DebugType>Portable</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNetNuke.Abstractions" Version="10.0.0" />
|
||||
<PackageReference Include="DotNetNuke.Core" Version="10.0.0" />
|
||||
<PackageReference Include="DotNetNuke.WebApi" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
39
Server/DemoLibrary/TestController.cs
Normal file
39
Server/DemoLibrary/TestController.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using DotNetNuke.Web.Api;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
|
||||
namespace Summit.ApiDemo.DemoLibrary
|
||||
{
|
||||
public class TestController : DnnApiController, IServiceRouteMapper
|
||||
{
|
||||
public void RegisterRoutes(IMapRoute mapRouteManager)
|
||||
{
|
||||
mapRouteManager.MapHttpRoute(
|
||||
"Demo/DemoModule",
|
||||
"DemoModuleTestControllerMap1",
|
||||
"Test/{action}",
|
||||
new { Controller = "Test" },
|
||||
null, new[] { "Summit.ApiDemo.DemoLibrary" });
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage Test1()
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, "Hello from Test1");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage Test2()
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, $"Hello from {PortalSettings.PortalName}");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage Test3()
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.OK, $"Hello from {UserInfo.DisplayName}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Server/DemoLibrary/dnn.json
Normal file
16
Server/DemoLibrary/dnn.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"projectType": "library",
|
||||
"name": "Summit_DemoLibrary",
|
||||
"friendlyName": "Summit DemoLibrary",
|
||||
"description": "Summit DemoLibrary Library",
|
||||
"packageName": "Summit_DemoLibrary",
|
||||
"folder": "Summit/DemoLibrary",
|
||||
"library": {},
|
||||
"pathsAndFiles": {
|
||||
"pathToAssemblies": "./bin",
|
||||
"pathToScripts": "./Server/SqlScripts",
|
||||
"assemblies": ["Summit.ApiDemo.DemoLibrary.dll"],
|
||||
"releaseFiles": [],
|
||||
"zipName": "Summit.DemoLibrary"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user