移除Asmx文件 改为Controller API
This commit is contained in:
1 parent
e48ee01201
commit
72f16034ac
27 files changed
+4270
-326
No files matched your search
+104
-121
@@ -104,149 +104,132 @@ namespace KJD_Web
|
||||
|
||||
protected void Application_BeginRequest(object sender, EventArgs e)
|
||||
{
|
||||
if (Context.Request.Path == "/")
|
||||
{
|
||||
Context.Response.ContentType = "text/plain";
|
||||
Context.Response.Write("Service is running.");
|
||||
Context.Response.End();
|
||||
}
|
||||
string hPath = Request.Url.LocalPath.ToString();
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/user/"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/product/"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/price/", "/PriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//if (!hPath.Contains(".asmx") && hPath.Contains("/user/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/product/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/price/"))
|
||||
//{
|
||||
//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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_user/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product/"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/"))
|
||||
//{
|
||||
//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);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_user/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_product/", "/DYProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_product_third/", "/DYProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_price/", "/DYPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_user/", "/WXUserService.asmx/");
|
||||
Context.RewritePath(hPath, false);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_shop/", "/WXShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
//if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_user/"))
|
||||
//{
|
||||
// //hPath = hPath.Replace("/wxxd_user/", "/WXUserService.asmx/");
|
||||
// //Context.RewritePath(hPath, false);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/wxxd_shop/", "/WXShopService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product_third/", "/WXProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_price/", "/WXPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_order/"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
//if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
|
||||
//{
|
||||
//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);
|
||||
//}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop_revenue_statistics/"))
|
||||
//{
|
||||
//hPath = hPath.Replace("/wxxd_shop_revenue_statistics/", "/WXShopRevenueStatistics.asmx/");
|
||||
//Context.RewritePath(hPath);
|
||||
//}
|
||||
// 请求录制:捕获请求链接与请求内容,用于迁移后的回放校验
|
||||
//try { ApiRequestLogger.BeginRequest(Context); } catch { }
|
||||
}
|
||||
@@ -277,4 +260,4 @@ namespace KJD_Web
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user