예제 #1
0
        public async Task <bool> ReadMessageAsync([FromBody] OaMessageReadDto message)
        {
            message.UserId = UserIdentity.UserId;
            var res = await _messageService.ReadMessageAsync(message);

            return(res);
        }
예제 #2
0
        public async Task <bool> ReadMessageAsync(OaMessageReadDto message)
        {
            var uri      = API.OaMessage.ReadMessageAsync(_baseUrl);
            var content  = new StringContent(JsonConvert.SerializeObject(message), 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());
        }
예제 #3
0
        public async Task <bool> ReadMessageAsync(OaMessageReadDto message)
        {
            var dbmessageUser = await _databaseFixture.Db.OaMessageUser.FindAsync(m => m.MessageId == message.MessageId && m.UserId == message.UserId);

            if (dbmessageUser != null)
            {
                dbmessageUser.IsRead = 1;
                await _databaseFixture.Db.OaMessageUser.UpdateAsync(dbmessageUser);

                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
 public async Task <bool> ReadMessageAsync([FromBody] OaMessageReadDto message)
 {
     return(await _messageService.ReadMessageAsync(message));
 }