Workshop - Update workshop IDs to be long

This commit is contained in:
Robert committed 2023-09-09 13:30:26 +02:00
1 parent a798980eec
commit 0fdb40bd35
33 files changed
+102 -103

No files matched your search

@@ -1,10 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace Artemis.Web.Workshop.Entities;
namespace Artemis.WebClient.Workshop.Entities;
public class Release
{
public Guid Id { get; set; }
public long Id { get; set; }
[MaxLength(64)]
public string Version { get; set; } = string.Empty;
@@ -18,5 +18,5 @@ public class Release
[MaxLength(32)]
public string? Md5Hash { get; set; }
public Guid EntryId { get; set; }
public long EntryId { get; set; }
}
@@ -5,6 +5,6 @@ namespace Artemis.WebClient.Workshop.Handlers.InstallationHandlers;
public interface IEntryInstallationHandler
{
Task<EntryInstallResult> InstallAsync(IGetEntryById_Entry entry, Guid releaseId, Progress<StreamProgress> progress, CancellationToken cancellationToken);
Task<EntryInstallResult> InstallAsync(IGetEntryById_Entry entry, long releaseId, Progress<StreamProgress> progress, CancellationToken cancellationToken);
Task<EntryUninstallResult> UninstallAsync(InstalledEntry installedEntry, CancellationToken cancellationToken);
}
@@ -19,7 +19,7 @@ public class ProfileEntryInstallationHandler : IEntryInstallationHandler
_workshopService = workshopService;
}
public async Task<EntryInstallResult> InstallAsync(IGetEntryById_Entry entry, Guid releaseId, Progress<StreamProgress> progress, CancellationToken cancellationToken)
public async Task<EntryInstallResult> InstallAsync(IGetEntryById_Entry entry, long releaseId, Progress<StreamProgress> progress, CancellationToken cancellationToken)
{
using MemoryStream stream = new();
@@ -89,7 +89,7 @@ public class ProfileEntryInstallationHandler : IEntryInstallationHandler
}, cancellationToken);
}
private void UpdateRelease(Guid releaseId, InstalledEntry installedEntry)
private void UpdateRelease(long releaseId, InstalledEntry installedEntry)
{
installedEntry.ReleaseId = releaseId;
installedEntry.ReleaseVersion = "TODO";
@@ -1,4 +1,4 @@
using Artemis.Web.Workshop.Entities;
using Artemis.WebClient.Workshop.Entities;
namespace Artemis.WebClient.Workshop.Handlers.UploadHandlers;
@@ -4,5 +4,5 @@ namespace Artemis.WebClient.Workshop.Handlers.UploadHandlers;
public interface IEntryUploadHandler
{
Task<EntryUploadResult> CreateReleaseAsync(Guid entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken);
Task<EntryUploadResult> CreateReleaseAsync(long entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken);
}
@@ -5,7 +5,7 @@ namespace Artemis.WebClient.Workshop.Handlers.UploadHandlers.Implementations;
public class LayoutEntryUploadHandler : IEntryUploadHandler
{
/// <inheritdoc />
public async Task<EntryUploadResult> CreateReleaseAsync(Guid entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken)
public async Task<EntryUploadResult> CreateReleaseAsync(long entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
@@ -2,7 +2,7 @@
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Shared.Utilities;
using Artemis.Web.Workshop.Entities;
using Artemis.WebClient.Workshop.Entities;
using Newtonsoft.Json;
namespace Artemis.WebClient.Workshop.Handlers.UploadHandlers.Implementations;
@@ -19,7 +19,7 @@ public class ProfileEntryUploadHandler : IEntryUploadHandler
}
/// <inheritdoc />
public async Task<EntryUploadResult> CreateReleaseAsync(Guid entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken)
public async Task<EntryUploadResult> CreateReleaseAsync(long entryId, object file, Progress<StreamProgress> progress, CancellationToken cancellationToken)
{
if (file is not ProfileConfiguration profileConfiguration)
throw new InvalidOperationException("Can only create releases for profile configurations");
@@ -1,4 +1,4 @@
query GetEntryById($id: UUID!) {
query GetEntryById($id: Long!) {
entry(id: $id) {
id
author
@@ -1,4 +1,4 @@
query GetSubmittedEntryById($id: UUID!) {
query GetSubmittedEntryById($id: Long!) {
entry(id: $id) {
id
name
@@ -1,4 +1,4 @@
mutation RemoveEntry ($id: UUID!) {
mutation RemoveEntry ($id: Long!) {
removeEntry(id: $id) {
id
}
@@ -22,13 +22,13 @@ public class InstalledEntry
Name = entry.Name;
}
public Guid EntryId { get; set; }
public long EntryId { get; set; }
public EntryType EntryType { get; set; }
public string Author { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public Guid ReleaseId { get; set; }
public long ReleaseId { get; set; }
public string ReleaseVersion { get; set; } = string.Empty;
public DateTimeOffset InstalledAt { get; set; }
@@ -5,11 +5,11 @@ namespace Artemis.WebClient.Workshop.Services;
public interface IWorkshopService
{
Task<Stream?> GetEntryIcon(Guid entryId, CancellationToken cancellationToken);
Task<ImageUploadResult> SetEntryIcon(Guid entryId, Progress<StreamProgress> progress, Stream icon, CancellationToken cancellationToken);
Task<Stream?> GetEntryIcon(long entryId, CancellationToken cancellationToken);
Task<ImageUploadResult> SetEntryIcon(long entryId, Progress<StreamProgress> progress, Stream icon, CancellationToken cancellationToken);
Task<WorkshopStatus> GetWorkshopStatus(CancellationToken cancellationToken);
Task<bool> ValidateWorkshopStatus(CancellationToken cancellationToken);
Task NavigateToEntry(Guid entryId, EntryType entryType);
Task NavigateToEntry(long entryId, EntryType entryType);
List<InstalledEntry> GetInstalledEntries();
InstalledEntry? GetInstalledEntry(IGetEntryById_Entry entry);
@@ -20,7 +20,7 @@ public class WorkshopService : IWorkshopService
_entryRepository = entryRepository;
}
public async Task<Stream?> GetEntryIcon(Guid entryId, CancellationToken cancellationToken)
public async Task<Stream?> GetEntryIcon(long entryId, CancellationToken cancellationToken)
{
HttpClient client = _httpClientFactory.CreateClient(WorkshopConstants.WORKSHOP_CLIENT_NAME);
try
@@ -36,7 +36,7 @@ public class WorkshopService : IWorkshopService
}
}
public async Task<ImageUploadResult> SetEntryIcon(Guid entryId, Progress<StreamProgress> progress, Stream icon, CancellationToken cancellationToken)
public async Task<ImageUploadResult> SetEntryIcon(long entryId, Progress<StreamProgress> progress, Stream icon, CancellationToken cancellationToken)
{
icon.Seek(0, SeekOrigin.Begin);
@@ -85,7 +85,7 @@ public class WorkshopService : IWorkshopService
return status.IsReachable;
}
public async Task NavigateToEntry(Guid entryId, EntryType entryType)
public async Task NavigateToEntry(long entryId, EntryType entryType)
{
switch (entryType)
{
@@ -2,7 +2,7 @@ namespace Artemis.WebClient.Workshop;
public static class WorkshopConstants
{
public const string AUTHORITY_URL = "https://identity.artemis-rgb.com";
public const string WORKSHOP_URL = "https://workshop.artemis-rgb.com";
public const string AUTHORITY_URL = "https://localhost:5001";
public const string WORKSHOP_URL = "https://localhost:7281";
public const string WORKSHOP_CLIENT_NAME = "WorkshopApiClient";
}
+17 -32
View File
@@ -7,7 +7,7 @@ schema {
type Category {
icon: String!
id: Int!
id: Long!
name: String!
}
@@ -38,10 +38,10 @@ type Entry {
entryType: EntryType!
icon: Image
iconId: UUID
id: UUID!
id: Long!
images: [Image!]!
latestRelease: Release
latestReleaseId: UUID
latestReleaseId: Long
name: String!
releases: [Release!]!
summary: String!
@@ -55,14 +55,14 @@ type Image {
type Mutation {
addEntry(input: CreateEntryInput!): Entry
removeEntry(id: UUID!): Entry
removeEntry(id: Long!): Entry
updateEntry(input: UpdateEntryInput!): Entry
}
type Query {
categories(order: [CategorySortInput!], where: CategoryFilterInput): [Category!]!
entries(order: [EntrySortInput!], skip: Int, take: Int, where: EntryFilterInput): EntriesCollectionSegment
entry(id: UUID!): Entry
entry(id: Long!): Entry
searchEntries(input: String!, order: [EntrySortInput!], type: EntryType, where: EntryFilterInput): [Entry!]!
submittedEntries(order: [EntrySortInput!], where: EntryFilterInput): [Entry!]!
}
@@ -72,14 +72,14 @@ type Release {
downloadSize: Long!
downloads: Long!
entry: Entry!
entryId: UUID!
id: UUID!
entryId: Long!
id: Long!
md5Hash: String
version: String!
}
type Tag {
id: Int!
id: Long!
name: String!
}
@@ -111,7 +111,7 @@ scalar UUID
input CategoryFilterInput {
and: [CategoryFilterInput!]
icon: StringOperationFilterInput
id: IntOperationFilterInput
id: LongOperationFilterInput
name: StringOperationFilterInput
or: [CategoryFilterInput!]
}
@@ -123,7 +123,7 @@ input CategorySortInput {
}
input CreateEntryInput {
categories: [Int!]!
categories: [Long!]!
description: String!
entryType: EntryType!
name: String!
@@ -157,10 +157,10 @@ input EntryFilterInput {
entryType: EntryTypeOperationFilterInput
icon: ImageFilterInput
iconId: UuidOperationFilterInput
id: UuidOperationFilterInput
id: LongOperationFilterInput
images: ListFilterInputTypeOfImageFilterInput
latestRelease: ReleaseFilterInput
latestReleaseId: UuidOperationFilterInput
latestReleaseId: LongOperationFilterInput
name: StringOperationFilterInput
or: [EntryFilterInput!]
releases: ListFilterInputTypeOfReleaseFilterInput
@@ -203,21 +203,6 @@ input ImageSortInput {
mimeType: SortEnumType
}
input IntOperationFilterInput {
eq: Int
gt: Int
gte: Int
in: [Int]
lt: Int
lte: Int
neq: Int
ngt: Int
ngte: Int
nin: [Int]
nlt: Int
nlte: Int
}
input ListFilterInputTypeOfCategoryFilterInput {
all: CategoryFilterInput
any: Boolean
@@ -267,8 +252,8 @@ input ReleaseFilterInput {
downloadSize: LongOperationFilterInput
downloads: LongOperationFilterInput
entry: EntryFilterInput
entryId: UuidOperationFilterInput
id: UuidOperationFilterInput
entryId: LongOperationFilterInput
id: LongOperationFilterInput
md5Hash: StringOperationFilterInput
or: [ReleaseFilterInput!]
version: StringOperationFilterInput
@@ -302,15 +287,15 @@ input StringOperationFilterInput {
input TagFilterInput {
and: [TagFilterInput!]
id: IntOperationFilterInput
id: LongOperationFilterInput
name: StringOperationFilterInput
or: [TagFilterInput!]
}
input UpdateEntryInput {
categories: [Int!]!
categories: [Long!]!
description: String!
id: UUID!
id: Long!
name: String!
summary: String!
tags: [String!]!