修改图片缓存,增加新日志,JSON返回驼峰

This commit is contained in:
chfei committed 2026-09-15 14:08:24 +08:00
1 parent 72f16034ac
commit b86134357c
12 files changed
+432 -152

No files matched your search

+40 -38
View File
@@ -2,12 +2,14 @@
using Autofac.Integration.WebApi;
using FreeSql;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using MAX.Core.DependencyInjection;
using MAX.Core.Logger;
using MAX.Framework.Logger;
using MySql.Data.MySqlClient;
using NLog;
using System;
using System.Configuration;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Web;
@@ -21,7 +23,7 @@ namespace KJD_Web
{
protected void Application_Start(object sender, EventArgs e)
{
LogHelper.Info("应用程序启动");
NLogger.Instance.Info("应用程序启动");
var container = BuildContainer();
// 让 Web API 用 Autofac 解析 Controller
@@ -42,7 +44,7 @@ namespace KJD_Web
// 注册 Web API 所有 Controller
builder.RegisterApiControllers(appAssembly);
builder.RegisterInstance(NLogger.Instance).As<ILoggerFacade>().SingleInstance();
#region 注册所有IOC接口
Type typeSingleton = typeof(ISingletonDependency);
@@ -113,50 +115,50 @@ namespace KJD_Web
string hPath = Request.Url.LocalPath.ToString();
//if (!hPath.Contains(".asmx") && hPath.Contains("/user/"))
//{
//hPath = hPath.Replace("/user/", "/UserService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/user/", "/UserService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/shop/"))
//{
//hPath = hPath.Replace("/shop/", "/ShopService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/shop/", "/ShopService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
//hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/order/"))
//{
//hPath = hPath.Replace("/order/", "/OrderService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/order/", "/OrderService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/product/"))
//{
//hPath = hPath.Replace("/product/", "/ProductService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/product/", "/ProductService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/product_third/"))
//{
//hPath = hPath.Replace("/product_third/", "/ProductThirdService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/product_third/", "/ProductThirdService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/price/"))
//{
//hPath = hPath.Replace("/price/", "/PriceService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/price/", "/PriceService.asmx/");
//Context.RewritePath(hPath);
//}
//if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_user/"))
//{
//hPath = hPath.Replace("/bxx_user/", "/BXXUserService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/bxx_user/", "/BXXUserService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_shop/"))
//{
//hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
@@ -165,30 +167,30 @@ namespace KJD_Web
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product/"))
//{
//hPath = hPath.Replace("/bxx_product/", "/BXXProductService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/bxx_product/", "/BXXProductService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product_third/"))
//{
//hPath = hPath.Replace("/bxx_product_third/", "/BXXProductThirdService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/bxx_product_third/", "/BXXProductThirdService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/"))
//{
//hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/");
//Context.RewritePath(hPath);
//}
//if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_user/"))
//{
//hPath = hPath.Replace("/dyxd_user/", "/DYUserService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/dyxd_user/", "/DYUserService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_shop/"))
//{
//hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
@@ -216,19 +218,19 @@ namespace KJD_Web
//}
//if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
//{
//hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_order/"))
//{
//hPath = hPath.Replace("/wxxd_order/", "/WXOrderService.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/wxxd_order/", "/WXOrderService.asmx/");
//Context.RewritePath(hPath);
//}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop_revenue_statistics/"))
//{
//hPath = hPath.Replace("/wxxd_shop_revenue_statistics/", "/WXShopRevenueStatistics.asmx/");
//Context.RewritePath(hPath);
//hPath = hPath.Replace("/wxxd_shop_revenue_statistics/", "/WXShopRevenueStatistics.asmx/");
//Context.RewritePath(hPath);
//}
// 请求录制:捕获请求链接与请求内容,用于迁移后的回放校验
//try { ApiRequestLogger.BeginRequest(Context); } catch { }