using System.Web.Http;
using System.Web.Mvc;

namespace jiouosdp.Areas.WeiXinApi
{
    public class WeiXinApiAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "WeiXinApi";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            //context.MapRoute(
            //    "WeiXinApi_default",
            //    "WeiXin/{controller}/{action}/{id}",
            //    new { controller = "api", action = "callback", id = UrlParameter.Optional }
            //);

            context.MapRoute(
                "AuthoEvent",
                 "weixin/AuthoEvent/{action}",
                 new { controller = "AuthoEvent", action = UrlParameter.Optional, id = UrlParameter.Optional }
            );

            context.MapRoute(
                "experience",
                 "weixin/experience/{action}",
                 new { controller = "Experience", action = UrlParameter.Optional, id = UrlParameter.Optional }
            );

            context.MapRoute(
                "experience2",
                 "experience/{action}",
                 new { controller = "Experience", action = UrlParameter.Optional, id = UrlParameter.Optional }

            );
            context.MapRoute(
                "Material",
                 "weixin/Material/{action}",
                 new { controller = "Material", action = UrlParameter.Optional, id = UrlParameter.Optional }

            );
            context.MapRoute(
                "WeiXinOpen",
                 "weixin/WeiXinOpen/{action}",
                 new { controller = "WeiXinOpen", action = UrlParameter.Optional, id = UrlParameter.Optional }

            );
            context.MapRoute(
                "WeiXin",
                 "weixin/WeiXin/{action}",
                 new { controller = "WeiXin", action = UrlParameter.Optional, id = UrlParameter.Optional }

            );
            //转发到api
            context.MapRoute(
                "WeiXinApi_default",
                "WeiXin/{appid}/{action}/{id}",
                new { controller = "WeiXinOpen", action = "callback", appid = UrlParameter.Optional, id = UrlParameter.Optional }
            );

        }
    }
}
