#399 pdf service methods
This commit is contained in:
parent
74c5a5bbac
commit
8d25cb67de
@ -17407,11 +17407,12 @@
|
||||
طول تصویر بندانگشتی
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.PDFLibraryService.GetPDFBookByIdAsync(System.Int32)">
|
||||
<member name="M:RMuseum.Services.Implementation.PDFLibraryService.GetPDFBookByIdAsync(System.Int32,RMuseum.Models.Artifact.PublishStatus[])">
|
||||
<summary>
|
||||
get pdf book by id
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="statusArray"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.PDFLibraryService.StartImportingLocalPDF(RMuseum.Models.PDFLibrary.ViewModels.NewPDFBookViewModel)">
|
||||
@ -18260,6 +18261,50 @@
|
||||
PDF Library Services
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.GetPDFBookByIdAsync(System.Int32,RMuseum.Models.Artifact.PublishStatus[])">
|
||||
<summary>
|
||||
get pdf book by id
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="statusArray"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.AddAuthorAsync(RMuseum.Models.PDFLibrary.Author)">
|
||||
<summary>
|
||||
add author
|
||||
</summary>
|
||||
<param name="author"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.GetAuthorByIdAsync(System.Int32)">
|
||||
<summary>
|
||||
get author by id
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.GetAuthorsAsync(RSecurityBackend.Models.Generic.PagingParameterModel,System.String)">
|
||||
<summary>
|
||||
get authors
|
||||
</summary>
|
||||
<param name="paging"></param>
|
||||
<param name="authorName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.AddBookAsync(RMuseum.Models.PDFLibrary.Book)">
|
||||
<summary>
|
||||
add book
|
||||
</summary>
|
||||
<param name="book"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.AddMultiVolumePDFCollection(RMuseum.Models.PDFLibrary.MultiVolumePDFCollection)">
|
||||
<summary>
|
||||
add multi volume pdf collection
|
||||
</summary>
|
||||
<param name="multiVolumePDFCollection"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IPDFLibraryService.StartImportingLocalPDF(RMuseum.Models.PDFLibrary.ViewModels.NewPDFBookViewModel)">
|
||||
<summary>
|
||||
start importing local pdf file
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
using RMuseum.Models.PDFLibrary.ViewModels;
|
||||
using RMuseum.Models.Artifact;
|
||||
using RMuseum.Models.PDFLibrary;
|
||||
using RMuseum.Models.PDFLibrary.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RMuseum.Services
|
||||
{
|
||||
@ -8,6 +11,50 @@ namespace RMuseum.Services
|
||||
/// </summary>
|
||||
public interface IPDFLibraryService
|
||||
{
|
||||
/// <summary>
|
||||
/// get pdf book by id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="statusArray"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<PDFBook>> GetPDFBookByIdAsync(int id, PublishStatus[] statusArray);
|
||||
|
||||
/// <summary>
|
||||
/// add author
|
||||
/// </summary>
|
||||
/// <param name="author"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<Author>> AddAuthorAsync(Author author);
|
||||
|
||||
/// <summary>
|
||||
/// get author by id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<Author>> GetAuthorByIdAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// get authors
|
||||
/// </summary>
|
||||
/// <param name="paging"></param>
|
||||
/// <param name="authorName"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<(PaginationMetadata PagingMeta, Author[] Authors)>> GetAuthorsAsync(PagingParameterModel paging, string authorName);
|
||||
|
||||
/// <summary>
|
||||
/// add book
|
||||
/// </summary>
|
||||
/// <param name="book"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<Book>> AddBookAsync(Book book);
|
||||
|
||||
/// <summary>
|
||||
/// add multi volume pdf collection
|
||||
/// </summary>
|
||||
/// <param name="multiVolumePDFCollection"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<MultiVolumePDFCollection>> AddMultiVolumePDFCollection(MultiVolumePDFCollection multiVolumePDFCollection);
|
||||
|
||||
/// <summary>
|
||||
/// start importing local pdf file
|
||||
/// </summary>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using RMuseum.DbContext;
|
||||
using RMuseum.Models.Artifact;
|
||||
using RMuseum.Models.PDFLibrary;
|
||||
using RMuseum.Models.PDFLibrary.ViewModels;
|
||||
using RSecurityBackend.Models.Generic;
|
||||
@ -22,8 +23,9 @@ namespace RMuseum.Services.Implementation
|
||||
/// get pdf book by id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="statusArray"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<PDFBook>> GetPDFBookByIdAsync(int id)
|
||||
public async Task<RServiceResult<PDFBook>> GetPDFBookByIdAsync(int id, PublishStatus[] statusArray)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -33,7 +35,7 @@ namespace RMuseum.Services.Implementation
|
||||
.Include(b => b.Contributers)
|
||||
.Include(b => b.Tags)
|
||||
.Include(b => b.Pages)
|
||||
.Where(b => b.Id == id)
|
||||
.Where(b => statusArray.Contains(b.Status) &&b.Id == id)
|
||||
.SingleOrDefaultAsync();
|
||||
return new RServiceResult<PDFBook>(pdfBook);
|
||||
|
||||
@ -169,6 +171,7 @@ namespace RMuseum.Services.Implementation
|
||||
);
|
||||
return new RServiceResult<bool>(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add author
|
||||
/// </summary>
|
||||
@ -187,6 +190,7 @@ namespace RMuseum.Services.Implementation
|
||||
return new RServiceResult<Author>(null, exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get author by id
|
||||
/// </summary>
|
||||
@ -203,6 +207,7 @@ namespace RMuseum.Services.Implementation
|
||||
return new RServiceResult<Author>(null, exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get authors
|
||||
/// </summary>
|
||||
@ -219,6 +224,7 @@ namespace RMuseum.Services.Implementation
|
||||
await QueryablePaginator<Author>.Paginate(source, paging);
|
||||
return new RServiceResult<(PaginationMetadata PagingMeta, Author[] Authors)>(paginatedResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add book
|
||||
/// </summary>
|
||||
@ -237,6 +243,7 @@ namespace RMuseum.Services.Implementation
|
||||
return new RServiceResult<Book>(null, exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add multi volume pdf collection
|
||||
/// </summary>
|
||||
@ -255,6 +262,7 @@ namespace RMuseum.Services.Implementation
|
||||
return new RServiceResult<MultiVolumePDFCollection>(null, exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database Context
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user