Skip to content

Commit 75e3e7a

Browse files
TD-5502: Replace Web API layer with Open API Layer -Admin Operations-Catalogue Creation/Catalogue Edit/ Edit Folder Structure/resource Transfer and unpublish/resource details/user management- SIT fixes
1 parent ebb0111 commit 75e3e7a

File tree

6 files changed

+37
-25
lines changed

6 files changed

+37
-25
lines changed

AdminUI/LearningHub.Nhs.AdminUI/Services/CatalogueService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ public class CatalogueService : BaseService, ICatalogueService
2525
/// Initializes a new instance of the <see cref="CatalogueService"/> class.
2626
/// </summary>
2727
/// <param name="learningHubHttpClient">The learningHubHttpClient<see cref="ILearningHubHttpClient"/>.</param>
28+
/// <param name="openApiHttpClient">The Open Api Http Client.</param>
2829
/// <param name="openApiFacade">The openApiFacade<see cref="IOpenApiFacade"/>.</param>
2930
public CatalogueService(
3031
ILearningHubHttpClient learningHubHttpClient,
32+
IOpenApiHttpClient openApiHttpClient,
3133
IOpenApiFacade openApiFacade)
32-
: base(learningHubHttpClient)
34+
: base(learningHubHttpClient, openApiHttpClient)
3335
{
3436
this.facade = openApiFacade;
3537
}

AdminUI/LearningHub.Nhs.AdminUI/Services/ContentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ContentService : BaseService, IContentService
3737
/// <param name="fileService">The fileService<see cref="IFileService"/>.</param>
3838
/// <param name="azureMediaService">azureMediaService.</param>
3939
public ContentService(ILearningHubHttpClient learningHubHttpClient, IOpenApiHttpClient openApiHttpClient, IFileService fileService, IAzureMediaService azureMediaService)
40-
: base(learningHubHttpClient)
40+
: base(learningHubHttpClient, openApiHttpClient)
4141
{
4242
this.fileService = fileService;
4343
this.azureMediaService = azureMediaService;

AdminUI/LearningHub.Nhs.AdminUI/Services/UserGroupService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ public class UserGroupService : BaseService, IUserGroupService
3232
/// Initializes a new instance of the <see cref="UserGroupService"/> class.
3333
/// </summary>
3434
/// <param name="learningHubHttpClient">The learningHubHttpClient<see cref="ILearningHubHttpClient"/>.</param>
35+
/// <param name="openApiHttpClient">The Open Api Http Client.</param>
3536
/// <param name="contextAccessor">The http context accessor.</param>
3637
/// <param name="cacheService">The cacheService.</param>
3738
/// <param name="roleService">The roleService.</param>
3839
public UserGroupService(
3940
ILearningHubHttpClient learningHubHttpClient,
41+
IOpenApiHttpClient openApiHttpClient,
4042
ICacheService cacheService,
4143
IRoleService roleService,
4244
IHttpContextAccessor contextAccessor)
43-
: base(learningHubHttpClient)
45+
: base(learningHubHttpClient, openApiHttpClient)
4446
{
4547
this.contextAccessor = contextAccessor;
4648
this.cacheService = cacheService;

LearningHub.Nhs.WebUI/web.config

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<location path="." inheritInChildApplications="false">
4-
<system.webServer>
5-
<httpProtocol>
6-
<customHeaders>
7-
<remove name="X-Powered-By" />
8-
<remove name="Server" />
9-
</customHeaders>
10-
</httpProtocol>
11-
<security>
12-
<requestFiltering removeServerHeader="true" />
13-
</security>
14-
<handlers>
15-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
16-
</handlers>
17-
<aspNetCore processPath="dotnet" arguments=".\LearningHub.Nhs.WebUI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
18-
</system.webServer>
19-
</location>
3+
<location path="." inheritInChildApplications="false">
4+
<system.webServer>
5+
<modules runAllManagedModulesForAllRequests="false">
6+
<remove name="WebDAVModule" />
7+
</modules>
8+
<httpProtocol>
9+
<customHeaders>
10+
<remove name="X-Powered-By" />
11+
<remove name="Server" />
12+
</customHeaders>
13+
</httpProtocol>
14+
<security>
15+
<requestFiltering removeServerHeader="true" />
16+
</security>
17+
<handlers>
18+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
19+
</handlers>
20+
<aspNetCore processPath="bin\x64\Debug\net8.0\LearningHub.Nhs.WebUI.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
21+
<environmentVariables>
22+
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="443" />
23+
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
24+
</environmentVariables>
25+
</aspNetCore>
26+
</system.webServer>
27+
</location>
2028
</configuration>
21-
<!--ProjectGuid: 044CCD77-8B9E-4888-BC20-9FD6E2AFE904-->
29+
<!--ProjectGuid: 044CCD77-8B9E-4888-BC20-9FD6E2AFE904-->

OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/CatalogueService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public CatalogueBasicViewModel GetBasicCatalogue(int catalogueNodeId)
189189
/// </summary>
190190
/// <param name="searchTerm">The searchTerm.</param>
191191
/// <returns>The catalogues.</returns>
192-
public List<CatalogueViewModel> GetCatalogues(string searchTerm)
192+
public List<CatalogueViewModel> GetCatalogues(string? searchTerm)
193193
{
194194
IQueryable<CatalogueNodeVersion> catalogueVersions = this.catalogueNodeVersionRepository.GetAll()
195195
.Include(x => x.Keywords)

OpenAPI/LearningHub.Nhs.OpenApi/Controllers/CatalogueController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task<IActionResult> GetAllCataloguesAsync(string filterChar = null)
5757
/// <returns>The catalogues.</returns>
5858
[HttpGet]
5959
[Route("Catalogues")]
60-
public IActionResult GetCatalogues(string searchTerm)
60+
public IActionResult GetCatalogues([FromQuery] string? searchTerm)
6161
{
6262
var catalogues = this.catalogueService.GetCatalogues(searchTerm);
6363
return this.Ok(catalogues);
@@ -152,7 +152,7 @@ public IActionResult GetCataloguesForCurrentUser()
152152
/// <returns>The actionResult.</returns>
153153
[HttpPost]
154154
[Route("Catalogues")]
155-
public async Task<IActionResult> CreateCatalogue(CatalogueViewModel viewModel)
155+
public async Task<IActionResult> CreateCatalogue([FromBody] CatalogueViewModel viewModel)
156156
{
157157
try
158158
{
@@ -237,7 +237,7 @@ public async Task<IActionResult> AccessRequest(int accessRequestId)
237237
/// <returns>The updated catalogue.</returns>
238238
[HttpPut]
239239
[Route("Catalogues")]
240-
public async Task<IActionResult> UpdateCatalogue(CatalogueViewModel viewModel)
240+
public async Task<IActionResult> UpdateCatalogue([FromBody] CatalogueViewModel viewModel)
241241
{
242242
try
243243
{

0 commit comments

Comments
 (0)