Skip to content

Commit 4a0b74a

Browse files
committed
dabricks update
1 parent b493ad8 commit 4a0b74a

File tree

3 files changed

+9
-25
lines changed

3 files changed

+9
-25
lines changed

LearningHub.Nhs.WebUI/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@
115115
"MKPlayerLicence": "",
116116
"MediaKindStorageConnectionString": ""
117117
},
118+
"StatMandId": 0,
118119
"EnableTempDebugging": "false",
119120
"LimitScormToAdmin": "false"
120121

121-
},
122+
},
122123
"LearningHubAuthServiceConfig": {
123124
"Authority": "",
124125
"ClientId": "",

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

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
1-
using LearningHub.Nhs.Models.Bookmark;
2-
using LearningHub.Nhs.Models.Entities.Reporting;
3-
using LearningHub.Nhs.OpenApi.Models.Configuration;
1+
using LearningHub.Nhs.OpenApi.Models.Configuration;
42
using LearningHub.Nhs.OpenApi.Services.HttpClients;
5-
using LearningHub.Nhs.OpenApi.Services.Interface.HttpClients;
63
using LearningHub.Nhs.OpenApi.Services.Interface.Services;
7-
using Microsoft.Extensions.Logging;
84
using Microsoft.Extensions.Options;
95
using Newtonsoft.Json;
106
using System;
117
using System.Collections.Generic;
128
using System.Net;
139
using System.Net.Http;
14-
using System.Text.Json.Nodes;
1510
using System.Text;
1611
using System.Threading.Tasks;
1712
using LearningHub.Nhs.Models.Databricks;
1813
using System.Linq;
19-
using System.Net.Http.Headers;
2014
using LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories;
2115
using LearningHub.Nhs.Models.Entities.DatabricksReport;
2216
using AutoMapper;
23-
using LearningHub.Nhs.Models.Entities.Activity;
24-
using LearningHub.Nhs.Models.Resource.Activity;
2517
using LearningHub.Nhs.Models.Common;
26-
using LearningHub.Nhs.Models.Notification;
2718
using Microsoft.EntityFrameworkCore;
28-
using LearningHub.Nhs.Models.Enums.Report;
29-
using Newtonsoft.Json.Linq;
3019
using LearningHub.Nhs.OpenApi.Models.ViewModels;
31-
using LearningHub.Nhs.Models.Resource;
32-
using LearningHub.Nhs.OpenApi.Repositories.Repositories;
33-
using LearningHub.Nhs.Models.Constants;
34-
using LearningHub.Nhs.Models.Hierarchy;
3520
using LearningHub.Nhs.Models.Enums;
3621
using System.Text.Json;
37-
using LearningHub.Nhs.Models.Entities.Resource;
3822
using LearningHub.Nhs.Models.Entities;
3923

4024
namespace LearningHub.Nhs.OpenApi.Services.Services
@@ -83,7 +67,7 @@ public DatabricksService(IOptions<DatabricksConfig> databricksConfig,IOptions<Le
8367
/// <inheritdoc/>
8468
public async Task<bool> IsUserReporter(int userId)
8569
{
86-
string cacheKey = $"{CacheKey}_{userId}";
70+
string cacheKey = $"{userId}:{CacheKey}";
8771
var userReportPermission = await this.cachingService.GetAsync<bool>(cacheKey);
8872
if (userReportPermission.ResponseEnum == CacheReadResponseEnum.Found)
8973
{
@@ -129,7 +113,6 @@ public async Task<bool> IsUserReporter(int userId)
129113
/// <inheritdoc/>
130114
public async Task<DatabricksDetailedViewModel> CourseCompletionReport(int userId, DatabricksRequestModel model)
131115
{
132-
userId = 22527;
133116
newEntry:
134117
if (model.ReportHistoryId == 0 && model.Take > 1)
135118
{
@@ -214,7 +197,6 @@ public async Task<DatabricksDetailedViewModel> CourseCompletionReport(int userId
214197
/// <inheritdoc/>
215198
public async Task<PagedResultSet<ReportHistoryModel>> GetPagedReportHistory(int userId,int page, int pageSize)
216199
{
217-
userId = 22527;
218200
var result = new PagedResultSet<ReportHistoryModel>();
219201
var query = this.reportHistoryRepository.GetByUserIdAsync(userId);
220202

@@ -242,7 +224,6 @@ public async Task<PagedResultSet<ReportHistoryModel>> GetPagedReportHistory(int
242224
/// <inheritdoc/>
243225
public async Task<ReportHistoryModel> GetPagedReportHistoryById(int userId, int reportHistoryId)
244226
{
245-
userId = 22527;
246227
var result = new ReportHistoryModel();
247228

248229
var reportHistory = await this.reportHistoryRepository.GetByIdAsync(reportHistoryId);
@@ -266,7 +247,6 @@ public async Task<ReportHistoryModel> GetPagedReportHistoryById(int userId, int
266247
/// <inheritdoc/>
267248
public async Task<bool> QueueReportDownload(int userId, int reportHistoryId)
268249
{
269-
userId = 22527;
270250
var result = new ReportHistoryModel();
271251

272252
var reportHistory = await this.reportHistoryRepository.GetByIdAsync(reportHistoryId);
@@ -332,7 +312,6 @@ public async Task<bool> QueueReportDownload(int userId, int reportHistoryId)
332312
/// <inheritdoc/>
333313
public async Task<ReportHistoryModel> DownloadReport(int userId, int reportHistoryId)
334314
{
335-
userId = 22527;
336315
var response = new ReportHistoryModel();
337316

338317
var reportHistory = await this.reportHistoryRepository.GetByIdAsync(reportHistoryId);

OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@
137137
"WarehouseId": "",
138138
"JobId": "",
139139
"UserPermissionEndpoint": "",
140-
"CourseCompletionEndpoint": ""
140+
"CourseCompletionEndpoint": "",
141+
"ResourceId": "",
142+
"TenantId": "",
143+
"ClientId": "",
144+
"ClientSecret": ""
141145
}
142146
}

0 commit comments

Comments
 (0)