From 081d633afaf09fe53a1195d40a3662981a0623d8 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Tue, 2 Mar 2021 19:32:10 +0330 Subject: [PATCH] #80 adding GanjoorCommentAbuseReport model --- RMuseum/DbContext/RMuseumDbContext.cs | 5 ++ .../Ganjoor/GanjoorCommentAbuseReport.cs | 47 +++++++++++++++++++ RMuseum/RMuseum.xml | 45 ++++++++++++++++++ .../GanjoorService-MySqlImports.cs | 6 +++ RMuseum/appsettings.json | 5 +- 5 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 RMuseum/Models/Ganjoor/GanjoorCommentAbuseReport.cs diff --git a/RMuseum/DbContext/RMuseumDbContext.cs b/RMuseum/DbContext/RMuseumDbContext.cs index ef497ca7..aca2f31b 100644 --- a/RMuseum/DbContext/RMuseumDbContext.cs +++ b/RMuseum/DbContext/RMuseumDbContext.cs @@ -235,6 +235,11 @@ namespace RMuseum.DbContext /// public DbSet GanjoorComments { get; set; } + /// + /// Ganjoor Reported Comments + /// + public DbSet GanjoorReportedComments { get; set; } + } } diff --git a/RMuseum/Models/Ganjoor/GanjoorCommentAbuseReport.cs b/RMuseum/Models/Ganjoor/GanjoorCommentAbuseReport.cs new file mode 100644 index 00000000..04f9e850 --- /dev/null +++ b/RMuseum/Models/Ganjoor/GanjoorCommentAbuseReport.cs @@ -0,0 +1,47 @@ +using RSecurityBackend.Models.Auth.Db; +using System; + +namespace RMuseum.Models.Ganjoor +{ + /// + /// Comment Abuse Report + /// + public class GanjoorCommentAbuseReport + { + /// + /// id + /// + public int Id { get; set; } + + /// + /// comment id + /// + public int GanjoorCommentId { get; set; } + + /// + /// comment + /// + public GanjoorComment GanjoorComment { get; set; } + + /// + /// reason code for better grouping: offensive, bogus, other + /// + public string ReasonCode { get; set; } + + /// + /// some explanotory text provided by reporter + /// + public string ReasonText { get; set; } + + /// + /// reported by id + /// + public Guid? ReportedById { get; set; } + + /// + /// reported by user + /// + public virtual RAppUser ReportedBy { get; set; } + + } +} diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 3979e8e1..1d29c02b 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -1332,6 +1332,11 @@ Ganjoor Comments + + + Ganjoor Reported Comments + + Items or pictures status @@ -3643,6 +3648,46 @@ publish status + + + Comment Abuse Report + + + + + id + + + + + comment id + + + + + comment + + + + + reason code for better grouping: offensive, bogus, other + + + + + some explanotory text provided by reporter + + + + + reported by id + + + + + reported by user + + Poem prosodic Metre diff --git a/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs b/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs index 259c5cbb..f95e2bea 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs @@ -43,6 +43,12 @@ namespace RMuseum.Services.Implementation var job = (await jobProgressServiceEF.NewJob("GanjoorService:ImportFromMySql", "pre open connection")).Result; + if(string.IsNullOrEmpty(Configuration.GetSection("AudioMySqlServer")["ReportedCommentsDatabase"])) + { + await jobProgressServiceEF.UpdateJob(job.Id, job.Progress, "", false, "ReportedCommentsDatabase is not set"); + return; + } + MusicCatalogueService catalogueService = new MusicCatalogueService(Configuration, context); RServiceResult musicCatalogueRes = await catalogueService.ImportFromMySql("MusicCatalogueImportFromMySql", jobProgressServiceEF, job); diff --git a/RMuseum/appsettings.json b/RMuseum/appsettings.json index 44cbecb3..f938d17d 100644 --- a/RMuseum/appsettings.json +++ b/RMuseum/appsettings.json @@ -44,7 +44,10 @@ "2ndPassword": "", "SongsDatabase": "golha", "SongsUsername": "root", - "SongsPassword": "" + "SongsPassword": "", + "ReportedCommentsDatabase": "rpcmnts", + "ReportedCommentsUsername": "root", + "ReportedCommentsPassword": "" }, "AudioSFPServer": { "Host": "localhost",