using System.Text.Json.Serialization; namespace MiAssessment.Admin.Business.Models.Config; /// /// 配置更新请求 /// public class ConfigUpdateRequest { /// /// 配置值(JSON对象) /// public object? Value { get; set; } } /// /// 配置响应 /// public class ConfigResponse { /// /// 配置键 /// public string Key { get; set; } = string.Empty; /// /// 配置值 /// public object? Value { get; set; } } /// /// 微信支付配置 /// public class WeixinPaySetting { /// /// 商户列表 /// [JsonPropertyName("merchants")] public List Merchants { get; set; } = new(); } /// /// 微信支付商户配置 /// public class WeixinPayMerchant { /// /// 商户名称 /// [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// /// 商户号 /// [JsonPropertyName("mch_id")] public string MchId { get; set; } = string.Empty; /// /// 订单前缀(必须3位) /// [JsonPropertyName("order_prefix")] public string OrderPrefix { get; set; } = string.Empty; /// /// API密钥(V2版本使用) /// [JsonPropertyName("api_key")] public string? ApiKey { get; set; } /// /// 证书路径 /// [JsonPropertyName("cert_path")] public string? CertPath { get; set; } /// /// 是否启用 /// [JsonPropertyName("is_enabled")] public string? IsEnabled { get; set; } // ===== V3 新增字段 ===== /// /// 支付版本: "V2" 或 "V3",默认 "V2" /// [JsonPropertyName("pay_version")] public string PayVersion { get; set; } = "V2"; /// /// APIv3 密钥(32位字符串,V3版本使用) /// [JsonPropertyName("api_v3_key")] public string? ApiV3Key { get; set; } /// /// 商户API证书序列号(V3版本使用) /// [JsonPropertyName("cert_serial_no")] public string? CertSerialNo { get; set; } /// /// 商户私钥文件路径(V3版本使用) /// [JsonPropertyName("private_key_path")] public string? PrivateKeyPath { get; set; } /// /// 商户私钥PEM内容(V3版本使用,优先级高于路径) /// [JsonPropertyName("private_key_content")] public string? PrivateKeyContent { get; set; } /// /// 微信支付公钥ID(V3版本使用) /// [JsonPropertyName("wechat_public_key_id")] public string? WechatPublicKeyId { get; set; } /// /// 微信支付公钥文件路径(V3版本使用) /// [JsonPropertyName("wechat_public_key_path")] public string? WechatPublicKeyPath { get; set; } /// /// 微信支付公钥PEM内容(V3版本使用,优先级高于路径) /// [JsonPropertyName("wechat_public_key_content")] public string? WechatPublicKeyContent { get; set; } } /// /// 小程序配置 /// public class MiniprogramSetting { /// /// 小程序列表 /// [JsonPropertyName("miniprograms")] public List Miniprograms { get; set; } = new(); } /// /// 小程序配置项 /// public class MiniprogramConfig { /// /// 小程序名称 /// [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// /// AppId /// [JsonPropertyName("appid")] public string AppId { get; set; } = string.Empty; /// /// AppSecret /// [JsonPropertyName("appsecret")] public string? AppSecret { get; set; } /// /// 订单前缀(必须2位) /// [JsonPropertyName("order_prefix")] public string? OrderPrefix { get; set; } /// /// 是否默认 /// [JsonPropertyName("is_default")] public int IsDefault { get; set; } /// /// 关联商户列表 /// [JsonPropertyName("merchants")] public List? Merchants { get; set; } } /// /// H5配置 /// public class H5Setting { /// /// H5应用列表 /// [JsonPropertyName("h5apps")] public List H5Apps { get; set; } = new(); } /// /// H5应用配置项 /// public class H5AppConfig { /// /// 应用名称 /// [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// /// 订单前缀(必须2位) /// [JsonPropertyName("order_prefix")] public string? OrderPrefix { get; set; } /// /// 是否默认 /// [JsonPropertyName("is_default")] public int IsDefault { get; set; } /// /// 微信商户索引 /// [JsonPropertyName("wx_merchant_index")] public int? WxMerchantIndex { get; set; } /// /// 支付宝商户索引 /// [JsonPropertyName("ali_merchant_index")] public int? AliMerchantIndex { get; set; } } /// /// 支持的配置键 /// public static class ConfigKeys { public const string Base = "base"; public const string WeixinPaySetting = "weixinpay_setting"; public const string AlipayPaySetting = "alipay_setting"; public const string MiniprogramSetting = "miniprogram_setting"; public const string H5Setting = "h5_setting"; public const string Uploads = "uploads"; public const string SystemConfig = "systemconfig"; public const string Sign = "sign"; public const string AppSetting = "app_setting"; public const string UserConfig = "user_config"; public const string InfiniteMultiple = "infinite_multiple"; public const string RankSetting = "rank_setting"; public const string SystemTest = "system_test"; public const string TencentSmsConfig = "tencent_sms_config"; /// /// 所有支持的配置键 /// public static readonly string[] AllKeys = new[] { Base, WeixinPaySetting, AlipayPaySetting, MiniprogramSetting, H5Setting, Uploads, SystemConfig, Sign, AppSetting, UserConfig, InfiniteMultiple, RankSetting, SystemTest, TencentSmsConfig }; /// /// 检查配置键是否有效 /// public static bool IsValidKey(string key) => AllKeys.Contains(key); } #region 支付宝配置模型 /// /// 支付宝配置 /// public class AlipaySetting { /// /// 商户列表 /// [JsonPropertyName("merchants")] public List Merchants { get; set; } = new(); } /// /// 支付宝商户配置 /// public class AlipayMerchant { /// /// 商户名称 /// [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// /// 应用ID /// [JsonPropertyName("appId")] public string AppId { get; set; } = string.Empty; /// /// 应用私钥 /// [JsonPropertyName("privateKey")] public string? PrivateKey { get; set; } /// /// 支付宝公钥 /// [JsonPropertyName("publicKey")] public string? PublicKey { get; set; } /// /// 权重 /// [JsonPropertyName("weight")] public int Weight { get; set; } = 1; /// /// 是否启用 0禁用 1启用 /// [JsonPropertyName("is_enabled")] public int IsEnabled { get; set; } = 1; /// /// 备注 /// [JsonPropertyName("remark")] public string? Remark { get; set; } } #endregion #region 基础设置模型 /// /// 基础设置 /// public class BaseSetting { /// /// 网站名称 /// [JsonPropertyName("title")] public string? Title { get; set; } /// /// 物流code /// [JsonPropertyName("logistics_code")] public string? LogisticsCode { get; set; } /// /// 连击赏最大抽取次数 /// [JsonPropertyName("lianji_max_num")] public string? LianjiMaxNum { get; set; } /// /// 分销奖励比例 /// [JsonPropertyName("fx_bili")] public string? FxBili { get; set; } /// /// 赏券每人每天最多领取次数 /// [JsonPropertyName("coupon_ling_max_ci")] public string? CouponLingMaxCi { get; set; } /// /// 特级赏券限制参与人数 /// [JsonPropertyName("coupon_a_xz_max")] public string? CouponAXzMax { get; set; } /// /// 终极赏券限制参与人数 /// [JsonPropertyName("coupon_b_xz_max")] public string? CouponBXzMax { get; set; } /// /// 高级赏券限制参与人数 /// [JsonPropertyName("coupon_c_xz_max")] public string? CouponCXzMax { get; set; } /// /// 普通赏券限制参与人数 /// [JsonPropertyName("coupon_d_xz_max")] public string? CouponDXzMax { get; set; } /// /// 背包满多少包邮 /// [JsonPropertyName("free_post")] public string? FreePost { get; set; } /// /// 背包发货运费 /// [JsonPropertyName("post_money")] public string? PostMoney { get; set; } /// /// 一番赏三发+时间(秒) /// [JsonPropertyName("three_time")] public string? ThreeTime { get; set; } /// /// 一番赏五发+时间(秒) /// [JsonPropertyName("five_time")] public string? FiveTime { get; set; } /// /// 福利进群二维码 /// [JsonPropertyName("erweima")] public string? Erweima { get; set; } /// /// 分享标题 /// [JsonPropertyName("share_title")] public string? ShareTitle { get; set; } /// /// 分享图片 /// [JsonPropertyName("share_image")] public string? ShareImage { get; set; } /// /// 抽奖券拉人上限 /// [JsonPropertyName("draw_people_num")] public string? DrawPeopleNum { get; set; } /// /// 首页是否弹窗 0关闭 1开启 /// [JsonPropertyName("is_shou_tan")] public string? IsShouTan { get; set; } /// /// 兑换开关 0关闭 1开启 /// [JsonPropertyName("is_exchange")] public string? IsExchange { get; set; } } #endregion #region 签到配置模型 /// /// 签到配置 /// public class SignSetting { /// /// 第一天奖励 /// [JsonPropertyName("one_num")] public string? OneNum { get; set; } /// /// 第二天奖励 /// [JsonPropertyName("two_num")] public string? TwoNum { get; set; } /// /// 第三天奖励 /// [JsonPropertyName("three_num")] public string? ThreeNum { get; set; } /// /// 第四天奖励 /// [JsonPropertyName("four_num")] public string? FourNum { get; set; } /// /// 第五天奖励 /// [JsonPropertyName("five_num")] public string? FiveNum { get; set; } /// /// 第六天奖励 /// [JsonPropertyName("six_num")] public string? SixNum { get; set; } /// /// 第七天奖励 /// [JsonPropertyName("seven_num")] public string? SevenNum { get; set; } } #endregion #region 应用设置模型 /// /// 应用设置 /// public class AppSetting { /// /// 项目名称 /// [JsonPropertyName("app_name")] public string? AppName { get; set; } /// /// 购买弹窗 1弹出一次 2每天显示 /// [JsonPropertyName("purchase_popup")] public string? PurchasePopup { get; set; } /// /// 商城购买次数 /// [JsonPropertyName("exchange_times")] public string? ExchangeTimes { get; set; } /// /// 余额名称 /// [JsonPropertyName("balance_name")] public string? BalanceName { get; set; } /// /// 余额图标 /// [JsonPropertyName("balance_icon")] public string? BalanceIcon { get; set; } /// /// 货币1名称 /// [JsonPropertyName("currency1_name")] public string? Currency1Name { get; set; } /// /// 货币1图标 /// [JsonPropertyName("currency1_icon")] public string? Currency1Icon { get; set; } /// /// 货币2名称 /// [JsonPropertyName("currency2_name")] public string? Currency2Name { get; set; } /// /// 货币2图标 /// [JsonPropertyName("currency2_icon")] public string? Currency2Icon { get; set; } /// /// 中奖音频 /// [JsonPropertyName("win_audio")] public string? WinAudio { get; set; } /// /// 小程序版本号 /// [JsonPropertyName("version")] public string? Version { get; set; } /// /// 签到消费门槛 /// [JsonPropertyName("sign_threshold")] public string? SignThreshold { get; set; } /// /// 显示兑换达达券按钮门槛 /// [JsonPropertyName("exchange_show_threshold")] public string? ExchangeShowThreshold { get; set; } /// /// 外卖盒子ID /// [JsonPropertyName("takeout_box_id")] public string? TakeoutBoxId { get; set; } /// /// 每日免费抽奖ID /// [JsonPropertyName("daily_free_draw_id")] public string? DailyFreeDrawId { get; set; } /// /// 盒柜兑换次数限制 /// [JsonPropertyName("box_exchange_limit")] public string? BoxExchangeLimit { get; set; } /// /// 每天优惠券次数 /// [JsonPropertyName("daily_coupon_limit")] public string? DailyCouponLimit { get; set; } } #endregion #region 用户UID配置模型 /// /// 用户UID配置 /// public class UserConfigSetting { /// /// UID类型 1真实ID 2数字ID 3随机字符和数字 /// [JsonPropertyName("uid_type")] public string? UidType { get; set; } /// /// UID长度 /// [JsonPropertyName("uid_length")] public string? UidLength { get; set; } /// /// 默认昵称前缀,如"用户",注册时自动拼接随机数字 /// [JsonPropertyName("default_nickname_prefix")] public string? DefaultNicknamePrefix { get; set; } /// /// 默认头像URL,为空时使用系统生成的头像 /// [JsonPropertyName("default_avatar")] public string? DefaultAvatar { get; set; } } #endregion #region 内测配置模型 /// /// 内测配置 /// public class SystemTestSetting { /// /// 是否开启内测 0关闭 1开启 /// [JsonPropertyName("enable_test")] public string? EnableTest { get; set; } /// /// 是否禁用微信支付 0启用 1禁用 /// [JsonPropertyName("disable_wechat_pay")] public string? DisableWechatPay { get; set; } /// /// 签到倍数 /// [JsonPropertyName("sign_multiple")] public string? SignMultiple { get; set; } } #endregion #region 无限赏抽奖倍数模型 /// /// 无限赏抽奖倍数配置 /// public class InfiniteMultipleSetting { /// /// 抽奖倍数 1000/10000/100000 /// [JsonPropertyName("multiple")] public string? Multiple { get; set; } } #endregion #region 排行榜设置模型 /// /// 排行榜设置 /// public class RankSettingSetting { /// /// 达达券排行榜统计方式 daily/weekly/monthly/yearly/custom /// [JsonPropertyName("dadajuan_stat_type")] public string? DadajuanStatType { get; set; } /// /// 达达券自定义开始时间 /// [JsonPropertyName("dadajuan_start_time")] public string? DadajuanStartTime { get; set; } /// /// 达达券自定义结束时间 /// [JsonPropertyName("dadajuan_end_time")] public string? DadajuanEndTime { get; set; } /// /// 钻石排行榜统计方式 /// [JsonPropertyName("diamond_stat_type")] public string? DiamondStatType { get; set; } /// /// 钻石自定义开始时间 /// [JsonPropertyName("diamond_start_time")] public string? DiamondStartTime { get; set; } /// /// 钻石自定义结束时间 /// [JsonPropertyName("diamond_end_time")] public string? DiamondEndTime { get; set; } /// /// UU币排行榜统计方式 /// [JsonPropertyName("integral_stat_type")] public string? IntegralStatType { get; set; } /// /// UU币自定义开始时间 /// [JsonPropertyName("integral_start_time")] public string? IntegralStartTime { get; set; } /// /// UU币自定义结束时间 /// [JsonPropertyName("integral_end_time")] public string? IntegralEndTime { get; set; } /// /// 邀请排行榜统计方式 /// [JsonPropertyName("invite_stat_type")] public string? InviteStatType { get; set; } /// /// 邀请自定义开始时间 /// [JsonPropertyName("invite_start_time")] public string? InviteStartTime { get; set; } /// /// 邀请自定义结束时间 /// [JsonPropertyName("invite_end_time")] public string? InviteEndTime { get; set; } } #endregion #region 上传配置模型 /// /// 上传配置 /// public class UploadSetting { /// /// 存储类型 1本地 2阿里云 3腾讯云 /// [JsonPropertyName("type")] public string? Type { get; set; } /// /// 腾讯云AppId /// [JsonPropertyName("AppId")] public string? AppId { get; set; } /// /// 空间名称/Bucket /// [JsonPropertyName("Bucket")] public string? Bucket { get; set; } /// /// 地域 /// [JsonPropertyName("Region")] public string? Region { get; set; } /// /// AccessKeyId /// [JsonPropertyName("AccessKeyId")] public string? AccessKeyId { get; set; } /// /// AccessKeySecret /// [JsonPropertyName("AccessKeySecret")] public string? AccessKeySecret { get; set; } /// /// 请求域名 /// [JsonPropertyName("Domain")] public string? Domain { get; set; } } #endregion