last refactoring ...
This commit is contained in:
@@ -51,13 +51,13 @@ namespace xFileService.Controllers
|
||||
/// <summary>
|
||||
/// Attach Tag to Specified Model ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tag"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Tags/Attach")]
|
||||
public virtual async Task<ActionResult> TagAttach(
|
||||
[FromQuery] string tag,
|
||||
[FromQuery] Guid id
|
||||
[HttpPost("{id}/Tags/Attach")]
|
||||
public virtual async Task<ActionResult> AttachTag(
|
||||
[FromRoute] Guid id,
|
||||
[FromQuery] string tag
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -72,7 +72,7 @@ namespace xFileService.Controllers
|
||||
var userId = userInfo.UserId;
|
||||
|
||||
//
|
||||
await FileProvider.TagAttach(
|
||||
await FileProvider.AttachTag(
|
||||
id: id,
|
||||
tag: tag,
|
||||
userInfo: userInfo,
|
||||
@@ -96,10 +96,10 @@ namespace xFileService.Controllers
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Tags/Detach")]
|
||||
public virtual async Task<ActionResult> TagDetach(
|
||||
[FromQuery] string tag,
|
||||
[FromQuery] Guid id
|
||||
[HttpDelete("{id}/Tags/Detach")]
|
||||
public virtual async Task<ActionResult> DetachTag(
|
||||
[FromRoute] Guid id,
|
||||
[FromQuery] string tag
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -114,7 +114,7 @@ namespace xFileService.Controllers
|
||||
var userId = userInfo.UserId;
|
||||
|
||||
//
|
||||
await FileProvider.TagDetach(
|
||||
await FileProvider.DetachTag(
|
||||
id: id,
|
||||
tag: tag,
|
||||
userInfo: userInfo,
|
||||
@@ -138,10 +138,10 @@ namespace xFileService.Controllers
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Tags/AttachMany")]
|
||||
public virtual async Task<ActionResult> TagsAttach(
|
||||
[FromQuery] string tags,
|
||||
[FromQuery] Guid id
|
||||
[HttpPost("{id}/Tags/AttachMany")]
|
||||
public virtual async Task<ActionResult> AttachTags(
|
||||
[FromRoute] Guid id,
|
||||
[FromQuery] string tags
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -159,7 +159,7 @@ namespace xFileService.Controllers
|
||||
var userId = userInfo.UserId;
|
||||
|
||||
//
|
||||
await FileProvider.TagsAttach(
|
||||
await FileProvider.AttachTags(
|
||||
id: id,
|
||||
tags: tagsList,
|
||||
userInfo: userInfo,
|
||||
@@ -183,10 +183,10 @@ namespace xFileService.Controllers
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Tags/DetachMany")]
|
||||
public virtual async Task<ActionResult> TagsDetach(
|
||||
[FromQuery] string tags,
|
||||
[FromQuery] Guid id
|
||||
[HttpDelete("{id}/Tags/DetachMany")]
|
||||
public virtual async Task<ActionResult> DetachTags(
|
||||
[FromRoute] Guid id,
|
||||
[FromQuery] string tags
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -204,7 +204,7 @@ namespace xFileService.Controllers
|
||||
var userId = userInfo.UserId;
|
||||
|
||||
//
|
||||
await FileProvider.TagsDetach(
|
||||
await FileProvider.DetachTags(
|
||||
id: id,
|
||||
tags: tagsList,
|
||||
userInfo: userInfo,
|
||||
@@ -221,6 +221,35 @@ namespace xFileService.Controllers
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Tags of Specified File ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}/Tags")]
|
||||
public virtual async Task<ActionResult<IEnumerable<string>>> GetTags(
|
||||
[FromRoute] Guid id
|
||||
)
|
||||
{
|
||||
//
|
||||
// Do ...
|
||||
try
|
||||
{
|
||||
//
|
||||
var result = await FileProvider.GetTags(id);
|
||||
|
||||
//
|
||||
return Ok(result
|
||||
.ToDynamicObject());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
var result = GetExceptionActionResult(ex);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
@@ -342,7 +371,7 @@ namespace xFileService.Controllers
|
||||
/// </summary>
|
||||
/// <param name="files"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Upload")]
|
||||
[HttpPost("")]
|
||||
[RequestSizeLimit(966_367_641)]
|
||||
public virtual async Task<ActionResult<IEnumerable<XFileDto>>> Upload(
|
||||
[FromForm] IFormFileCollection files
|
||||
@@ -384,7 +413,7 @@ namespace xFileService.Controllers
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
/// [HttpDelete("Remove")]
|
||||
[HttpDelete("Remove")]
|
||||
[HttpDelete("")]
|
||||
public virtual async Task<ActionResult<IEnumerable<Guid>>> Remove(
|
||||
[FromQuery] string ids
|
||||
) {
|
||||
@@ -507,7 +536,7 @@ namespace xFileService.Controllers
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Owned/Query")]
|
||||
[HttpGet("Query/Owned")]
|
||||
public virtual async Task<ActionResult<XQueryResult<XFileDto>>> QueryOwned(
|
||||
[FromQuery] XQuery query
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user