using Furion.DependencyInjection; using Nirvana.Common; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using YBDevice.Entity; namespace YBDevice.NApi.Application.NoticeInfo { public class NoticeService:INoticeService, ITransient { private readonly ISqlSugarRepository repository; private readonly SqlSugarClient dbClient; public NoticeService(ISqlSugarRepository sqlSugarRepository) { repository = sqlSugarRepository; dbClient = repository.Context; } /// /// 增加通知日志 /// /// /// public async Task InsertNoticeLogAsync(YB_NoticeLog log) { var data = new YB_NoticeLog { Ip = Net.Ip, CreateTime = DateTime.Now, FromInfo = log.FromInfo.ToStr(), Info = log.Info.ToStr(), UA = log.UA.ToStr(), UserInfo = log.UserInfo.ToStr() }; int id = await dbClient.Insertable(data).ExecuteReturnIdentityAsync(); return id; } } }