last refactoring ...
This commit is contained in:
@@ -859,6 +859,74 @@ namespace xWebinarService.Controllers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stream Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{id}/Files/{fileId}/Stream")]
|
||||||
|
public virtual async Task<ActionResult> StreamFile(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromRoute] Guid fileId
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.StreamFile(
|
||||||
|
id: id,
|
||||||
|
fileId: fileId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Download Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{id}/Files/{fileId}/Download")]
|
||||||
|
public virtual async Task<ActionResult> DownloadFile(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromRoute] Guid fileId
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.DownloadFile(
|
||||||
|
id: id,
|
||||||
|
fileId: fileId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -870,7 +938,7 @@ namespace xWebinarService.Controllers
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("{id}/Tags")]
|
[HttpPost("{id}/Tags")]
|
||||||
public virtual async Task<ActionResult> TagsAttach(
|
public virtual async Task<ActionResult> AttachTags(
|
||||||
[FromRoute] Guid id,
|
[FromRoute] Guid id,
|
||||||
[FromQuery] string tags
|
[FromQuery] string tags
|
||||||
)
|
)
|
||||||
@@ -887,7 +955,7 @@ namespace xWebinarService.Controllers
|
|||||||
//
|
//
|
||||||
var tagsList = tags.ParseListString<string>();
|
var tagsList = tags.ParseListString<string>();
|
||||||
await WebinarProvider
|
await WebinarProvider
|
||||||
.TagsAttach(
|
.AttachTags(
|
||||||
id: id,
|
id: id,
|
||||||
tags: tagsList,
|
tags: tagsList,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
@@ -912,7 +980,7 @@ namespace xWebinarService.Controllers
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpDelete("{id}/Tags")]
|
[HttpDelete("{id}/Tags")]
|
||||||
public virtual async Task<ActionResult> TagsDetach(
|
public virtual async Task<ActionResult> DetachTags(
|
||||||
[FromRoute] Guid id,
|
[FromRoute] Guid id,
|
||||||
[FromQuery] string tags
|
[FromQuery] string tags
|
||||||
)
|
)
|
||||||
@@ -929,7 +997,7 @@ namespace xWebinarService.Controllers
|
|||||||
//
|
//
|
||||||
var tagsList = tags.ParseListString<string>();
|
var tagsList = tags.ParseListString<string>();
|
||||||
await WebinarProvider
|
await WebinarProvider
|
||||||
.TagsDetach(
|
.DetachTags(
|
||||||
id: id,
|
id: id,
|
||||||
tags: tagsList,
|
tags: tagsList,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
@@ -946,6 +1014,42 @@ namespace xWebinarService.Controllers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinars Tags ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{id}/Tags")]
|
||||||
|
public virtual async Task<ActionResult<IEnumerable<string>>> GetTags(
|
||||||
|
[FromRoute] Guid id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
await WebinarProvider
|
||||||
|
.GetTags(
|
||||||
|
id: id,
|
||||||
|
userInfo: userInfo
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using xDataService.Configuration;
|
using xDataService.Configuration;
|
||||||
using xIdentityModels.Models;
|
using xIdentityModels.Models;
|
||||||
@@ -115,7 +116,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XQueryResult<XWebinarDto>> ConditionalQueryWebinars(
|
Task<XQueryResult<XWebinarDto>> ConditionalQueryWebinars(
|
||||||
Expression<Func<XWebinarDto, bool>> whereClause,
|
Expression<Func<XWebinarDto, bool>> whereClause,
|
||||||
XQuery query
|
XQuery query
|
||||||
);
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -266,6 +267,26 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<XFileDto>> GetFiles(Guid id);
|
Task<IEnumerable<XFileDto>> GetFiles(Guid id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stream Specified File ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<FileStreamResult> StreamFile(
|
||||||
|
Guid id,
|
||||||
|
Guid fileId
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stream Specified File ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PhysicalFileResult> DownloadFile(
|
||||||
|
Guid id,
|
||||||
|
Guid fileId
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -279,7 +300,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagAttach(
|
Task AttachTag(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -296,7 +317,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagDetach(
|
Task DetachTag(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -313,7 +334,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsAttach(
|
Task AttachTags(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -330,7 +351,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsDetach(
|
Task DetachTags(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -345,12 +366,23 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsDetach(
|
Task DetachTags(
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
string connectionId = null,
|
string connectionId = null,
|
||||||
bool forceDetachFromFiles = true
|
bool forceDetachFromFiles = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinar's Tags ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="userInfo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IEnumerable<string>> GetTags(
|
||||||
|
Guid id,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,6 +191,28 @@ namespace xWebinarService.Interfaces
|
|||||||
Task<ActionResult<IEnumerable<XFileDto>>> GetFiles(
|
Task<ActionResult<IEnumerable<XFileDto>>> GetFiles(
|
||||||
[FromRoute] Guid id
|
[FromRoute] Guid id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stream Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult> StreamFile(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromRoute] Guid fileId
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Download Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult> DownloadFile(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromRoute] Guid fileId
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -201,7 +223,7 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult> TagsAttach(
|
Task<ActionResult> AttachTags(
|
||||||
[FromRoute] Guid id,
|
[FromRoute] Guid id,
|
||||||
[FromQuery] string tags
|
[FromQuery] string tags
|
||||||
);
|
);
|
||||||
@@ -212,10 +234,19 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult> TagsDetach(
|
Task<ActionResult> DetachTags(
|
||||||
[FromRoute] Guid id,
|
[FromRoute] Guid id,
|
||||||
[FromQuery] string tags
|
[FromQuery] string tags
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinars Tags ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<IEnumerable<string>>> GetTags(
|
||||||
|
[FromRoute] Guid id
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+152
-20
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xDataService.Configuration;
|
using xDataService.Configuration;
|
||||||
@@ -331,7 +332,7 @@ namespace xWebinarService.Providers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await TagsAttach(
|
await AttachTags(
|
||||||
tags: tags,
|
tags: tags,
|
||||||
id: entity.Id,
|
id: entity.Id,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
@@ -961,7 +962,7 @@ namespace xWebinarService.Providers
|
|||||||
// Detach Tags ...
|
// Detach Tags ...
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await TagsDetach(entity.Id, userInfo);
|
await DetachTags(entity.Id, userInfo);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
@@ -1519,6 +1520,82 @@ namespace xWebinarService.Providers
|
|||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stream Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<FileStreamResult> StreamFile(
|
||||||
|
Guid id,
|
||||||
|
Guid fileId
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
var isValid = !id.IsNull() &&
|
||||||
|
!fileId.IsNull() &&
|
||||||
|
!id.IsDefaultGuid() &&
|
||||||
|
!fileId.IsDefaultGuid();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Specified File is Refrenced to Specified Webinar ...
|
||||||
|
var files = await WebinarFileProvider.GetAllFor(id);
|
||||||
|
isValid = !files.IsNull() &&
|
||||||
|
files.HasChild() &&
|
||||||
|
files.Any(f => f.Id == fileId);
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarFileProvider.Stream(fileId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Download Specified File of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PhysicalFileResult> DownloadFile(
|
||||||
|
Guid id,
|
||||||
|
Guid fileId
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
var isValid = !id.IsNull() &&
|
||||||
|
!fileId.IsNull() &&
|
||||||
|
!id.IsDefaultGuid() &&
|
||||||
|
!fileId.IsDefaultGuid();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Specified File is Refrenced to Specified Webinar ...
|
||||||
|
var files = await WebinarFileProvider.GetAllFor(id);
|
||||||
|
isValid = !files.IsNull() &&
|
||||||
|
files.HasChild() &&
|
||||||
|
files.Any(f => f.Id == fileId);
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarFileProvider.Download(fileId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1532,7 +1609,7 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagAttach(
|
public async Task AttachTag(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -1578,11 +1655,11 @@ namespace xWebinarService.Providers
|
|||||||
foreach (var media in medias)
|
foreach (var media in medias)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await WebinarFileProvider.Provider.TagAttach(
|
await WebinarFileProvider.Provider.AttachTag(
|
||||||
tag,
|
id: media.Id,
|
||||||
media.Id,
|
tag: tag,
|
||||||
userInfo,
|
userInfo: userInfo,
|
||||||
connectionId
|
connectionId: connectionId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1601,7 +1678,7 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagDetach(
|
public async Task DetachTag(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -1645,11 +1722,11 @@ namespace xWebinarService.Providers
|
|||||||
foreach (var media in medias)
|
foreach (var media in medias)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await WebinarFileProvider.Provider.TagDetach(
|
await WebinarFileProvider.Provider.DetachTag(
|
||||||
tag,
|
id: media.Id,
|
||||||
media.Id,
|
tag: tag,
|
||||||
userInfo,
|
userInfo: userInfo,
|
||||||
connectionId
|
connectionId: connectionId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1668,7 +1745,7 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsAttach(
|
public async Task AttachTags(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -1702,7 +1779,7 @@ namespace xWebinarService.Providers
|
|||||||
foreach (var tag in tags)
|
foreach (var tag in tags)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await TagAttach(
|
await AttachTag(
|
||||||
tag,
|
tag,
|
||||||
id,
|
id,
|
||||||
userInfo,
|
userInfo,
|
||||||
@@ -1724,7 +1801,7 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsDetach(
|
public async Task DetachTags(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -1758,7 +1835,7 @@ namespace xWebinarService.Providers
|
|||||||
foreach (var tag in tags)
|
foreach (var tag in tags)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await TagDetach(
|
await DetachTag(
|
||||||
tag,
|
tag,
|
||||||
id,
|
id,
|
||||||
userInfo,
|
userInfo,
|
||||||
@@ -1778,7 +1855,7 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="connectionId"></param>
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsDetach(
|
public async Task DetachTags(
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
string connectionId = null,
|
string connectionId = null,
|
||||||
@@ -1818,7 +1895,11 @@ namespace xWebinarService.Providers
|
|||||||
foreach (var media in medias)
|
foreach (var media in medias)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await WebinarFileProvider.Provider.TagsDetach(media.Id, userInfo, connectionId);
|
await WebinarFileProvider.Provider.DetachTags(
|
||||||
|
id: media.Id,
|
||||||
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1826,6 +1907,57 @@ namespace xWebinarService.Providers
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinar's Tags ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="userInfo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IEnumerable<string>> GetTags(
|
||||||
|
Guid id,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate Args ...
|
||||||
|
var isValid = !id.IsNull() &&
|
||||||
|
!id.IsDefaultGuid() &&
|
||||||
|
!userInfo.IsNullOrDefault();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Permissions ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Checking Exists ...
|
||||||
|
isValid = await WebinarRepository.IsExistsAsync(id);
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Reading Tags Dto List ...
|
||||||
|
var tagsDtos = await WebinarTagProvider.GetTags(id);
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = new List<string>();
|
||||||
|
isValid = !tagsDtos.IsNull() && tagsDtos.HasChild();
|
||||||
|
if (isValid)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = tagsDtos
|
||||||
|
.Select(td => td.Tag)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user