分离实体类
This commit is contained in:
parent
aac215643c
commit
66faab9009
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER app
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ ARG BUILD_CONFIGURATION=Release
|
|||
WORKDIR /src
|
||||
COPY ["Api/CloudGaming.Api/CloudGaming.Api.csproj", "Api/CloudGaming.Api/"]
|
||||
COPY ["Code/CloudGaming.Code/CloudGaming.Code.csproj", "Code/CloudGaming.Code/"]
|
||||
COPY ["Model/CloudGaming.AppConfigModel/CloudGaming.AppConfigModel.csproj", "Model/CloudGaming.AppConfigModel/"]
|
||||
COPY ["Model/CloudGaming.DtoModel/CloudGaming.DtoModel.csproj", "Model/CloudGaming.DtoModel/"]
|
||||
COPY ["Model/CloudGaming.GameModel/CloudGaming.GameModel.csproj", "Model/CloudGaming.GameModel/"]
|
||||
COPY ["Utile/HuanMeng.DotNetCore/HuanMeng.DotNetCore.csproj", "Utile/HuanMeng.DotNetCore/"]
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ ARG BUILD_CONFIGURATION=Release
|
|||
WORKDIR /src
|
||||
COPY ["Api/CloudGaming.PayApi/CloudGaming.PayApi.csproj", "Api/CloudGaming.PayApi/"]
|
||||
COPY ["Code/CloudGaming.Code/CloudGaming.Code.csproj", "Code/CloudGaming.Code/"]
|
||||
COPY ["Model/CloudGaming.AppConfigModel/CloudGaming.AppConfigModel.csproj", "Model/CloudGaming.AppConfigModel/"]
|
||||
COPY ["Model/CloudGaming.DtoModel/CloudGaming.DtoModel.csproj", "Model/CloudGaming.DtoModel/"]
|
||||
COPY ["Model/CloudGaming.GameModel/CloudGaming.GameModel.csproj", "Model/CloudGaming.GameModel/"]
|
||||
COPY ["Utile/HuanMeng.DotNetCore/HuanMeng.DotNetCore.csproj", "Utile/HuanMeng.DotNetCore/"]
|
||||
|
|
|
|||
|
|
@ -1,128 +0,0 @@
|
|||
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.AppExtend;
|
||||
|
||||
/// <summary>
|
||||
/// 项目配置
|
||||
/// </summary>
|
||||
public class AppConfig
|
||||
{
|
||||
public AppConfig() { }
|
||||
/// <summary>
|
||||
/// 用户数据库连接字符串
|
||||
/// </summary>
|
||||
public string UserConnectionString { get; set; }
|
||||
/// <summary>
|
||||
/// 游戏
|
||||
/// </summary>
|
||||
public string GameConnectionString { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展
|
||||
/// </summary>
|
||||
public string ExtConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机app配置
|
||||
/// </summary>
|
||||
public string PhoneConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// redis连接字符串
|
||||
/// </summary>
|
||||
public string RedisConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string DomainName { get; set; }
|
||||
/// <summary>
|
||||
/// 标识
|
||||
/// </summary>
|
||||
public string Identifier { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认语言
|
||||
/// </summary>
|
||||
public string DefaultLanguage { get; set; }
|
||||
/// <summary>
|
||||
/// 租户
|
||||
/// </summary>
|
||||
public Guid TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 项目支付数据
|
||||
/// </summary>
|
||||
public PaymentModel? Payment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// oss阿里云配置
|
||||
/// </summary>
|
||||
public AliyunConfig AliyunConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户默认配置
|
||||
/// </summary>
|
||||
public UserConfig UserConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 游戏配置
|
||||
/// </summary>
|
||||
public GameConfig GameConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据库连接字符串
|
||||
/// </summary>
|
||||
/// <param name="key">user,game,ext,phone</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public string GetConnectionString(AppDataBaseType appDataBaseType)
|
||||
{
|
||||
switch (appDataBaseType)
|
||||
{
|
||||
case AppDataBaseType.User:
|
||||
return UserConnectionString;
|
||||
case AppDataBaseType.Game:
|
||||
return GameConnectionString;
|
||||
case AppDataBaseType.Ext:
|
||||
return ExtConnectionString;
|
||||
case AppDataBaseType.App:
|
||||
return PhoneConnectionString;
|
||||
default:
|
||||
throw new NotImplementedException("数据库连接字符串不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据库选项
|
||||
/// </summary>
|
||||
|
||||
public enum AppDataBaseType
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户数据库
|
||||
/// </summary>
|
||||
User,
|
||||
/// <summary>
|
||||
/// 游戏数据库
|
||||
/// </summary>
|
||||
Game,
|
||||
/// <summary>
|
||||
/// 扩展数据库
|
||||
/// </summary>
|
||||
Ext,
|
||||
/// <summary>
|
||||
/// app数据库
|
||||
/// </summary>
|
||||
App
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.AppExtend.ConfigModel;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 阿里云配置
|
||||
/// </summary>
|
||||
public class AliyunConfig
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string AccessKeyId { get; set; }
|
||||
/// <summary>
|
||||
/// 配置环境变量
|
||||
/// </summary>
|
||||
public string AccessKeySecret { get; set; }
|
||||
|
||||
#region 阿里云OSS配置
|
||||
/// <summary>
|
||||
/// 替换为Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
|
||||
/// </summary>
|
||||
public string EndPoint { get; set; }
|
||||
/// <summary>
|
||||
/// Bucket名称。
|
||||
/// </summary>
|
||||
public string BucketName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传路径
|
||||
/// </summary>
|
||||
public string UploadPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string? DomainName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀
|
||||
/// </summary>
|
||||
public string ImagePrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DomainName; //+ this.UploadPath
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 短信签名名称
|
||||
/// </summary>
|
||||
public string SmsSignName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// string 短信模板配置
|
||||
/// </summary>
|
||||
public string SmsTemplateCode { get; set; }
|
||||
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.AppExtend.ConfigModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class GameConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户渠道Id,如:edb684859b848362ec56904286947614
|
||||
/// </summary>
|
||||
public string ChannelId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户渠道key,加密使用
|
||||
/// </summary>
|
||||
public string SignKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户渠道地址
|
||||
/// </summary>
|
||||
public string BsUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
using Alipay.EasySDK.Kernel;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using SKIT.FlurlHttpClient.Wechat.TenpayV3;
|
||||
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Models;
|
||||
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace CloudGaming.Code.AppExtend.ConfigModel;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PaymentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信支付数据
|
||||
/// </summary>
|
||||
public WeChatConfig? WeChatConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付宝支付数据
|
||||
/// </summary>
|
||||
public Alipay.EasySDK.Kernel.Config? AlipayConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private WechatTenpayClient _wxClient;
|
||||
/// <summary>
|
||||
/// 微信支付客户端
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public WechatTenpayClient? WxClient
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_wxClient == null)
|
||||
{
|
||||
if (WeChatConfig == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var manager = new InMemoryCertificateManager();
|
||||
/* 仅列出必须配置项。也包含一些诸如超时时间、UserAgent 等的配置项 */
|
||||
var wechatTenpayClientOptions = new WechatTenpayClientOptions()
|
||||
{
|
||||
|
||||
MerchantId = WeChatConfig.MchId,
|
||||
MerchantV3Secret = WeChatConfig.Key,
|
||||
MerchantCertificateSerialNumber = WeChatConfig.MerchantCertificateSerialNumber,
|
||||
MerchantCertificatePrivateKey = WeChatConfig.MerchantCertificatePrivateKey,
|
||||
PlatformCertificateManager = manager
|
||||
};
|
||||
_wxClient = new WechatTenpayClient(wechatTenpayClientOptions);
|
||||
}
|
||||
return _wxClient;
|
||||
}
|
||||
}
|
||||
|
||||
// var conf = appConfig.Payment?.AlipayConfig ?? new Alipay.EasySDK.Kernel.Config();
|
||||
//var context = new Alipay.EasySDK.Kernel.Context(conf, "alipay-easysdk-net-2.1.0");
|
||||
//var app = new Alipay.EasySDK.Payment.App.Client(new Alipay.EasySDK.Kernel.Client(context));
|
||||
|
||||
private Alipay.EasySDK.Kernel.Context _aliPayContext;
|
||||
[JsonIgnore]
|
||||
public Alipay.EasySDK.Kernel.Context AliPayContext
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_aliPayContext == null)
|
||||
{
|
||||
if (AlipayConfig != null)
|
||||
{
|
||||
_aliPayContext = new Alipay.EasySDK.Kernel.Context(AlipayConfig, "alipay-easysdk-net-2.1.0");
|
||||
}
|
||||
}
|
||||
return _aliPayContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.AppExtend.ConfigModel;
|
||||
|
||||
/// <summary>
|
||||
/// 用户默认配置
|
||||
/// </summary>
|
||||
public class UserConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户默认头像
|
||||
/// </summary>
|
||||
public string UserIconUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 用户默认昵称
|
||||
/// </summary>
|
||||
public string NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户最大登录设备
|
||||
/// </summary>
|
||||
public int MaxDeviceCount { get; set; }
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.AppExtend.ConfigModel;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class WeChatConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// appId
|
||||
/// </summary>
|
||||
public string AppId { get; set; }
|
||||
/// <summary>
|
||||
/// appkey
|
||||
/// </summary>
|
||||
public string AppSecret { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Key { get; set; }
|
||||
/// <summary>
|
||||
/// 商户id
|
||||
/// </summary>
|
||||
public string MchId { get; set; }
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string NotifyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信支付序列号
|
||||
/// </summary>
|
||||
public string MerchantCertificateSerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信支付私钥
|
||||
/// </summary>
|
||||
public string MerchantCertificatePrivateKey { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Model\CloudGaming.AppConfigModel\CloudGaming.AppConfigModel.csproj" />
|
||||
<ProjectReference Include="..\..\Model\CloudGaming.DtoModel\CloudGaming.DtoModel.csproj" />
|
||||
<ProjectReference Include="..\..\Model\CloudGaming.GameModel\CloudGaming.GameModel.csproj" />
|
||||
<ProjectReference Include="..\..\Model\CloudGaming.Model\CloudGaming.Model.csproj" />
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ namespace CloudGaming.Code.Config
|
|||
appConfigDto.IsChecking = IsChecking;
|
||||
appConfigDto.SignKey = AppConfig.TenantId.ToString("N");
|
||||
appConfigDto.NightCardTips = $"22点30分至次日7点畅玩无消耗";
|
||||
appConfigDto.ChannelId = AppConfig.GameConfig.ChannelId;
|
||||
appConfigDto.BsUrl = appConfigDto.BsUrl;
|
||||
return appConfigDto;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,11 @@
|
|||
using Azure.Core;
|
||||
|
||||
using CloudGaming.Code.Account;
|
||||
using CloudGaming.Code.AppExtend.ConfigModel;
|
||||
using CloudGaming.Code.Contract;
|
||||
using CloudGaming.DtoModel.Account.User;
|
||||
using CloudGaming.DtoModel.Game;
|
||||
using CloudGaming.DtoModel.JY;
|
||||
using CloudGaming.DtoModel.PlayGame;
|
||||
|
||||
using HuanMeng.DotNetCore.Redis;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using Org.BouncyCastle.Crypto.Macs;
|
||||
|
||||
using Refit;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace CloudGaming.Code.Game;
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ global using Microsoft.Extensions.DependencyInjection;
|
|||
global using Microsoft.Extensions.Hosting;
|
||||
global using System.Diagnostics;
|
||||
|
||||
global using CloudGaming.Code.AppExtend.ConfigModel;
|
||||
global using CloudGaming.AppConfigModel;
|
||||
global using HuanMeng.DotNetCore.Redis;
|
||||
|
|
@ -41,5 +41,15 @@ public class AppConfigDto
|
|||
/// </summary>
|
||||
public string NightCardTips { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string BsUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string ChannelId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user