mirror of
https://gitea.tendokyu.moe/Kayori/MedusaPluginChargeMachine.git
synced 2026-09-29 10:37:58 +03:00
Introduce ChargeMachineDbContext (SQLite) with ArticleContent and ChargeHistory entities, plus migrations, and wire it up via ConfigurePluginServices/OnAppInitialize with startup migration and article-content seeding. - ChargeEaChargeHandler now records each charge to ChargeHistory - GetConfigEaChargeHandler serves article config from the DB instead of hardcoded values, and adds multibills/readagreement fields - GetLastLogEaChargeHandler returns real daily totals and recent charge items from history, keyed by session card - Add GetRecentChargeEaChargeHandler (paginated charge history) and OpChPassEaChargeHandler (PIN change) - Update handlers to the new HandleAsync/primary-constructor style, file-scoped namespaces - Bump EF Core/Identity packages and Abstractions reference to net10.0/10.0.10
67 lines
1.8 KiB
C#
67 lines
1.8 KiB
C#
using System.Xml.Serialization;
|
|
using Abstractions.SerializationTypes;
|
|
|
|
namespace MedusaPluginChargeMachine.Models.Response;
|
|
|
|
[XmlRoot("eacharge")]
|
|
[Serializable]
|
|
public class EaChargeConfigResponse
|
|
{
|
|
[XmlAttribute("status")]
|
|
public required int Status { get; set; }
|
|
|
|
[XmlAttribute("expire")]
|
|
public required int Expire { get; set; }
|
|
|
|
[XmlElement("multibills")]
|
|
public XrpcInt MultiBills { get; set; }
|
|
|
|
[XmlElement("readagreement")]
|
|
public XrpcInt ReadAgreement { get; set; }
|
|
|
|
[XmlElement("chargearticle")]
|
|
public required EaChargeConfigChargeArticle ChargeArticle { get; set; }
|
|
|
|
[XmlElement("chargedetail")]
|
|
public required EaChargeConfigChargeDetail ChargeDetail { get; set; }
|
|
|
|
[XmlElement("chargestatus")]
|
|
public required EaChargeConfigChargeStatus ChargeStatus { get; set; }
|
|
}
|
|
|
|
public record EaChargeConfigChargeArticle
|
|
{
|
|
[XmlElement("articlerevision")]
|
|
public required XrpcString ArticleRevision { get; set; }
|
|
|
|
[XmlElement("articlelist")]
|
|
public required List<EaChargeConfigChargeArticleItem> ArticleList { get; set; }
|
|
}
|
|
|
|
public record EaChargeConfigChargeArticleItem
|
|
{
|
|
[XmlElement("articletype")]
|
|
public required XrpcString ArticleType { get; set; }
|
|
|
|
[XmlElement("articledoc")]
|
|
public required XrpcString ArticleDoc { get; set; }
|
|
}
|
|
|
|
public record EaChargeConfigChargeDetail
|
|
{
|
|
[XmlElement("chargedaily")]
|
|
public required XrpcInt ChargeDaily { get; set; }
|
|
|
|
[XmlElement("chargedailylimit")]
|
|
public required XrpcInt ChargeDailyLimit { get; set; }
|
|
}
|
|
|
|
public record EaChargeConfigChargeStatus
|
|
{
|
|
[XmlElement("currentcode")]
|
|
public required XrpcInt CurrentCode { get; set; }
|
|
|
|
[XmlElement("lastchargestatus")]
|
|
public required XrpcInt LastChargeStatus { get; set; }
|
|
}
|