新增续费接口,移除旧续费API
OEM结算 增加续费返现
This commit is contained in:
1 parent
b86134357c
commit
1df94a1d28
29 files changed
+1784
-103
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using Autofac;
|
||||
using Autofac.Integration.WebApi;
|
||||
using FreeSql;
|
||||
using KJD_Web.Repository;
|
||||
using KJD_Web.Utils;
|
||||
using MAX.Core.DependencyInjection;
|
||||
using MAX.Core.Logger;
|
||||
@@ -37,14 +38,37 @@ namespace KJD_Web
|
||||
var builder = new ContainerBuilder();
|
||||
var appAssembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
var connection = ConfigurationManager.ConnectionStrings["ConnKJD"];
|
||||
if (connection == null || string.IsNullOrWhiteSpace(connection.ConnectionString))
|
||||
{
|
||||
throw new ConfigurationErrorsException("未配置连接字符串:ConnKJD");
|
||||
}
|
||||
|
||||
// ImageCacheService 使用独立的 imagecache 数据库。
|
||||
builder.Register(_ => CreateImageCacheFreeSql())
|
||||
.As<IFreeSql>()
|
||||
.SingleInstance();
|
||||
builder.Register(_ =>
|
||||
{
|
||||
return new FreeSqlBuilder()
|
||||
.UseConnectionString(
|
||||
DataType.MySql,
|
||||
connection.ConnectionString)
|
||||
.Build();
|
||||
})
|
||||
.As<IFreeSql>()
|
||||
.SingleInstance();
|
||||
|
||||
builder.RegisterGeneric(typeof(AutofacRepository<>))
|
||||
.As(typeof(IBaseRepository<>))
|
||||
.UsingConstructor(typeof(IFreeSql))
|
||||
.InstancePerRequest();
|
||||
|
||||
|
||||
// 注册 Web API 所有 Controller
|
||||
builder.RegisterApiControllers(appAssembly);
|
||||
builder.RegisterInstance(NLogger.Instance).As<ILoggerFacade>().SingleInstance();
|
||||
|
||||
|
||||
|
||||
|
||||
#region 注册所有IOC接口
|
||||
|
||||
Type typeSingleton = typeof(ISingletonDependency);
|
||||
@@ -87,14 +111,13 @@ namespace KJD_Web
|
||||
{
|
||||
throw new ConfigurationErrorsException("未配置连接字符串:ConnKJD");
|
||||
}
|
||||
|
||||
var connectionBuilder = new MySqlConnectionStringBuilder(connection.ConnectionString)
|
||||
{
|
||||
Database = "imagecache"
|
||||
};
|
||||
//var connectionBuilder = new MySqlConnectionStringBuilder(connection.ConnectionString)
|
||||
//{
|
||||
// Database = "imagecache"
|
||||
//};
|
||||
|
||||
return new FreeSqlBuilder()
|
||||
.UseConnectionString(DataType.MySql, connectionBuilder.ConnectionString)
|
||||
.UseConnectionString(DataType.MySql, connection.ConnectionString)
|
||||
.UseAutoSyncStructure(false)
|
||||
.Build();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user