Compare commits
3 Commits
bebca989d0
...
3f1bfc1c3c
Author | SHA1 | Date | |
---|---|---|---|
3f1bfc1c3c | |||
fdf75934e5 | |||
f603d87b33 |
@ -40,7 +40,7 @@ namespace Yavsc.ApiControllers
|
|||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("query/reject")]
|
[HttpPost("query/accept")]
|
||||||
public IActionResult AcceptQuery(string billingCode, long queryId)
|
public IActionResult AcceptQuery(string billingCode, long queryId)
|
||||||
{
|
{
|
||||||
if (billingCode == null) return BadRequest("billingCode");
|
if (billingCode == null) return BadRequest("billingCode");
|
||||||
@ -51,7 +51,6 @@ namespace Yavsc.ApiControllers
|
|||||||
billing.Decided = true;
|
billing.Decided = true;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
return Ok();
|
return Ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using Yavsc.Abstract.Identity;
|
||||||
|
|
||||||
namespace Yavsc
|
namespace Yavsc
|
||||||
{
|
{
|
||||||
public interface IBlogPostPayLoad
|
public interface IBlogPostPayLoad
|
||||||
@ -12,5 +14,6 @@ namespace Yavsc
|
|||||||
public interface IBlogPost : IBlogPostPayLoad, ITrackedEntity, IIdentified<long>, ITitle
|
public interface IBlogPost : IBlogPostPayLoad, ITrackedEntity, IIdentified<long>, ITitle
|
||||||
{
|
{
|
||||||
string AuthorId { get; set; }
|
string AuthorId { get; set; }
|
||||||
|
IApplicationUser Author { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ namespace Yavsc.Models.Google.Messaging
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The error.
|
/// The error.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string error;
|
public string? error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
public interface IApplicationUser
|
public interface IApplicationUser
|
||||||
{
|
{
|
||||||
string Id { get; set; }
|
string Id { get; set; }
|
||||||
string UserName { get; set; }
|
string? UserName { get; set; }
|
||||||
string Avatar { get ; set; }
|
string? Avatar { get ; set; }
|
||||||
IAccountBalance AccountBalance { get; set; }
|
IAccountBalance? AccountBalance { get; }
|
||||||
string DedicatedGoogleCalendar { get; set; }
|
string? DedicatedGoogleCalendar { get; }
|
||||||
ILocation PostalAddress { get; set; }
|
ILocation? PostalAddress { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ namespace Yavsc.Abstract.Identity.Security
|
|||||||
public interface ICircleAuthorized
|
public interface ICircleAuthorized
|
||||||
{
|
{
|
||||||
long Id { get; set; }
|
long Id { get; set; }
|
||||||
string OwnerId { get; }
|
string AuthorId { get; }
|
||||||
bool AuthorizeCircle(long circleId);
|
bool AuthorizeCircle(long circleId);
|
||||||
ICircleAuthorization [] GetACL();
|
ICircleAuthorization [] GetACL();
|
||||||
|
|
||||||
|
3518
src/Yavsc.Server/Migrations/20250629174955_blogPusb2.Designer.cs
generated
Normal file
3518
src/Yavsc.Server/Migrations/20250629174955_blogPusb2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
79
src/Yavsc.Server/Migrations/20250629174955_blogPusb2.cs
Normal file
79
src/Yavsc.Server/Migrations/20250629174955_blogPusb2.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Yavsc.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class blogPusb2 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_blogspotPublications_BlogSpot_BlogpostId",
|
||||||
|
table: "blogspotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_blogspotPublications",
|
||||||
|
table: "blogspotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "blogspotPublications",
|
||||||
|
newName: "blogSpotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "Publish",
|
||||||
|
table: "BlogSpot",
|
||||||
|
type: "boolean",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_blogSpotPublications",
|
||||||
|
table: "blogSpotPublications",
|
||||||
|
column: "BlogpostId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_blogSpotPublications_BlogSpot_BlogpostId",
|
||||||
|
table: "blogSpotPublications",
|
||||||
|
column: "BlogpostId",
|
||||||
|
principalTable: "BlogSpot",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_blogSpotPublications_BlogSpot_BlogpostId",
|
||||||
|
table: "blogSpotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_blogSpotPublications",
|
||||||
|
table: "blogSpotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Publish",
|
||||||
|
table: "BlogSpot");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "blogSpotPublications",
|
||||||
|
newName: "blogspotPublications");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_blogspotPublications",
|
||||||
|
table: "blogspotPublications",
|
||||||
|
column: "BlogpostId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_blogspotPublications_BlogSpot_BlogpostId",
|
||||||
|
table: "blogspotPublications",
|
||||||
|
column: "BlogpostId",
|
||||||
|
principalTable: "BlogSpot",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3518
src/Yavsc.Server/Migrations/20250629175034_blogPub2.Designer.cs
generated
Normal file
3518
src/Yavsc.Server/Migrations/20250629175034_blogPub2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
src/Yavsc.Server/Migrations/20250629175034_blogPub2.cs
Normal file
22
src/Yavsc.Server/Migrations/20250629175034_blogPub2.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Yavsc.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class blogPub2 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -774,6 +774,9 @@ namespace Yavsc.Migrations
|
|||||||
.HasMaxLength(1024)
|
.HasMaxLength(1024)
|
||||||
.HasColumnType("character varying(1024)");
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<bool>("Publish")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<string>("Title")
|
b.Property<string>("Title")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(1024)
|
.HasMaxLength(1024)
|
||||||
@ -857,14 +860,14 @@ namespace Yavsc.Migrations
|
|||||||
b.ToTable("Comment");
|
b.ToTable("Comment");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Models.BlogspotPublication", b =>
|
modelBuilder.Entity("Yavsc.Models.BlogSpotPublication", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("BlogpostId")
|
b.Property<long>("BlogpostId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.HasKey("BlogpostId");
|
b.HasKey("BlogpostId");
|
||||||
|
|
||||||
b.ToTable("blogspotPublications");
|
b.ToTable("blogSpotPublications");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b =>
|
modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b =>
|
||||||
@ -2773,7 +2776,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Navigation("Post");
|
b.Navigation("Post");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Models.BlogspotPublication", b =>
|
modelBuilder.Entity("Yavsc.Models.BlogSpotPublication", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Yavsc.Models.Blog.BlogPost", "BlogPost")
|
b.HasOne("Yavsc.Models.Blog.BlogPost", "BlogPost")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -7,10 +7,12 @@ using Yavsc.Models.Identity;
|
|||||||
using Yavsc.Models.Chat;
|
using Yavsc.Models.Chat;
|
||||||
using Yavsc.Models.Bank;
|
using Yavsc.Models.Bank;
|
||||||
using Yavsc.Models.Access;
|
using Yavsc.Models.Access;
|
||||||
|
using Yavsc.Abstract.Identity;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
[Table("AspNetUsers")]
|
[Table("AspNetUsers")]
|
||||||
public class ApplicationUser : IdentityUser
|
public class ApplicationUser : IdentityUser, IApplicationUser
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Another me, as a byte array.TG7@Eu%80rufzkhbb
|
/// Another me, as a byte array.TG7@Eu%80rufzkhbb
|
||||||
@ -22,10 +24,10 @@ namespace Yavsc.Models
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[MaxLength(512)]
|
[MaxLength(512)]
|
||||||
public string Avatar { get; set; }
|
public string? Avatar { get; set; }
|
||||||
|
|
||||||
[MaxLength(512)]
|
[MaxLength(512)]
|
||||||
public string FullName { get; set; }
|
public string? FullName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -33,7 +35,7 @@ namespace Yavsc.Models
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Display(Name = "Account balance")]
|
[Display(Name = "Account balance")]
|
||||||
public virtual AccountBalance AccountBalance { get; set; }
|
public virtual AccountBalance? AccountBalance { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User's posts
|
/// User's posts
|
||||||
@ -113,5 +115,8 @@ namespace Yavsc.Models
|
|||||||
[InverseProperty("Member")]
|
[InverseProperty("Member")]
|
||||||
public virtual List<CircleMember> Membership { get; set; }
|
public virtual List<CircleMember> Membership { get; set; }
|
||||||
|
|
||||||
|
IAccountBalance? IApplicationUser.AccountBalance => AccountBalance;
|
||||||
|
|
||||||
|
ILocation? IApplicationUser.PostalAddress { get => PostalAddress; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Yavsc;
|
||||||
|
using Yavsc.Abstract.Identity;
|
||||||
using Yavsc.Abstract.Identity.Security;
|
using Yavsc.Abstract.Identity.Security;
|
||||||
using Yavsc.Attributes.Validation;
|
using Yavsc.Attributes.Validation;
|
||||||
using Yavsc.Interfaces;
|
using Yavsc.Interfaces;
|
||||||
@ -86,7 +88,6 @@ namespace Yavsc.Models.Blog
|
|||||||
[InverseProperty("Post")]
|
[InverseProperty("Post")]
|
||||||
public virtual List<Comment> Comments { get; set; }
|
public virtual List<Comment> Comments { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
IApplicationUser IBlogPost.Author { get => this.Author; }
|
||||||
public string OwnerId => AuthorId;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ namespace Yavsc.Models.societe.com
|
|||||||
public class CompanyInfoMessage
|
public class CompanyInfoMessage
|
||||||
{
|
{
|
||||||
public bool success { get; set; }
|
public bool success { get; set; }
|
||||||
public string errorType { get; set; }
|
public string? errorType { get; set; }
|
||||||
public string errorCode { get; set; }
|
public string? errorCode { get; set; }
|
||||||
public string errorMessage { get; set; }
|
public string? errorMessage { get; set; }
|
||||||
public CompanyInfo result { get; set; }
|
public CompanyInfo? result { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace Yavsc.Controllers
|
|||||||
await blogSpotService.UserPosts(id, User.GetUserId(),
|
await blogSpotService.UserPosts(id, User.GetUserId(),
|
||||||
skip, take));
|
skip, take));
|
||||||
}
|
}
|
||||||
var byTitle = await this.blogSpotService.IndexByTitle(User, id, skip, take);
|
IEnumerable<IGrouping<string,IBlogPost>> byTitle = await this.blogSpotService.IndexByTitle(User, id, skip, take);
|
||||||
return View(byTitle);
|
return View(byTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public class PermissionHandler : IAuthorizationHandler
|
|||||||
{
|
{
|
||||||
return applicationDbContext.CircleMembers
|
return applicationDbContext.CircleMembers
|
||||||
.Include(c => c.Circle)
|
.Include(c => c.Circle)
|
||||||
.Where(m=>m.MemberId==user.GetUserId() && m.Circle.OwnerId == blogPost.OwnerId)
|
.Where(m=>m.MemberId==user.GetUserId() && m.Circle.OwnerId == blogPost.AuthorId)
|
||||||
.Any();
|
.Any();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -22,7 +22,7 @@ namespace Yavsc.ViewComponents
|
|||||||
{
|
{
|
||||||
if (target!=null)
|
if (target!=null)
|
||||||
{
|
{
|
||||||
var oid = target.OwnerId;
|
var oid = target.AuthorId;
|
||||||
ViewBag.ACL = dbContext.Circle.Where(
|
ViewBag.ACL = dbContext.Circle.Where(
|
||||||
c=>c.OwnerId == oid)
|
c=>c.OwnerId == oid)
|
||||||
.Select(
|
.Select(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@model IEnumerable<IGrouping<string,BlogPost>>
|
@model IEnumerable<IGrouping<string,IBlogPost>>
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Blogs, l'index";
|
ViewData["Title"] = "Blogs, l'index";
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
|
@using Yavsc.Abstract.Identity
|
||||||
@model ApplicationUser
|
@model ApplicationUser
|
||||||
@{
|
@{
|
||||||
var avuri = "/Avatars/" + Model.UserName + ".s.png";
|
var avuri = "/Avatars/" + Model.UserName + ".s.png";
|
||||||
var userPosted = Model.Posts!=null && Model.Posts.Count()>=1;
|
|
||||||
}
|
}
|
||||||
<div class="userinfo">
|
<div class="userinfo">
|
||||||
@if (userPosted) { <a asp-controller="Blogspot" asp-action="Index"
|
<a title="Posts" asp-controller="Blogspot" asp-action="Index" asp-route-id="@Model.UserName" class="btn btn-primary">
|
||||||
asp-route-id="@Model.UserName" class="btn btn-primary">
|
|
||||||
<img src="@avuri" asp-append-version="true" class="smalltofhol" alt="@Model.UserName" title="@Model.UserName" />
|
<img src="@avuri" asp-append-version="true" class="smalltofhol" alt="@Model.UserName" title="@Model.UserName" />
|
||||||
</a>
|
</a>
|
||||||
} else {
|
|
||||||
Html.DisplayFor(m=>m.UserName);
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
@using Yavsc.Abstract.Identity
|
||||||
|
@model IApplicationUser
|
||||||
|
@{
|
||||||
|
var avuri = "/Avatars/" + Model.UserName + ".s.png";
|
||||||
|
}
|
||||||
|
<div class="userinfo">
|
||||||
|
<a title="Posts" asp-controller="Blogspot" asp-action="Index" asp-route-id="@Model.UserName" class="btn btn-primary">
|
||||||
|
<img src="@avuri" asp-append-version="true" class="smalltofhol" alt="@Model.UserName" title="@Model.UserName" />
|
||||||
|
</a>
|
||||||
|
</div>
|
Reference in New Issue
Block a user