using Microsoft.AspNetCore.Http; using RMuseum.Models.Ganjoor; using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.GanjoorAudio.ViewModels; using RSecurityBackend.Models.Generic; using System; using System.Threading.Tasks; namespace RMuseum.Services { /// /// Ganjoor Poems Content Privider Service /// public interface IGanjoorService { /// /// Get List of poets /// /// /// /// Task> GetPoets(bool published, bool includeBio = true); /// /// get poet by id /// /// /// /// Task> GetPoetById(int id, bool catPoems = false); /// /// get poet by url /// /// /// /// Task> GetPoetByUrl(string url, bool catPoems = false); /// /// poet image id by url /// /// /// Task> GetPoetImageIdByUrl(string url); /// /// get cat by id /// /// /// /// /// Task> GetCatById(int id, bool poems = false, bool mainSections = false); /// /// get cat by url /// /// /// /// /// Task> GetCatByUrl(string url, bool poems = false, bool mainSections = false); /// /// get page by url /// /// /// /// Task> GetPageByUrl(string url, bool catPoems = false); /// /// get page url by id /// /// /// Task> GetPageUrlById(int id); /// /// get redirect url for a url /// /// /// Task> GetRedirectAddressForPageUrl(string url); /// /// delete page /// /// /// Task> DeletePageAsync(int id); /// /// delete a poem /// /// /// Task> DeletePoemAsync(int id); /// /// Get Poem By Id /// /// /// /// /// /// /// /// /// /// /// /// /// /// Task> GetPoemById(int id, bool catInfo = true, bool catPoems = false, bool rhymes = true, bool recitations = true, bool images = true, bool songs = true, bool comments = true, bool verseDetails = true, bool navigation = true, bool relatedpoems = true, bool sections = true); /// /// Get Poem By Url /// /// /// /// /// /// /// /// /// /// /// /// Task> GetPoemByUrl(string url, bool catInfo = true, bool catPoems = false, bool rhymes = true, bool recitations = true, bool images = true, bool songs = true, bool comments = true, bool verseDetails = true, bool navigation = true); /// /// get poem recitations (PlainText/HtmlText are intentionally empty) /// /// /// Task> GetPoemRecitations(int id); /// /// get poem sections /// /// /// Task> GetPoemWholeSections(int id); /// /// get user up votes for the recitations of a poem /// /// /// /// Task> GetUserPoemRecitationsUpVotes(int id, Guid userId); /// /// get poem images by id (some fields are intentionally field with blank or null), /// EntityImageId : the most important data field, image url is {WebServiceUrl.Url}/api/images/thumb/{EntityImageId}.jpg or {WebServiceUrl.Url}/api/images/norm/{EntityImageId}.jpg /// /// /// Task> GetPoemImages(int id); /// /// get poem related songs /// /// /// /// /// Task> GetPoemSongs(int id, bool approved, PoemMusicTrackType trackType = PoemMusicTrackType.All); /// /// get poem comments /// /// /// /// /// Task> GetPoemComments(int poemId, Guid userId, int? coupletIndex); /// /// get a section related sections /// /// poem id /// section index /// /// if sent 0 or less returns all items /// Task> GetRelatedSections(int poemId, int sectionIndex, int skip, int itemsCount); /// /// send poem corrections /// /// /// Task> SuggestPoemCorrection(GanjoorPoemCorrectionViewModel correction); /// /// last unreviewed user correction for a poem /// /// /// /// Task> GetLastUnreviewedUserCorrectionForPoem(Guid userId, int poemId); /// /// user suggested songs /// /// /// /// Task> GetUserSuggestedSongs(Guid userId, PagingParameterModel paging); /// /// get user or all corrections /// /// if sent empty returns all corrections /// /// Task> GetUserCorrections(Guid userId, PagingParameterModel paging); /// /// effective corrections for poem /// /// /// /// Task> GetPoemEffectiveCorrections(int poemId, PagingParameterModel paging); /// /// get correction by id /// /// /// Task> GetCorrectionById(int id); /// /// delete unreviewed user corrections for a poem /// /// /// /// Task> DeletePoemCorrections(Guid userId, int poemId); /// /// get next unreviewed correction /// /// /// Task> GetNextUnreviewedCorrection(int skip); /// /// unreview correction count /// /// Task> GetUnreviewedCorrectionCount(); /// /// moderate poem correction /// /// /// /// Task> ModeratePoemCorrection(Guid userId, GanjoorPoemCorrectionViewModel correction); /// /// break a poem from a verse forward /// /// /// /// /// Task> BreakPoemAsync(int poemId, int vOrder, Guid userId); /// /// next unreviewed track /// /// /// /// Task> GetNextUnreviewedSong(int skip, Guid suggestedById); /// /// get track of user song suggestions /// /// /// Task> GetUserSongsSuggestionsStatistics(Guid userId); /// /// suggest song /// /// /// /// Task> SuggestSong(Guid userId, PoemMusicTrackViewModel song); /// /// get unreviewed count /// /// /// Task> GetUnreviewedSongsCount(Guid suggestedById); /// /// review song /// /// /// Task> ReviewSong(PoemMusicTrackViewModel song); /// /// direct insert song /// /// /// Task> DirectInsertSong(PoemMusicTrackViewModel song); /// /// get song by id /// /// /// Task> GetPoemSongById(int id); /// /// modify a published song /// /// /// Task> ModifyPublishedSong(PoemMusicTrackViewModel song); /// /// delete poem song by id /// /// /// Task> DeletePoemSongById(int id); /// /// new comment /// /// /// /// /// /// /// /// Task> NewComment(Guid userId, string ip, int poemId, string content, int? inReplyTo, int? coupletIndex); /// /// update user's own comment /// /// /// /// /// Task> EditMyComment(Guid userId, int commentId, string htmlComment); /// /// link or unlink user's own comment to a coupletIndex /// /// /// /// if null then unlinks /// couplet summary Task> LinkUnLinkMyComment(Guid userId, int commentId, int? coupletIndex); /// /// delete a reported comment /// /// /// Task> DeleteModerateComment(int reportId); /// /// delete user own comment /// /// /// /// Task> DeleteMyComment(Guid userId, int commentId); /// /// delete anybody's comment /// /// /// Task> DeleteAnybodyComment(int commentId); /// /// publish awaiting comment /// /// /// Task> PublishAwaitingComment(int commentId); /// /// get recent comments /// /// /// Guid.Empty /// /// /// /// Task> GetRecentComments(PagingParameterModel paging, Guid filterUserId, bool onlyPublished, bool onlyAwaiting = false, string term = null); /// /// report a comment /// /// /// /// id of report record Task> ReportComment(Guid userId, GanjoorPostReportCommentViewModel report); /// /// delete a report /// /// /// Task> DeleteReport(int id); /// /// Get list of reported comments /// /// /// Task> GetReportedComments(PagingParameterModel paging); /// /// Get Similar Poems accroding to prosody and rhyme informations /// /// /// /// /// /// Task> GetSimilarPoems(PagingParameterModel paging, string metre, string rhyme, int? poetId); /// /// modify page /// /// /// /// /// Task> UpdatePageAsync(int id, Guid editingUserId, GanjoorModifyPageViewModel pageData); /// /// modify poet /// /// /// /// Task> UpdatePoetAsync(GanjoorPoetViewModel poet, Guid editingUserId); /// /// create new poet /// /// /// /// Task> AddPoetAsync(GanjoorPoetViewModel poet, Guid editingUserId); /// /// delete poet /// /// /// RServiceResult StartDeletePoet(int id); /// /// chaneg poet image /// /// /// /// Task> ChangePoetImageAsync(int poetId, Guid imageId); /// /// returns metre list (ordered by Rhythm) /// /// /// Task> GetGanjoorMetres(bool sortOnVerseCount = false); /// /// get a random poem (2 = from hafez) /// /// /// /// Task> Faal(int poetId = 2, bool recitation = true); /// /// import from sqlite /// /// /// /// Task> ImportFromSqlite(int poetId, IFormFile file); /// /// import a catgory from sqlite /// /// /// /// Task> ImportCategoryFromSqlite(int catId, IFormFile file); /// /// Apply corrections from sqlite /// /// /// /// /// Task> ApplyCorrectionsFromSqlite(int poetId, IFormFile file, string note); /// /// export to sqlite /// /// /// Task> ExportToSqlite(int poetId); /// /// start generating gdb files /// /// RServiceResult StartBatchGenerateGDBFiles(); /// /// examine site pages for broken links /// /// RServiceResult HealthCheckContents(); /// /// examine comments for long links /// /// RServiceResult FindAndFixLongUrlsInComments(); /// /// start filling poems couplet indices /// /// RServiceResult StartFillingPoemsCoupletIndices(); /// /// separate verses in poem.PlainText with Environment.NewLine instead of SPACE /// /// /// RServiceResult RegerneratePoemsPlainText(int catId); /// /// clean cache for paeg by id /// /// /// Task CacheCleanForPageById(int id); /// /// clean cache for page by url /// /// void CacheCleanForPageByUrl(string url); /// /// clean cache for page by comment /// /// /// Task CacheCleanForComment(int commentId); /// /// page modifications history /// /// /// Task> GetOlderVersionsOfPage(int pageId); /// /// get old version /// /// /// Task> GetOldVersionOfPage(int id); /// /// Search /// /// /// /// /// /// Task> Search(PagingParameterModel paging, string term, int? poetId, int? catId); /// /// batch rename /// /// /// /// /// Task> BatchRenameCatPoemTitles(int catId, GanjoorBatchNamingModel model, Guid userId); /// /// find poem rhyme /// /// /// Task> FindPoemMainSectionRhyme(int id); /// /// find category poem rhymes /// /// /// /// RServiceResult FindCategoryPoemsRhymes(int catId, bool retag); /// /// Start finding missing rhthms /// /// /// /// RServiceResult StartFindingMissingRhythms(bool onlyPoemsWithRhymes, int poemsNum = 1000); /// /// find poem rhythm /// /// /// Task> FindPoemMainSectionRhythm(int id); /// /// find category poem rhymes /// /// /// /// /// RServiceResult FindCategoryPoemsRhythms(int catId, bool retag, string rhythm = ""); /// /// generate category TOC /// /// /// /// Task> GenerateTableOfContents(int catId, GanjoorTOC options); /// /// directly insert generated TOC /// /// /// /// /// Task> DirectInsertGeneratedTableOfContents(int catId, Guid userId, GanjoorTOC options); /// /// start generating sub cats TOC /// /// /// /// RServiceResult StartGeneratingSubCatsTOC(Guid userId, int catId); /// /// build sitemap /// /// RServiceResult StartBuildingSitemap(); /// /// start updating stats page /// /// RServiceResult StartUpdatingStatsPage(Guid editingUserId); /// /// start updating mundex page /// /// RServiceResult StartUpdatingMundexPage(Guid editingUserId); /// /// Switch Bookmark for couplet /// /// /// /// /// Task> SwitchCoupletBookmark(Guid userId, int poemId, int coupletIndex); /// /// Bookmark couplet if it is not /// /// /// /// /// Task> BookmarkCoupletIfNotBookmarked(Guid userId, int poemId, int coupletIndex); /// /// delete user bookmark /// /// /// /// to make sure a user can not delete another user's bookmarks /// Task> DeleteGanjoorBookmark(Guid bookmarkId, Guid userId); /// /// modify bookmark private note /// /// /// to make sure a user can not modify another user's bookmarks /// /// Task> ModifyBookmarkPrivateNoteAsync(Guid bookmarkId, Guid userId, string note); /// /// get user ganjoor bookmarks (only Id, CoupletIndex and DateTime are valid) /// /// /// /// Task> GetPoemUserBookmarks(Guid userId, int poemId); /// /// get verse bookmarks /// /// /// /// /// Task> IsCoupletBookmarked(Guid userId, int poemId, int coupletIndex); /// /// get user bookmarks (artifacts and items) /// /// /// /// Task> GetUserBookmarks(PagingParameterModel paging, Guid userId); /// /// regenerate half centuries /// /// Task> RegenerateHalfCenturiesAsync(); /// /// get centuries with published poets /// /// Task> GetCenturiesAsync(); /// /// start generating related sections info /// /// /// RServiceResult StartGeneratingRelatedSectionsInfo(bool regenerate); /// /// get next ganjoor poem probable metre /// /// Task> GetNextGanjoorPoemProbableMetre(); /// /// get a list of ganjoor poems probable metres /// /// /// Task> GetUnreviewedGanjoorPoemProbableMetres(PagingParameterModel paging); /// /// save ganjoor poem probable metre /// /// problable metre id /// /// Task> SaveGanjoorPoemProbableMetre(int id, string metre); /// /// return list of suggested spec lines /// /// /// Task> GetPoetSuggestedSpecLinesAsync(int poetId); /// /// returns specfic suggested line for poet /// /// /// Task> GetPoetSuggestedSpecLineAsync(int id); /// /// next unpublished suggested line for poets /// /// /// Task> GetNextUnmoderatedPoetSuggestedSpecLineAsync(int skip); /// /// npublished suggested lines count for poets /// /// Task> GetNextUnmoderatedPoetSuggestedSpecLinesCountAsync(); /// /// add a suggestion for poets spec lines /// /// /// Task> AddPoetSuggestedSpecLinesAsync(GanjoorPoetSuggestedSpecLineViewModel model); /// /// modify a suggestion for poets spec lines /// /// /// Task> ModifyPoetSuggestedSpecLinesAsync(GanjoorPoetSuggestedSpecLineViewModel model); /// /// reject a suggestion for poets spec lines /// /// /// /// /// Task> RejectPoetSuggestedSpecLinesAsync(int id, Guid deleteUserId, string rejectionCause); /// /// delete a category /// /// /// Task> DeleteCategoryAsync(int id); /// /// set category poems language tag /// /// /// /// Task> SetCategoryLanguageTag(int catId, string language); /// /// regenerate TOCs /// /// /// RServiceResult StartRegeneratingTOCs(Guid userId); /// /// Finding Category Poems Duplicates /// /// /// /// /// RServiceResult StartFindingCategoryPoemsDuplicates(int srcCatId, int destCatId, bool hardTry); /// /// list of category saved duplicated poems /// /// /// Task> GetCategoryDuplicates(int catId); /// /// manually add a duplicate for a poems /// /// /// /// /// Task> AdDuplicateAsync(int srcCatId, int srcPoemId, int destPoemId); /// /// delete duplicate /// /// /// Task> DeleteDuplicateAsync(int id); /// /// start removing category duplicates /// /// /// /// RServiceResult StartRemovingCategoryDuplicates(int catId, int destCatId); /// /// sectionizing poems /// /// RServiceResult StartFillingPoemSectionsCoupletIndex(); /// /// start band couplets fix /// /// RServiceResult StartOnTimeBandCoupletsFix(); /// /// get couplet sections /// /// /// /// Task> GetCoupletSectionsAsync(int poemId, int coupletIndex); /// /// get all poem sections /// /// /// Task> GetPoemSectionsAsync(int id); /// /// last unreviewed user correction for a section /// /// /// /// Task> GetLastUnreviewedUserCorrectionForSection(Guid userId, int sectionId); } }