using DispenserCommon.DB; using DispenserCommon.Ioc; using DispenserCommon.Utils; using DispenserCore.Model.Entity; namespace DispenserCore.Service; /// /// 系统参数业务接口 /// [Component] public class SystemParamsService { private readonly SqliteHelper _db = ServiceLocator.GetService(); /// /// 获取系统参数 /// /// public SystemParams? GetSystemParams() { return _db.Query("select * from system_params limit 1") .FirstOrDefault(); } /// /// 保存或者更新系统参数 /// /// /// public SystemParams SaveOrUpdate(SystemParams @params) { return _db.SaveOrUpdate(@params); } /// /// 清除历史纪录 /// /// public void Delete(string id) { _db.DeleteById(id); } }