Mostly backend models stuff
Changed some models, did some work on database, created a class diagram.
This commit is contained in:
@@ -3,15 +3,10 @@ import { createApp } from "vue";
|
|||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
import BalmUI from "balm-ui"; // Official Google Material Components
|
|
||||||
import BalmUIPlus from "balm-ui-plus"; // BalmJS Team Material Components
|
|
||||||
import "balm-ui-css";
|
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(store);
|
app.use(store);
|
||||||
app.use(BalmUI);
|
|
||||||
app.use(BalmUIPlus);
|
|
||||||
|
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<h1 @click="makeTestCall">OpenID connect return endpoint</h1>
|
<h1 @click="makeTestCall">OpenID connect return endpoint</h1>
|
||||||
{{ response }}
|
<pre style="text-align: left">{{ response }}</pre>
|
||||||
{{ openIdToken }}
|
{{ openIdToken }}
|
||||||
<hr />
|
<hr />
|
||||||
{{ $route }}
|
{{ $route }}
|
||||||
|
@@ -15,6 +15,9 @@ namespace KTUSA_PS.Controllers
|
|||||||
public class TestController : ControllerBase
|
public class TestController : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public bool Index() => true;
|
public Object[] Index()
|
||||||
|
{
|
||||||
|
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,4 @@
|
|||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Model\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
59
KTUSAPS.Data/Model/ClassDiagram1.cd
Normal file
59
KTUSAPS.Data/Model/ClassDiagram1.cd
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||||
|
<Class Name="KTUSAPS.Data.Model.Issue">
|
||||||
|
<Position X="0.75" Y="1.25" Width="1.5" />
|
||||||
|
<TypeIdentifier>
|
||||||
|
<HashCode>AAACAAJAACAgAAAAAAACAAgIAAEAAAQAAAAAAAAAAAA=</HashCode>
|
||||||
|
<FileName>Model\Issue.cs</FileName>
|
||||||
|
</TypeIdentifier>
|
||||||
|
<ShowAsAssociation>
|
||||||
|
<Property Name="Feedback" />
|
||||||
|
<Property Name="Problem" />
|
||||||
|
</ShowAsAssociation>
|
||||||
|
</Class>
|
||||||
|
<Class Name="KTUSAPS.Data.Model.PublishedFeedback">
|
||||||
|
<Position X="3.75" Y="3.75" Width="1.5" />
|
||||||
|
<TypeIdentifier>
|
||||||
|
<HashCode>AAECAAAAAAAAAAAACAIAAAAAAAAAAAQAEAAAAAAAAAA=</HashCode>
|
||||||
|
<FileName>Model\PublishedFeedback.cs</FileName>
|
||||||
|
</TypeIdentifier>
|
||||||
|
<ShowAsAssociation>
|
||||||
|
<Property Name="Issue" />
|
||||||
|
</ShowAsAssociation>
|
||||||
|
</Class>
|
||||||
|
<Class Name="KTUSAPS.Data.Model.PublishedProblem">
|
||||||
|
<Position X="3.75" Y="0.5" Width="1.5" />
|
||||||
|
<TypeIdentifier>
|
||||||
|
<HashCode>ACECABAAAAEAAAgAAAABAAAAEAAAQAQAEAAAAAAAAAA=</HashCode>
|
||||||
|
<FileName>Model\PublishedProblem.cs</FileName>
|
||||||
|
</TypeIdentifier>
|
||||||
|
<ShowAsAssociation>
|
||||||
|
<Property Name="Solution" />
|
||||||
|
<Property Name="Issue" />
|
||||||
|
</ShowAsAssociation>
|
||||||
|
<ShowAsCollectionAssociation>
|
||||||
|
<Property Name="Votes" />
|
||||||
|
</ShowAsCollectionAssociation>
|
||||||
|
</Class>
|
||||||
|
<Class Name="KTUSAPS.Data.Model.Solution">
|
||||||
|
<Position X="6.5" Y="0.5" Width="1.5" />
|
||||||
|
<TypeIdentifier>
|
||||||
|
<HashCode>AAACAAIABAAAAQAAAAAAAAAAAAAAAAQAAAAAAAAAAAA=</HashCode>
|
||||||
|
<FileName>Model\Solution.cs</FileName>
|
||||||
|
</TypeIdentifier>
|
||||||
|
<ShowAsAssociation>
|
||||||
|
<Property Name="Problem" />
|
||||||
|
</ShowAsAssociation>
|
||||||
|
</Class>
|
||||||
|
<Class Name="KTUSAPS.Data.Model.Vote">
|
||||||
|
<Position X="6.5" Y="2.25" Width="1.5" />
|
||||||
|
<TypeIdentifier>
|
||||||
|
<HashCode>AAAAAAIAAAAAEAAAAAAAAAgAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||||
|
<FileName>Model\Vote.cs</FileName>
|
||||||
|
</TypeIdentifier>
|
||||||
|
<ShowAsAssociation>
|
||||||
|
<Property Name="Problem" />
|
||||||
|
</ShowAsAssociation>
|
||||||
|
</Class>
|
||||||
|
<Font Name="Segoe UI" Size="9" />
|
||||||
|
</ClassDiagram>
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -9,8 +10,10 @@ namespace KTUSAPS.Data.Model
|
|||||||
{
|
{
|
||||||
public class Issue
|
public class Issue
|
||||||
{
|
{
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
[MaxLength(64)]
|
||||||
|
public string UserID { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public bool Anonimous { get; set; }
|
public bool Anonimous { get; set; }
|
||||||
public bool Publishable { get; set; }
|
public bool Publishable { get; set; }
|
||||||
@@ -20,5 +23,6 @@ namespace KTUSAPS.Data.Model
|
|||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
public PublishedProblem Problem { get; set; }
|
public PublishedProblem Problem { get; set; }
|
||||||
|
public PublishedFeedback Feedback { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -9,6 +10,7 @@ namespace KTUSAPS.Data.Model
|
|||||||
{
|
{
|
||||||
public class PublishedFeedback
|
public class PublishedFeedback
|
||||||
{
|
{
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -9,6 +10,7 @@ namespace KTUSAPS.Data.Model
|
|||||||
{
|
{
|
||||||
public class PublishedProblem
|
public class PublishedProblem
|
||||||
{
|
{
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
@@ -28,5 +30,8 @@ namespace KTUSAPS.Data.Model
|
|||||||
|
|
||||||
public int? SolutionId { get; set; }
|
public int? SolutionId { get; set; }
|
||||||
public Solution Solution { get; set; }
|
public Solution Solution { get; set; }
|
||||||
|
public ICollection<Vote> Votes { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace KTUSAPS.Data.Model
|
namespace KTUSAPS.Data.Model
|
||||||
{
|
{
|
||||||
public class Solution
|
public class Solution
|
||||||
{
|
{
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string SolutionLt { get; set; }
|
public string SolutionLt { get; set; }
|
||||||
|
18
KTUSAPS.Data/Model/Vote.cs
Normal file
18
KTUSAPS.Data/Model/Vote.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KTUSAPS.Data.Model
|
||||||
|
{
|
||||||
|
public class Vote
|
||||||
|
{
|
||||||
|
[MaxLength(64)]
|
||||||
|
public string UserId { get; set; }
|
||||||
|
public int ProblemId { get; set; }
|
||||||
|
public PublishedProblem Problem { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using KTUSAPS.Data.Model;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -13,7 +14,8 @@ namespace KTUSAPS.Data
|
|||||||
public SAPSDataContext(DbContextOptions options) : base(options) { }
|
public SAPSDataContext(DbContextOptions options) : base(options) { }
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
modelBuilder.Entity<Vote>()
|
||||||
|
.HasKey(v => new { v.UserId, v.ProblemId });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
@@ -24,6 +26,11 @@ namespace KTUSAPS.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DbSet<Issue> Issues { get; set; }
|
||||||
|
public DbSet<PublishedFeedback> PublishedFeedbacks { get; set; }
|
||||||
|
public DbSet<PublishedProblem> PublishedProblems { get; set; }
|
||||||
|
public DbSet<Solution> Solutions { get; set; }
|
||||||
|
public DbSet<Vote> Votes { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user