Beispiel #1
0
        public async Task <ResponseInfo> UnSubscribeService(string username)
        {
            CampaignSetting settingObj = await GetCampaignSetting();

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers.Add("secret", settingObj.APISecret);

            var data = new
            {
                DomainType   = settingObj.DomainType,
                DomainSecret = settingObj.DomainSecret
            };

            var jsonData = JsonConvert.SerializeObject(data);

            Invoker      invoker = new Invoker();
            ResponseInfo info    = await invoker.PostAsync <ResponseInfo>("POST", APIEndPoint.UnSubscribe, headers, jsonData);

            if (info.StatusCode == StatusCode.Created)
            {
                CampaignProvider provider = new CampaignProvider();
                await provider.UpdateCampaignSetting(subscribe : false, username);
            }

            return(info);
        }
Beispiel #2
0
        public async Task <CampaignSetting> GetCampaignSetting()
        {
            CampaignProvider provider = new CampaignProvider();

            return(await provider.GetCampaignSetting());
        }
Beispiel #3
0
 public async Task InitSetting(string username)
 {
     CampaignProvider provider = new CampaignProvider();
     await provider.InitSetting(username);
 }