refactor: datamodels and service name

This commit is contained in:
estrogen elf
2025-06-22 19:10:36 -05:00
parent 73787608c4
commit c78f75a332
7 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace Needlework.Net.Models namespace Needlework.Net.DataModels
{ {
public class GithubRelease public class GithubRelease
{ {

View File

@@ -1,4 +1,4 @@
namespace Needlework.Net.Models namespace Needlework.Net.DataModels
{ {
public class HextechDocsPost public class HextechDocsPost
{ {

View File

@@ -111,7 +111,7 @@ class Program
builder.AddSingleton<DocumentService>(); builder.AddSingleton<DocumentService>();
builder.AddSingleton<NotificationService>(); builder.AddSingleton<NotificationService>();
builder.AddSingleton<SchemaPaneService>(); builder.AddSingleton<SchemaPaneService>();
builder.AddSingleton<HextechDocsPostService>(); builder.AddSingleton<HextechDocsService>();
builder.AddSingleton<GithubService>(); builder.AddSingleton<GithubService>();
builder.AddSingleton<IBlobCache>((_) => builder.AddSingleton<IBlobCache>((_) =>
{ {

View File

@@ -2,8 +2,8 @@
using Flurl.Http; using Flurl.Http;
using Flurl.Http.Configuration; using Flurl.Http.Configuration;
using Needlework.Net.Constants; using Needlework.Net.Constants;
using Needlework.Net.DataModels;
using Needlework.Net.Extensions; using Needlework.Net.Extensions;
using Needlework.Net.Models;
using System; using System;
using System.Reactive.Linq; using System.Reactive.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -1,7 +1,7 @@
using Akavache; using Akavache;
using AngleSharp; using AngleSharp;
using Needlework.Net.DataModels;
using Needlework.Net.Extensions; using Needlework.Net.Extensions;
using Needlework.Net.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reactive.Linq; using System.Reactive.Linq;
@@ -9,13 +9,13 @@ using System.Threading.Tasks;
namespace Needlework.Net.Services namespace Needlework.Net.Services
{ {
public class HextechDocsPostService : IEnableLogger public class HextechDocsService : IEnableLogger
{ {
private readonly IBrowsingContext _context = BrowsingContext.New(Configuration.Default.WithDefaultLoader()); private readonly IBrowsingContext _context = BrowsingContext.New(Configuration.Default.WithDefaultLoader());
private readonly IBlobCache _blobCache; private readonly IBlobCache _blobCache;
public HextechDocsPostService(IBlobCache blobCache) public HextechDocsService(IBlobCache blobCache)
{ {
_blobCache = blobCache; _blobCache = blobCache;
} }

View File

@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using Needlework.Net.Models; using Needlework.Net.DataModels;
namespace Needlework.Net.ViewModels.Pages.Home namespace Needlework.Net.ViewModels.Pages.Home
{ {

View File

@@ -17,13 +17,13 @@ namespace Needlework.Net.ViewModels.Pages.Home;
public partial class HomeViewModel : PageBase, IEnableLogger public partial class HomeViewModel : PageBase, IEnableLogger
{ {
private readonly HextechDocsPostService _hextechDocsPostService; private readonly HextechDocsService _hextechDocsService;
private readonly IDisposable _carouselNextDisposable; private readonly IDisposable _carouselNextDisposable;
public HomeViewModel(HextechDocsPostService hextechDocsPostService) : base("Home", "fa-solid fa-house", int.MinValue) public HomeViewModel(HextechDocsService hextechDocsService) : base("Home", "fa-solid fa-house", int.MinValue)
{ {
_hextechDocsPostService = hextechDocsPostService; _hextechDocsService = hextechDocsService;
_carouselNextDisposable = Observable.Timer(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5)) _carouselNextDisposable = Observable.Timer(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5))
.Select(time => Unit.Default) .Select(time => Unit.Default)
@@ -63,7 +63,7 @@ public partial class HomeViewModel : PageBase, IEnableLogger
{ {
try try
{ {
var posts = await _hextechDocsPostService.GetPostsAsync(); var posts = await _hextechDocsService.GetPostsAsync();
var hextechDocsPosts = posts.Select(post => new HextechDocsPostViewModel(post)).ToList(); var hextechDocsPosts = posts.Select(post => new HextechDocsPostViewModel(post)).ToList();
Dispatcher.UIThread.Invoke(() => Dispatcher.UIThread.Invoke(() =>
{ {