Profile links

This commit is contained in:
2025-08-08 23:28:24 +08:00
parent a32c06552f
commit c514adfbbf
5 changed files with 1783 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ public class AccountProfile : ModelBase, IIdentifiedResource
[MaxLength(1024)] public string? Pronouns { get; set; } [MaxLength(1024)] public string? Pronouns { get; set; }
[MaxLength(1024)] public string? TimeZone { get; set; } [MaxLength(1024)] public string? TimeZone { get; set; }
[MaxLength(1024)] public string? Location { get; set; } [MaxLength(1024)] public string? Location { get; set; }
[Column(TypeName = "jsonb")] public Dictionary<string, string>? Links { get; set; }
public Instant? Birthday { get; set; } public Instant? Birthday { get; set; }
public Instant? LastSeenAt { get; set; } public Instant? LastSeenAt { get; set; }

View File

@@ -77,6 +77,7 @@ public class AccountCurrentController(
[MaxLength(1024)] public string? Location { get; set; } [MaxLength(1024)] public string? Location { get; set; }
[MaxLength(4096)] public string? Bio { get; set; } [MaxLength(4096)] public string? Bio { get; set; }
public Instant? Birthday { get; set; } public Instant? Birthday { get; set; }
public Dictionary<string, string>? Links { get; set; }
[MaxLength(32)] public string? PictureId { get; set; } [MaxLength(32)] public string? PictureId { get; set; }
[MaxLength(32)] public string? BackgroundId { get; set; } [MaxLength(32)] public string? BackgroundId { get; set; }
@@ -102,6 +103,7 @@ public class AccountCurrentController(
if (request.Birthday is not null) profile.Birthday = request.Birthday; if (request.Birthday is not null) profile.Birthday = request.Birthday;
if (request.Location is not null) profile.Location = request.Location; if (request.Location is not null) profile.Location = request.Location;
if (request.TimeZone is not null) profile.TimeZone = request.TimeZone; if (request.TimeZone is not null) profile.TimeZone = request.TimeZone;
if (request.Links is not null) profile.Links = request.Links;
if (request.PictureId is not null) if (request.PictureId is not null)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Pass.Migrations
{
/// <inheritdoc />
public partial class AddProfileLinks : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Dictionary<string, string>>(
name: "links",
table: "account_profiles",
type: "jsonb",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "links",
table: "account_profiles");
}
}
}

View File

@@ -431,6 +431,10 @@ namespace DysonNetwork.Pass.Migrations
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
.HasColumnName("last_seen_at"); .HasColumnName("last_seen_at");
b.Property<Dictionary<string, string>>("Links")
.HasColumnType("jsonb")
.HasColumnName("links");
b.Property<string>("Location") b.Property<string>("Location")
.HasMaxLength(1024) .HasMaxLength(1024)
.HasColumnType("character varying(1024)") .HasColumnType("character varying(1024)")