Reading API types: narrow IWordCountService, seal records, separate API DTOs

Offen
#1,611 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
api

Rechercherichtung

Start by reading the definitions of IWordCountService, ChapterWordCount, ReadingContextViewModel, ReadingProfileSummary, ChapterStatsResponse, BookStatsResponse, and RecordSessionResult, then check their usages and serialization tests. Narrow the service interface, seal the records, separate API DTOs, remove the duplicate response type, split the file’s types, and constrain RecordSessionResult so invalid states cannot be represented. Done when usages and tests reflect these changes without changing the public API contract unintentionally.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

IWordCountService is wide (GetPageWordCount is just GetPageStats(...)?.PageWords ?? 0). ChapterWordCount/ReadingContextViewModel are unsealed records. ReadingProfileSummary is serialized as the public API contract, ChapterStatsResponse duplicates ChapterWordCount, and BookStatsResponse.cs holds two types. RecordSessionResult can represent both-null/both-set states.

Found during review of #1267; intentionally kept out of that PR.

Vorherrschende Sprache
HTML
Sterne
8
Forks
8
Ø Merge
3 Std. 24 Min.
Gemergte PRs (30 T.)
91

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus IntelliTect/EssentialCSharp.Web

Alle Issues in IntelliTect/EssentialCSharp.Web

Ähnliche Issues

Weitere Issues zu Backend & API Design

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.