forked from wenjy/HighWayIot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.8 KiB
C#
73 lines
1.8 KiB
C#
using HighWayIot.Log4net;
|
|
using HighWayIot.Repository.domain;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HighWayIot.Repository.service.Impl
|
|
{
|
|
public class BaseSysUserRoleServiceImpl : ISysUserRoleService
|
|
{
|
|
private LogHelper log = LogHelper.Instance;
|
|
Repository<SysRoleEntity> _repository => new Repository<SysRoleEntity>("sqlserver");
|
|
|
|
public List<SysRoleEntity> GetRoleInfos()
|
|
{
|
|
try
|
|
{
|
|
List<SysRoleEntity> deviceInfo = _repository.GetList();
|
|
|
|
|
|
return deviceInfo;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("用户信息获取异常", ex);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public bool InsertRoleInfo(SysRoleEntity sysRoleEntity)
|
|
{
|
|
try
|
|
{
|
|
return _repository.Insert(sysRoleEntity);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("用户信息插入异常", ex);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public bool UpdateRoleInfo(SysRoleEntity sysRoleEntity)
|
|
{
|
|
try
|
|
{
|
|
return _repository.Update(sysRoleEntity);
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
log.Error("用户信息修改异常", ex);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public bool DeleteRoleInfoById(int id)
|
|
{
|
|
try
|
|
{
|
|
return _repository.DeleteById(id);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("用户信息删除异常", ex);
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|