✨ Username color
This commit is contained in:
@@ -80,6 +80,7 @@ public class AccountCurrentController(
|
|||||||
[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; }
|
||||||
[MaxLength(4096)] public string? Bio { get; set; }
|
[MaxLength(4096)] public string? Bio { get; set; }
|
||||||
|
public UsernameColor? UsernameColor { get; set; }
|
||||||
public Instant? Birthday { get; set; }
|
public Instant? Birthday { get; set; }
|
||||||
public List<ProfileLink>? Links { get; set; }
|
public List<ProfileLink>? Links { get; set; }
|
||||||
|
|
||||||
@@ -115,6 +116,7 @@ public class AccountCurrentController(
|
|||||||
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.Links is not null) profile.Links = request.Links;
|
||||||
|
if (request.UsernameColor is not null) profile.UsernameColor = request.UsernameColor;
|
||||||
|
|
||||||
if (request.PictureId is not null)
|
if (request.PictureId is not null)
|
||||||
{
|
{
|
||||||
|
2359
DysonNetwork.Pass/Migrations/20251008050851_AddUsernameColor.Designer.cs
generated
Normal file
2359
DysonNetwork.Pass/Migrations/20251008050851_AddUsernameColor.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
|||||||
|
using DysonNetwork.Shared.Models;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace DysonNetwork.Pass.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddUsernameColor : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<UsernameColor>(
|
||||||
|
name: "username_color",
|
||||||
|
table: "account_profiles",
|
||||||
|
type: "jsonb",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "username_color",
|
||||||
|
table: "account_profiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -478,6 +478,10 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("updated_at");
|
.HasColumnName("updated_at");
|
||||||
|
|
||||||
|
b.Property<UsernameColor>("UsernameColor")
|
||||||
|
.HasColumnType("jsonb")
|
||||||
|
.HasColumnName("username_color");
|
||||||
|
|
||||||
b.Property<SnVerificationMark>("Verification")
|
b.Property<SnVerificationMark>("Verification")
|
||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("verification");
|
.HasColumnName("verification");
|
||||||
|
@@ -142,6 +142,14 @@ public abstract class Leveling
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UsernameColor
|
||||||
|
{
|
||||||
|
public string Type { get; set; } = "plain"; // "plain" | "gradient"
|
||||||
|
public string? Value { get; set; } // e.g. "red" or "#ff6600"
|
||||||
|
public string? Direction { get; set; } // e.g. "to right"
|
||||||
|
public List<string>? Colors { get; set; } // e.g. ["#ff0000", "#00ff00"]
|
||||||
|
}
|
||||||
|
|
||||||
public class SnAccountProfile : ModelBase, IIdentifiedResource
|
public class SnAccountProfile : ModelBase, IIdentifiedResource
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; } = Guid.NewGuid();
|
public Guid Id { get; set; } = Guid.NewGuid();
|
||||||
@@ -154,6 +162,7 @@ public class SnAccountProfile : ModelBase, IIdentifiedResource
|
|||||||
[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 List<ProfileLink>? Links { get; set; }
|
[Column(TypeName = "jsonb")] public List<ProfileLink>? Links { get; set; }
|
||||||
|
[Column(TypeName = "jsonb")] public UsernameColor? UsernameColor { get; set; }
|
||||||
public Instant? Birthday { get; set; }
|
public Instant? Birthday { get; set; }
|
||||||
public Instant? LastSeenAt { get; set; }
|
public Instant? LastSeenAt { get; set; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user