Example #1
0
        public async Task <bool> EnableMessageAsync(MessageEnableDTO dto)
        {
            var uri      = API.OaMessage.EnableMessageAsync(_baseUrl);
            var content  = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
            var response = await _apiClient.PostAsync(uri, content);

            response.EnsureSuccessStatusCode();
            string res = await response.Content.ReadAsStringAsync();

            return(res.ToLower() == bool.TrueString.ToLower());
        }
Example #2
0
        public async Task <bool> EnableMessageAsync([FromBody] MessageEnableDTO dto)
        {
            var list = await _messageService.EnableMessageAsync(dto.Ids);

            //获取立即执行的消息
            var imlist = list.Where(m => m.StartTime == 0 || m.EndTime == 0);

            foreach (var item in imlist)
            {
                await this.PushMessageAsync(item);
            }
            return(true);
        }