feat(backend): initial /api/v1/users endpoint
This commit is contained in:
parent
5e7df2e074
commit
7791c91960
20 changed files with 385 additions and 4 deletions
20
Foxnouns.Backend/Services/V1/V1Utils.cs
Normal file
20
Foxnouns.Backend/Services/V1/V1Utils.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using Foxnouns.Backend.Database;
|
||||
using Foxnouns.Backend.Database.Models;
|
||||
|
||||
namespace Foxnouns.Backend.Services.V1;
|
||||
|
||||
public static class V1Utils
|
||||
{
|
||||
public static string TranslateStatus(
|
||||
string status,
|
||||
Dictionary<Snowflake, User.CustomPreference> customPreferences
|
||||
)
|
||||
{
|
||||
if (!Snowflake.TryParse(status, out Snowflake? sf))
|
||||
return status;
|
||||
|
||||
return customPreferences.TryGetValue(sf.Value, out User.CustomPreference? cf)
|
||||
? cf.LegacyId.ToString()
|
||||
: "unknown";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue