微信配置表

This commit is contained in:
马梓彭 2026-03-25 22:02:24 +08:00
parent 06d52d56db
commit 474b0a8e3f
3 changed files with 98 additions and 19 deletions

View File

@ -0,0 +1,69 @@
using YD_Event.Core.Enum;
namespace YD_Event.Core.Entities;
/// <summary>
/// 微信支付配置表
/// </summary>
[SugarTable("WeChatPayConfig")]
public class WeChatPayConfig : Entity<long>, ISoftDelete, ICreatedUserId, ICreatedTime, IUpdatedUserId, IUpdatedTime, IAvailability
{
/// <summary>
/// 商户ID(外键)
/// </summary>
public long MerchantId { get; set; }
/// <summary>
/// 微信支付商户号
/// </summary>
[SugarColumn(Length = 32)]
public string MerchantIdValue { get; set; }
/// <summary>
/// 微信支付 APIv3 密钥
/// </summary>
[SugarColumn(Length = 64)]
public string MerchantV3Secret { get; set; }
/// <summary>
/// 微信支付商户证书序列号
/// </summary>
[SugarColumn(Length = 64)]
public string MerchantCertificateSerialNumber { get; set; }
/// <summary>
/// 微信支付商户私钥(PEM格式)
/// </summary>
[SugarColumn(ColumnDataType = "text")]
public string MerchantCertificatePrivateKey { get; set; }
/// <summary>
/// 可用状态
/// </summary>
public AvailabilityStatus Status { get; set; }
/// <summary>
/// 标记删除
/// </summary>
public bool DeleteMark { get; set; }
/// <summary>
/// 创建人
/// </summary>
public long CreatedUserId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public long? UpdatedUserId { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdatedTime { get; set; }
}

View File

@ -0,0 +1,27 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YD_Event.Core.Infrastructure.WeChat.Dto
{
public class WeChatCode2SessionResponse
{
[JsonProperty("openid")]
public string OpenId { get; set; }
[JsonProperty("session_key")]
public string SessionKey { get; set; }
[JsonProperty("unionid")]
public string UnionId { get; set; }
[JsonProperty("errcode")]
public int ErrCode { get; set; }
[JsonProperty("errmsg")]
public string ErrMsg { get; set; }
}
}

View File

@ -9,6 +9,7 @@ using Furion.DependencyInjection;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using Furion.FriendlyException; using Furion.FriendlyException;
using YD_Event.Core.Infrastructure.WeChat.Dto;
namespace YD_Event.Core.Infrastructure.WeChat; namespace YD_Event.Core.Infrastructure.WeChat;
@ -72,22 +73,4 @@ public class WeChatService : ITransient
throw Oops.Bah("微信服务暂不可用,请稍后重试"); throw Oops.Bah("微信服务暂不可用,请稍后重试");
} }
} }
} }
public class WeChatCode2SessionResponse
{
[JsonProperty("openid")]
public string OpenId { get; set; }
[JsonProperty("session_key")]
public string SessionKey { get; set; }
[JsonProperty("unionid")]
public string UnionId { get; set; }
[JsonProperty("errcode")]
public int ErrCode { get; set; }
[JsonProperty("errmsg")]
public string ErrMsg { get; set; }
}