mirror of
https://gitea.tendokyu.moe/Kayori/MedusaPluginChargeMachine.git
synced 2026-10-02 03:57:56 +03:00
- chargeoptions is the real field gating 2000/5000/10000 yen display - chargeid (not chargenum) carries the actual denomination on charge - getrecentcharge/getlastlog: fixed num mismatch, added missing result section, and added placeholder items for empty result sets
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using Abstractions.Handlers;
|
|
using Abstractions.SerializationTypes;
|
|
using MedusaPluginChargeMachine.Models.Request;
|
|
using MedusaPluginChargeMachine.Models.Response;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace MedusaPluginChargeMachine.Handlers.LA9;
|
|
|
|
public class GetConfigEaChargeHandler(ChargeMachineDbContext db) : HandlerWithoutRequest<EaChargeConfigResponse>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Module("eacharge");
|
|
Method("getconf");
|
|
}
|
|
|
|
public override async Task<EaChargeConfigResponse> HandleAsync(GameModel model)
|
|
{
|
|
var articles = await db.ArticleContents.ToListAsync();
|
|
|
|
var articleList = articles
|
|
.Select(a => new EaChargeConfigChargeArticleItem
|
|
{
|
|
ArticleType = new XrpcString(a.ArticleType.ToString()),
|
|
ArticleDoc = new XrpcString(
|
|
a.ArticleType.ToString().StartsWith("DOCMT_") ? "" : a.ArticleDoc)
|
|
})
|
|
.ToList();
|
|
|
|
return new EaChargeConfigResponse
|
|
{
|
|
Status = 0,
|
|
Expire = 1200,
|
|
ChargeOptions = new XrpcString("multibills"),
|
|
ChargeArticle = new EaChargeConfigChargeArticle
|
|
{
|
|
ArticleRevision = new XrpcString("1"),
|
|
ArticleList = articleList
|
|
},
|
|
ChargeDetail = new EaChargeConfigChargeDetail
|
|
{
|
|
ChargeDaily = new XrpcInt(0),
|
|
ChargeDailyLimit = new XrpcInt(100000)
|
|
},
|
|
ChargeStatus = new EaChargeConfigChargeStatus
|
|
{
|
|
CurrentCode = new XrpcInt(0),
|
|
LastChargeStatus = new XrpcInt(1)
|
|
}
|
|
};
|
|
}
|
|
}
|