using RFrameGenerate.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wechat;
using weixinopen;

namespace JiouSDP.Controllers
{
    public class WeiXinTestController : BaseWeiXinController
    {
        //需要获取openid的,添加该属性
        //[WeiXinAuthorization(IsAuthorization = true)]
        public ActionResult AuthorizationTest(string name)
        {
            return Content("你好");
        }
        //分享,如果需要带上参数,在调用的时间应该加上(例:http://liuyi.rightcode.cn/weixintest/sharetest?shareopenid=1234567865432&name=value)
        [WeiXinShare(
            IsShare = true,
            guideStr = "让朋友也来享受吧",
            title = "测试分享",
            desc = "分享描述",
            imgUrl = "http://p5.qhimg.com/t0103c1e1d812407d87.png")]
        public ActionResult ShareTest()
        {
            //var currentParam = System.Web.Param.GetOrPostParam.GetRequestGet(Request);

            return View();
        }

        public ActionResult ShareTest1()
        {
            var share = new Share(Request.Url.ToString())
            {
                desc = "分享描述",
                title = "测试分享",
                guideStr = "让朋友也来享受吧",
                imgUrl = "http://p5.qhimg.com/t0103c1e1d812407d87.png",
            };
            ViewBag.sharejs = share.CreateShareToHtml();

            return View();
        }

    }
}
