public void UnTaggingTest()
        {
            ICache       cache         = new InMemoryCache(new MemoryCache(new MemoryCacheOptions()));
            BaseSettings weixinSetting = new BaseSettings()
            {
                AppId     = "wx6eff55d0d76e210f",
                AppSecret = "60ab768429e8fc6b86abaa9cfd1c6565"
            };
            OAuthInterfaceCaller oAuthInterface = new OAuthInterfaceCaller(new RestClient(), weixinSetting);
            AccessTokenContainer container      = new AccessTokenContainer(cache, oAuthInterface);
            string accessToken = container.GetAccessToken();
            UserTagManageInterfaceCaller tagManageInterfaceCaller = new UserTagManageInterfaceCaller(new RestClient());

            Console.WriteLine(tagManageInterfaceCaller.UnTagging(accessToken, 100, "oGV7Kv5pT6m1P5zHDU3sHg4FT1JA"));
        }
        public void RemarkTest()
        {
            ICache       cache         = new InMemoryCache(new MemoryCache(new MemoryCacheOptions()));
            BaseSettings weixinSetting = new BaseSettings()
            {
                AppId     = "wx6eff55d0d76e210f",
                AppSecret = "60ab768429e8fc6b86abaa9cfd1c6565"
            };
            OAuthInterfaceCaller oAuthInterface = new OAuthInterfaceCaller(new RestClient(), weixinSetting);
            AccessTokenContainer container      = new AccessTokenContainer(cache, oAuthInterface);
            string accessToken = container.GetAccessToken();
            UserTagManageInterfaceCaller tagManageInterfaceCaller = new UserTagManageInterfaceCaller(new RestClient());

            Console.WriteLine(tagManageInterfaceCaller.Remark(accessToken, "oGV7Kv0bgXvAUabe8sDopmKlzPNE", "备注"));
        }
Exemple #3
0
        public void UpdateTagTest()
        {
            ICache       cache         = new InMemoryCache(new MemoryCache(new MemoryCacheOptions()));
            BaseSettings weixinSetting = new BaseSettings()
            {
                AppId     = "wx6eff55d0d76e210f",
                AppSecret = "60ab768429e8fc6b86abaa9cfd1c6565"
            };
            OAuthInterfaceCaller oAuthInterface = new OAuthInterfaceCaller(weixinSetting);
            AccessTokenContainer container      = new AccessTokenContainer(cache, oAuthInterface);
            string accessToken = container.GetAccessToken();
            UserTagManageInterfaceCaller tagManageInterfaceCaller = new UserTagManageInterfaceCaller();

            Console.WriteLine(tagManageInterfaceCaller.UpdateTag(accessToken, 100, "新名字"));
        }
        public void GetTagTest()
        {
            ICache       cache         = new InMemoryCache(new MemoryCache(new MemoryCacheOptions()));
            BaseSettings weixinSetting = new BaseSettings()
            {
                AppId     = "wx6eff55d0d76e210f",
                AppSecret = "60ab768429e8fc6b86abaa9cfd1c6565"
            };
            OAuthInterfaceCaller oAuthInterface = new OAuthInterfaceCaller(new RestClient(), weixinSetting);
            AccessTokenContainer container      = new AccessTokenContainer(cache, oAuthInterface);
            string accessToken = container.GetAccessToken();
            UserTagManageInterfaceCaller tagManageInterfaceCaller = new UserTagManageInterfaceCaller(new RestClient());
            var tags = tagManageInterfaceCaller.GetTags(accessToken);

            Console.WriteLine(JsonConvert.SerializeObject(tags));
        }
        public void UserInfoTest()
        {
            ICache       cache         = new InMemoryCache(new MemoryCache(new MemoryCacheOptions()));
            BaseSettings weixinSetting = new BaseSettings()
            {
                AppId     = "wx6eff55d0d76e210f",
                AppSecret = "60ab768429e8fc6b86abaa9cfd1c6565"
            };
            OAuthInterfaceCaller oAuthInterface = new OAuthInterfaceCaller(new RestClient(), weixinSetting);
            AccessTokenContainer container      = new AccessTokenContainer(cache, oAuthInterface);
            string accessToken = container.GetAccessToken();
            UserTagManageInterfaceCaller tagManageInterfaceCaller = new UserTagManageInterfaceCaller(new RestClient());
            var userInfo = tagManageInterfaceCaller.GetUserInfo(accessToken, "oGV7Kv0bgXvAUabe8sDopmKlzPNE", Model.Enums.Language.zh_CN);

            Console.WriteLine(JsonConvert.SerializeObject(userInfo));
        }