last works ...
This commit is contained in:
@@ -13,6 +13,7 @@ using xIdentityService.Interfaces;
|
|||||||
using xModels.Dtos;
|
using xModels.Dtos;
|
||||||
using xWebinarService.Interfaces;
|
using xWebinarService.Interfaces;
|
||||||
using xWebinarService.Models.Dtos;
|
using xWebinarService.Models.Dtos;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace xWebinarService.Controllers
|
namespace xWebinarService.Controllers
|
||||||
{
|
{
|
||||||
@@ -52,10 +53,14 @@ namespace xWebinarService.Controllers
|
|||||||
/// Create Webinar ...
|
/// Create Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <param name="files"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("Create")]
|
[HttpPost("Create")]
|
||||||
public virtual async Task<ActionResult<XWebinarDto>> CreateWebinar(
|
public virtual async Task<ActionResult<XWebinarDto>> CreateWebinar(
|
||||||
[FromBody] XWebinarDto item
|
[FromBody] XWebinarDto item,
|
||||||
|
[FromQuery] string tags = null,
|
||||||
|
[FromForm] IFormFileCollection files = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -77,9 +82,12 @@ namespace xWebinarService.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
var tagList = tags.ParseListString<string>();
|
||||||
var result = await WebinarProvider
|
var result = await WebinarProvider
|
||||||
.CreateWebinar(
|
.CreateWebinar(
|
||||||
item: item,
|
item: item,
|
||||||
|
files: files,
|
||||||
|
tags: tagList,
|
||||||
connectionId: connectionId
|
connectionId: connectionId
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -200,33 +208,6 @@ namespace xWebinarService.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all Exists Webinar Ids ...
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("Ids")]
|
|
||||||
public virtual ActionResult<IEnumerable<Guid>> GetWebinarIds()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = WebinarProvider
|
|
||||||
.GetWebinarIds();
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinars ...
|
/// Query Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -258,12 +239,12 @@ namespace xWebinarService.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinar Ids ...
|
/// Query Owned Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query"></param>
|
/// <param name="query"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("QueryIds")]
|
[HttpGet("QueryOwned")]
|
||||||
public virtual ActionResult<XQueryResult<Guid>> QueryWebinarIds(
|
public virtual async Task<ActionResult<XQueryResult<XWebinarDto>>> QueryOwnedWebinars(
|
||||||
[FromQuery] XQuery query
|
[FromQuery] XQuery query
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -272,8 +253,52 @@ namespace xWebinarService.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
var result = WebinarProvider
|
// Retrieve User Info ...
|
||||||
.QueryWebinarIds(query);
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.QueryOwnedWebinars(
|
||||||
|
query: query,
|
||||||
|
userInfo: userInfo
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Joinable Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("QueryJoinable")]
|
||||||
|
public virtual async Task<ActionResult<XQueryResult<XWebinarDto>>> QueryJoinableWebinars(
|
||||||
|
[FromQuery] XQuery query
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.QueryJoinableWebinars(
|
||||||
|
query: query,
|
||||||
|
userInfo: userInfo
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
return Ok(result.
|
return Ok(result.
|
||||||
@@ -708,5 +733,209 @@ namespace xWebinarService.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//
|
||||||
|
#region File Actions ...
|
||||||
|
/// <summary>
|
||||||
|
/// Upload Specified Files for Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="files"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("{id}/Files")]
|
||||||
|
public virtual async Task<ActionResult<IEnumerable<XFileDto>>> Upload(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromForm] IFormFileCollection files
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
var connectionId = GetConnectionId();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.Upload(
|
||||||
|
id: id,
|
||||||
|
files: files,
|
||||||
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified (All) Files of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete("{id}/Files")]
|
||||||
|
public virtual async Task<ActionResult<IEnumerable<XFileDto>>> Remove(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string ids = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
var connectionId = GetConnectionId();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.RemoveFiles(
|
||||||
|
id: id,
|
||||||
|
ids: ids,
|
||||||
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinar's Files ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{id}/Files")]
|
||||||
|
public virtual async Task<ActionResult<IEnumerable<XFileDto>>> GetFiles(
|
||||||
|
[FromRoute] Guid id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.GetFiles(id);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
//
|
||||||
|
#region Tags Actions ...
|
||||||
|
/// <summary>
|
||||||
|
/// Attach Specified Tags To Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("{id}/Tags")]
|
||||||
|
public virtual async Task<ActionResult> TagsAttach(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string tags
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
var connectionId = GetConnectionId();
|
||||||
|
|
||||||
|
//
|
||||||
|
var tagsList = tags.ParseListString<string>();
|
||||||
|
await WebinarProvider
|
||||||
|
.TagsAttach(
|
||||||
|
id: id,
|
||||||
|
tags: tagsList,
|
||||||
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Detach Specified Tags From Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete("{id}/Tags")]
|
||||||
|
public virtual async Task<ActionResult> TagsDetach(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string tags
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieve User Info ...
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
var connectionId = GetConnectionId();
|
||||||
|
|
||||||
|
//
|
||||||
|
var tagsList = tags.ParseListString<string>();
|
||||||
|
await WebinarProvider
|
||||||
|
.TagsDetach(
|
||||||
|
id: id,
|
||||||
|
tags: tagsList,
|
||||||
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
@@ -106,6 +107,37 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XQueryResult<XWebinarDto>> QueryWebinars(XQuery query);
|
Task<XQueryResult<XWebinarDto>> QueryWebinars(XQuery query);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conditional Query Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="whereClause"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<XQueryResult<XWebinarDto>> ConditionalQueryWebinars(
|
||||||
|
Expression<Func<XWebinarDto, bool>> whereClause,
|
||||||
|
XQuery query
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Owned Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<XQueryResult<XWebinarDto>> QueryOwnedWebinars(
|
||||||
|
XQuery query,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Joinable Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<XQueryResult<XWebinarDto>> QueryJoinableWebinars(
|
||||||
|
XQuery query,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinar Ids ...
|
/// Query Webinar Ids ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -204,11 +236,13 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="forProvidedId"></param>
|
/// <param name="forProvidedId"></param>
|
||||||
/// <param name="files"></param>
|
/// <param name="files"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<XFileDto>> Upload(
|
Task<IEnumerable<XFileDto>> Upload(
|
||||||
Guid id,
|
Guid id,
|
||||||
IFormFileCollection files,
|
IFormFileCollection files,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null
|
||||||
);
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -217,11 +251,13 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="forProvidedId"></param>
|
/// <param name="forProvidedId"></param>
|
||||||
/// <param name="ids"></param>
|
/// <param name="ids"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<Guid>> RemoveFiles(
|
Task<IEnumerable<Guid>> RemoveFiles(
|
||||||
Guid id,
|
Guid id,
|
||||||
string ids = null,
|
string ids = null,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null
|
||||||
);
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -240,12 +276,14 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="tag"></param>
|
/// <param name="tag"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagAttach(
|
Task TagAttach(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceAttachToFiles = true
|
bool forceAttachToFiles = true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -255,12 +293,14 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="tag"></param>
|
/// <param name="tag"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagDetach(
|
Task TagDetach(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceDetachFromFiles = true
|
bool forceDetachFromFiles = true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -270,12 +310,14 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsAttach(
|
Task TagsAttach(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceAttachToFiles = true
|
bool forceAttachToFiles = true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -285,12 +327,14 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsDetach(
|
Task TagsDetach(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceDetachFromFiles = true
|
bool forceDetachFromFiles = true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -298,10 +342,14 @@ namespace xWebinarService.Interfaces
|
|||||||
/// Detach all Attached Tags for Specified File ...
|
/// Detach all Attached Tags for Specified File ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task TagsDetach(
|
Task TagsDetach(
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
|
bool forceDetachFromFiles = true
|
||||||
);
|
);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using xModels.Dtos;
|
using xModels.Dtos;
|
||||||
using xWebinarService.Models.Dtos;
|
using xWebinarService.Models.Dtos;
|
||||||
@@ -18,22 +19,32 @@ namespace xWebinarService.Interfaces
|
|||||||
/// Create Webinar ...
|
/// Create Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <param name="files"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<XWebinarDto>> CreateWebinar([FromBody] XWebinarDto item);
|
Task<ActionResult<XWebinarDto>> CreateWebinar(
|
||||||
|
[FromBody] XWebinarDto item,
|
||||||
|
[FromQuery] string tags = null,
|
||||||
|
[FromForm] IFormFileCollection files = null
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update a Webinar ...
|
/// Update a Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<XWebinarDto>> UpdateWebinar([FromBody] XWebinarDto item);
|
Task<ActionResult<XWebinarDto>> UpdateWebinar(
|
||||||
|
[FromBody] XWebinarDto item
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve Specified Webinar ...
|
/// Retrieve Specified Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<XWebinarDto>> GetWebinar([FromQuery] Guid id);
|
Task<ActionResult<XWebinarDto>> GetWebinar(
|
||||||
|
[FromQuery] Guid id
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve all Exists Webinars ...
|
/// Retrieve all Exists Webinars ...
|
||||||
@@ -41,25 +52,32 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<IEnumerable<XWebinarDto>>> GetWebinars();
|
Task<ActionResult<IEnumerable<XWebinarDto>>> GetWebinars();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all Exists Webinar Ids ...
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
ActionResult<IEnumerable<Guid>> GetWebinarIds();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinars ...
|
/// Query Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query"></param>
|
/// <param name="query"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryWebinars([FromQuery] XQuery query);
|
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryWebinars(
|
||||||
|
[FromQuery] XQuery query
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinar Ids ...
|
/// Query Owned Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query"></param>
|
/// <param name="query"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
ActionResult<XQueryResult<Guid>> QueryWebinarIds([FromQuery] XQuery query);
|
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryOwnedWebinars(
|
||||||
|
[FromQuery] XQuery query
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Joinable Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryJoinableWebinars(
|
||||||
|
[FromQuery] XQuery query
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove Specified Webinar ...
|
/// Remove Specified Webinar ...
|
||||||
@@ -143,5 +161,64 @@ namespace xWebinarService.Interfaces
|
|||||||
[FromQuery] Guid webinarId
|
[FromQuery] Guid webinarId
|
||||||
);
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//
|
||||||
|
#region File Actions ...
|
||||||
|
/// <summary>
|
||||||
|
/// Upload Specified Files for Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="files"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<IEnumerable<XFileDto>>> Upload(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromForm] IFormFileCollection files
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified (All) Files of Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<IEnumerable<XFileDto>>> Remove(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string ids = null
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Webinar's Files ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<IEnumerable<XFileDto>>> GetFiles(
|
||||||
|
[FromRoute] Guid id
|
||||||
|
);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
//
|
||||||
|
#region Tags Actions ...
|
||||||
|
/// <summary>
|
||||||
|
/// Attach Specified Tags To Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult> TagsAttach(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string tags
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Detach Specified Tags From Specified Webinar ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult> TagsDetach(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromQuery] string tags
|
||||||
|
);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+230
-21
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
@@ -334,6 +335,7 @@ namespace xWebinarService.Providers
|
|||||||
tags: tags,
|
tags: tags,
|
||||||
id: entity.Id,
|
id: entity.Id,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId,
|
||||||
true //
|
true //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -366,6 +368,10 @@ namespace xWebinarService.Providers
|
|||||||
string connectionId = null
|
string connectionId = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// Since Medias and Tags Manages Separatly, here
|
||||||
|
// we dont need to ensure that ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Validate ...
|
// Validate ...
|
||||||
bool isValid =
|
bool isValid =
|
||||||
@@ -584,7 +590,6 @@ namespace xWebinarService.Providers
|
|||||||
// Since in Resourceable Entities we have to Search on Locales
|
// Since in Resourceable Entities we have to Search on Locales
|
||||||
// we Must Implement Senario Custom ...
|
// we Must Implement Senario Custom ...
|
||||||
var totalEntities = await WebinarRepository.GetAllAsync();
|
var totalEntities = await WebinarRepository.GetAllAsync();
|
||||||
Console.WriteLine($"Query Reading All ...");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
var list = new List<XWebinarDto>();
|
var list = new List<XWebinarDto>();
|
||||||
@@ -596,7 +601,6 @@ namespace xWebinarService.Providers
|
|||||||
}
|
}
|
||||||
var items = list.AsEnumerable();
|
var items = list.AsEnumerable();
|
||||||
var totalItemsCount = items.Count();
|
var totalItemsCount = items.Count();
|
||||||
Console.WriteLine($"Query Reading Item's Tasks ...");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Apply Filter ...
|
// Apply Filter ...
|
||||||
@@ -605,9 +609,6 @@ namespace xWebinarService.Providers
|
|||||||
//
|
//
|
||||||
items = items
|
items = items
|
||||||
.ApplyFilter(query.Filter);
|
.ApplyFilter(query.Filter);
|
||||||
|
|
||||||
//
|
|
||||||
Console.WriteLine($"Query Apply Filter ...");
|
|
||||||
}
|
}
|
||||||
int filteredItemsCount = items.Count();
|
int filteredItemsCount = items.Count();
|
||||||
|
|
||||||
@@ -629,8 +630,6 @@ namespace xWebinarService.Providers
|
|||||||
query.SortBy,
|
query.SortBy,
|
||||||
query.IsAscending
|
query.IsAscending
|
||||||
);
|
);
|
||||||
//
|
|
||||||
Console.WriteLine($"Query Apply Sorting ...");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Apply Paging ...
|
// Apply Paging ...
|
||||||
@@ -640,8 +639,6 @@ namespace xWebinarService.Providers
|
|||||||
query.Page,
|
query.Page,
|
||||||
query.PageSize
|
query.PageSize
|
||||||
);
|
);
|
||||||
//
|
|
||||||
Console.WriteLine($"Query Apply Paging ...");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -661,6 +658,170 @@ namespace xWebinarService.Providers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conditional Query Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="whereClause"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<XQueryResult<XWebinarDto>> ConditionalQueryWebinars(
|
||||||
|
Expression<Func<XWebinarDto, bool>> whereClause,
|
||||||
|
XQuery query
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (query.IsNull() || whereClause.IsNull())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
query = query.NormalizeQuery(DataSercviceConfiguration);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Compile Expression ...
|
||||||
|
var whereFunc = whereClause.Compile();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Since in Resourceable Entities we have to Search on Locales
|
||||||
|
// we Must Implement Senario Custom ...
|
||||||
|
var totalEntities = await WebinarRepository.GetAllAsync();
|
||||||
|
|
||||||
|
//
|
||||||
|
var list = new List<XWebinarDto>();
|
||||||
|
foreach (var entity in totalEntities)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var dto = await ToXWebinarDto(entity);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate and Check Conditions ...
|
||||||
|
if (!dto.IsNullOrDefault() && whereFunc(dto))
|
||||||
|
{
|
||||||
|
list.Add(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var items = list.AsEnumerable();
|
||||||
|
var totalItemsCount = items.Count();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Filter ...
|
||||||
|
if (!query.Filter.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
items = items
|
||||||
|
.ApplyFilter(query.Filter);
|
||||||
|
}
|
||||||
|
int filteredItemsCount = items.Count();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Count Pages ...
|
||||||
|
var totalPagesCount = query.CountPages(totalItemsCount);
|
||||||
|
var filteredPagesCount = query.CountPages(filteredItemsCount);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Paging and Sorting ...
|
||||||
|
if (totalItemsCount > 0 &&
|
||||||
|
filteredItemsCount > 0)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Apply Sorting ...
|
||||||
|
items = items
|
||||||
|
.ToList()
|
||||||
|
.ApplySorting(
|
||||||
|
query.SortBy,
|
||||||
|
query.IsAscending
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Paging ...
|
||||||
|
items = items
|
||||||
|
.ToList()
|
||||||
|
.ApplyPaging(
|
||||||
|
query.Page,
|
||||||
|
query.PageSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Prepare Result ...
|
||||||
|
var result = new XQueryResult<XWebinarDto>
|
||||||
|
{
|
||||||
|
Page = query.Page,
|
||||||
|
Items = items.ToList(),
|
||||||
|
PageSize = query.PageSize,
|
||||||
|
TotalPages = totalPagesCount,
|
||||||
|
TotalItems = totalItemsCount,
|
||||||
|
TotalFilteredPages = filteredPagesCount,
|
||||||
|
TotalFilteredItems = filteredItemsCount
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Owned Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<XQueryResult<XWebinarDto>> QueryOwnedWebinars(
|
||||||
|
XQuery query,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
var isValid = !query.IsNullOrDefault() &&
|
||||||
|
!userInfo.IsNullOrDefault();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Expression<Func<XWebinarDto, bool>> whereClause = d => d.OwnerId == userInfo.UserId;
|
||||||
|
var result = await ConditionalQueryWebinars(
|
||||||
|
query: query,
|
||||||
|
whereClause: whereClause
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Joinable Webinars ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<XQueryResult<XWebinarDto>> QueryJoinableWebinars(
|
||||||
|
XQuery query,
|
||||||
|
XUserClaimsInfoDto userInfo = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
var isValid = !query.IsNullOrDefault() &&
|
||||||
|
!userInfo.IsNullOrDefault();
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create an Expression to Check Specified Webinar is Joinable by Provided User Info or not ...
|
||||||
|
Expression<Func<XWebinarDto, bool>> whereClause = d =>
|
||||||
|
d.OwnerId == userInfo.UserId ||
|
||||||
|
d.Type == XWebinarType.Public ||
|
||||||
|
WebinarSubscriberRepository.AsQueryable().Any(ws => ws.WebinarId == d.Id && ws.SubscriberId == userInfo.UserId);
|
||||||
|
var result = await ConditionalQueryWebinars(
|
||||||
|
query: query,
|
||||||
|
whereClause: whereClause
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinar Ids ...
|
/// Query Webinar Ids ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1246,11 +1407,13 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="forProvidedId"></param>
|
/// <param name="forProvidedId"></param>
|
||||||
/// <param name="files"></param>
|
/// <param name="files"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<XFileDto>> Upload(
|
public async Task<IEnumerable<XFileDto>> Upload(
|
||||||
Guid id,
|
Guid id,
|
||||||
IFormFileCollection files,
|
IFormFileCollection files,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1279,7 +1442,8 @@ namespace xWebinarService.Providers
|
|||||||
result = (await WebinarFileProvider.Upload(
|
result = (await WebinarFileProvider.Upload(
|
||||||
files: files,
|
files: files,
|
||||||
forProvidedId: id,
|
forProvidedId: id,
|
||||||
userInfo: userInfo
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
))
|
))
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
@@ -1295,11 +1459,13 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="forProvidedId"></param>
|
/// <param name="forProvidedId"></param>
|
||||||
/// <param name="ids"></param>
|
/// <param name="ids"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IEnumerable<Guid>> RemoveFiles(
|
public async Task<IEnumerable<Guid>> RemoveFiles(
|
||||||
Guid id,
|
Guid id,
|
||||||
string ids = null,
|
string ids = null,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1322,9 +1488,10 @@ namespace xWebinarService.Providers
|
|||||||
|
|
||||||
//
|
//
|
||||||
var result = await WebinarFileProvider.Remove(
|
var result = await WebinarFileProvider.Remove(
|
||||||
id,
|
forProvidedId: id,
|
||||||
ids,
|
ids: ids,
|
||||||
userInfo
|
userInfo: userInfo,
|
||||||
|
connectionId: connectionId
|
||||||
);
|
);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1362,12 +1529,14 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="tag"></param>
|
/// <param name="tag"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagAttach(
|
public async Task TagAttach(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceAttachToFiles = true
|
bool forceAttachToFiles = true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -1395,7 +1564,7 @@ namespace xWebinarService.Providers
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Attached Tag to Webinar ...
|
// Attached Tag to Webinar ...
|
||||||
await WebinarTagProvider.Attach(tag, id);
|
await WebinarTagProvider.Attach(tag, id, connectionId);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (forceAttachToFiles)
|
if (forceAttachToFiles)
|
||||||
@@ -1408,7 +1577,13 @@ namespace xWebinarService.Providers
|
|||||||
//
|
//
|
||||||
foreach (var media in medias)
|
foreach (var media in medias)
|
||||||
{
|
{
|
||||||
await WebinarFileProvider.Provider.TagAttach(tag, media.Id);
|
//
|
||||||
|
await WebinarFileProvider.Provider.TagAttach(
|
||||||
|
tag,
|
||||||
|
media.Id,
|
||||||
|
userInfo,
|
||||||
|
connectionId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1423,12 +1598,14 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="tag"></param>
|
/// <param name="tag"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagDetach(
|
public async Task TagDetach(
|
||||||
string tag,
|
string tag,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceDetachFromFiles = true
|
bool forceDetachFromFiles = true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -1454,7 +1631,7 @@ namespace xWebinarService.Providers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
await WebinarTagProvider.Detach(tag, id);
|
await WebinarTagProvider.Detach(tag, id, connectionId);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (forceDetachFromFiles)
|
if (forceDetachFromFiles)
|
||||||
@@ -1467,7 +1644,13 @@ namespace xWebinarService.Providers
|
|||||||
//
|
//
|
||||||
foreach (var media in medias)
|
foreach (var media in medias)
|
||||||
{
|
{
|
||||||
await WebinarFileProvider.Provider.TagDetach(tag, media.Id);
|
//
|
||||||
|
await WebinarFileProvider.Provider.TagDetach(
|
||||||
|
tag,
|
||||||
|
media.Id,
|
||||||
|
userInfo,
|
||||||
|
connectionId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1482,12 +1665,14 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceAttachToFiles"></param>
|
/// <param name="forceAttachToFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsAttach(
|
public async Task TagsAttach(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceAttachToFiles = true
|
bool forceAttachToFiles = true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -1521,6 +1706,7 @@ namespace xWebinarService.Providers
|
|||||||
tag,
|
tag,
|
||||||
id,
|
id,
|
||||||
userInfo,
|
userInfo,
|
||||||
|
connectionId,
|
||||||
forceAttachToFiles
|
forceAttachToFiles
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1535,12 +1721,14 @@ namespace xWebinarService.Providers
|
|||||||
/// <param name="tags"></param>
|
/// <param name="tags"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
/// <param name="forceDetachFromFiles"></param>
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsDetach(
|
public async Task TagsDetach(
|
||||||
IEnumerable<string> tags,
|
IEnumerable<string> tags,
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
bool forceDetachFromFiles = true
|
bool forceDetachFromFiles = true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -1574,6 +1762,7 @@ namespace xWebinarService.Providers
|
|||||||
tag,
|
tag,
|
||||||
id,
|
id,
|
||||||
userInfo,
|
userInfo,
|
||||||
|
connectionId,
|
||||||
forceDetachFromFiles
|
forceDetachFromFiles
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1586,10 +1775,14 @@ namespace xWebinarService.Providers
|
|||||||
/// Detach all Attached Tags for Specified File ...
|
/// Detach all Attached Tags for Specified File ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
|
/// <param name="connectionId"></param>
|
||||||
|
/// <param name="forceDetachFromFiles"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task TagsDetach(
|
public async Task TagsDetach(
|
||||||
Guid id,
|
Guid id,
|
||||||
XUserClaimsInfoDto userInfo = null
|
XUserClaimsInfoDto userInfo = null,
|
||||||
|
string connectionId = null,
|
||||||
|
bool forceDetachFromFiles = true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1612,7 +1805,23 @@ namespace xWebinarService.Providers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
var tags = await WebinarTagProvider.RemoveTagsFor(id);
|
var tags = await WebinarTagProvider.RemoveTagsFor(id, connectionId);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (forceDetachFromFiles)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var medias = await WebinarFileProvider.GetAllFor(id);
|
||||||
|
if (!medias.IsNull() && medias.HasChild())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
foreach (var media in medias)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
await WebinarFileProvider.Provider.TagsDetach(media.Id, userInfo, connectionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user